Skip to content

Export counters for sent events and accumulated events

Taka Nishida requested to merge add-counters-for-events into master

Export two counters for sent events and accumulated events using OpenTelemetry.

  • sent_events_counter: The total number of sent events from KAS to GitLab monolith
  • accumulated_events_counter: The total number of accumulated events in KAS event tracker

EventTracker's AccumulatedEvents field will be used for checking the number of accumulating events, and flush the events if it reaches the limit. I will create another MR to flush the events.

Part of #514 (closed).

Closes #516 (closed).

I've verified this using stdout exporter for OpenTelemetry. This is the (updated) excerpt of the sample output (using stdout). The two new metrics are grouped under the scope "kas".

        "ScopeMetrics": [
                ...
                {
                        "Scope": {
                                "Name": "kas",
                                "Version": "",
                                "SchemaURL": ""
                        },
                        "Metrics": [
                                {
                                        "Name": "sent_events_counter",
                                        "Description": "The total number of sent events from KAS to GitLab monolith",
                                        "Unit": "",
                                        "Data": {
                                                "DataPoints": [
                                                        {
                                                                "Attributes": [],
                                                                "StartTime": "2024-02-05T14:08:36.932316+09:00",
                                                                "Time": "2024-02-05T14:09:06.930232+09:00",
                                                                "Value": 4
                                                        }
                                                ],
                                                "Temporality": "CumulativeTemporality",
                                                "IsMonotonic": true
                                        }
                                },
                                {
                                        "Name": "accumulated_events_counter",
                                        "Description": "The total number of accumulated events in KAS event tracker",
                                        "Unit": "",
                                        "Data": {
                                                "DataPoints": [
                                                        {
                                                                "Attributes": [],
                                                                "StartTime": "2024-02-05T14:08:36.932319+09:00",
                                                                "Time": "2024-02-05T14:09:06.930234+09:00",
                                                                "Value": 0
                                                        }
                                                ],
                                                "Temporality": "CumulativeTemporality",
                                                "IsMonotonic": false
                                        }
                                }
                        ]
Edited by Taka Nishida

Merge request reports