Commit 7bc2972e authored by Aditya Tiwari's avatar Aditya Tiwari 💬 Committed by Russell Dickenson
Browse files

Document event naming convention

parent 18cae0df
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -223,6 +223,26 @@ For architecture and design considerations, see
For implementation details on adding new events, see the
[analyzer README](https://gitlab.com/gitlab-org/security-products/analyzers/secrets#adding-observability-events).

### Event naming convention

Follow this pattern when adding new events:

```plaintext
collect_<analyzer_name>_<type>_metrics_from_pipeline
```

Where `<type>` describes the category of metrics. For example:

- `collect_secrets_analyzer_scan_metrics_from_pipeline`
- `collect_secrets_analyzer_ruleset_customization_metrics_from_pipeline`
- `collect_ds_analyzer_scan_duration_metrics_from_pipeline`

> [!note]
> Some existing [events](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/services/security/process_scan_events_service.rb#L9) use different naming patterns (for example,
> `sast_scan` instead of the analyzer name). These are unchanged
> to avoid breaking existing Snowflake queries and dashboards.
> This convention applies to new events only.

### Register the event

Events require a corresponding definition in the GitLab monolith and must be added to the