Skip to content

Commit

Permalink
[telemetry] Fix scheduler queue count telemetry metric (#6247)
Browse files Browse the repository at this point in the history
It was tagged by check_name, which doesn't make sense since it's
incremented when a new scheduler queue is created, so it should
count the total number of queues.

If we want to track the check names per queue, we should introduce
another telemetry metric (I'm not sure if it's worth counting that
though).
  • Loading branch information
olivielpeau authored Aug 20, 2020
1 parent 951a737 commit dfe3eee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var (
aggregatorHostnameUpdate = expvar.Int{}

tlmFlush = telemetry.NewCounter("aggregator", "flush",
[]string{"data_type", "state"}, "Count of flush")
[]string{"data_type", "state"}, "Number of metrics/service checks/events flushed")
tlmProcessed = telemetry.NewCounter("aggregator", "processed",
[]string{"data_type"}, "Amount of metrics/services_checks/events processed by the aggregator")
tlmHostnameUpdate = telemetry.NewCounter("aggregator", "hostname_update",
Expand Down
4 changes: 2 additions & 2 deletions pkg/collector/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
tlmChecksEntered = telemetry.NewGauge("scheduler", "checks_entered",
[]string{"check_name"}, "How many checks are currently tracked by the scheduler")
tlmQueuesCount = telemetry.NewCounter("scheduler", "queues_count",
[]string{"check_name"}, "How many queues were opened")
nil, "How many queues were opened")
)

func init() {
Expand Down Expand Up @@ -92,7 +92,7 @@ func (s *Scheduler) Enter(check check.Check) error {
s.jobQueues[check.Interval()] = newJobQueue(check.Interval())
s.startQueue(s.jobQueues[check.Interval()])
if check.IsTelemetryEnabled() {
tlmQueuesCount.Inc(check.String())
tlmQueuesCount.Inc()
}
schedulerQueuesCount.Add(1)
}
Expand Down

0 comments on commit dfe3eee

Please sign in to comment.