This page documents the process a member of the Secure: Secret Detection team should use to add metrics to capture product insights for the features we develop.
This page documents the process a member of the Secure: Secret Detection team should use to add
metrics to capture product insights for the features we develop.
You should this guide to help you understand the 2 different types of metrics we
You should use this guide to help you understand the different types of metrics we
can use, when to use each one, and give you a jumpstart in implementing them.
### Metrics workflow
@@ -26,9 +27,9 @@ For our use cases, we utilize Internal Tracking Events or Database Metrics
(formerly Service Ping) depending on the situation:
- Internal Tracking Events are good for capturing _events_ that occur but aren't
stored in the database. E.g., a user clicks a specific button.
stored in the database. For example, a user clicks a specific button.
- Database metrics are useful when the data you want _is_ stored in the database
in some way that can be extracted with the right query. E.g., the nubmer of
in some way that can be extracted with the right query. For example, the number of
projects that have a setting enabled.
The Analytics Instrumentation team has great documentation
@@ -77,9 +78,8 @@ You should utilize them in that order when possible, i.e., `label` before
#### Process for adding
You should follow the process Analytics Instrumentation has defined in the [quick start guide](https://docs.gitlab.com/ee/development/internal_analytics/internal_event_instrumentation/quick_start.html#quick-start-for-internal-event-tracking).
linked docs.
TL;DR Run the `ruby scripts/internal_events/cli.rb` CLI tool and follow the
Run the `ruby scripts/internal_events/cli.rb` CLI tool and follow the
prompts. The event definition is necessary for the code to know what
events to output and the metric definition is what Snowflake and Tableau will
make available given the events.
@@ -99,7 +99,6 @@ it_behaves_like 'internal event tracking' do
...
subject
end
```
Unlike in the implementation file, when using the shared example in the specs,
@@ -162,7 +161,6 @@ that can be used to create the necessary classes: