Skip to content

fix(telemetry): classify project metrics and upstream status snapshot instruments as gauges #1253

Closed

Description

@dan-petty

Summary

Point-in-time snapshot metrics (such as GitHub issue items by milestone, releases, commits per release, merged PRs per release, 14-day traffic view counts, stargazers, forks, and upstream service operational status codes) were declared as InstrumentKind.COUNTER rather than gauges.

Because short-lived CLI processes emit OTLP delta metrics, the collector's deltatocumulative processor accumulated snapshot values across periodic emissions rather than recording current states. This caused the Project & Engineering Velocity Grafana dashboard (project-metrics.json) to report vastly inflated numbers (e.g. 34,000+ closed items instead of ~120).

Remediation

  1. Add InstrumentKind.GAUGE to instruments.py and route gauge emissions to tracer.record_gauge(...).
  2. Reclassify snapshot inventory instruments (PROJECT_ITEMS_TOTAL, PROJECT_COMMITS_TOTAL, PROJECT_PRS_TOTAL, PROJECT_CI_RUNS_TOTAL, PROJECT_RELEASES_TOTAL, PROJECT_STARS_TOTAL, PROJECT_FORKS_TOTAL, PROJECT_TRAFFIC_*, UPSTREAM_SERVICE_STATUS, UPSTREAM_COMPONENT_STATUS) from COUNTER to GAUGE.
  3. Update Panel 5 in project-metrics.json to compute interval per release by dividing sum by count.
  4. Update docs/TELEMETRY.md and test suite.

Activity

  1. added
    type/bug
    scope/telemetry
    priority/p1-high
    on Oct 6, 2026
  2. added this to the v0.2.27 milestone on Oct 6, 2026
  3. dan-petty-bot commented on Oct 6, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1254, merged into release/v0.2.27 as 93fefaa.

    Summary

    Resolves #1253.
    On Grafana dashboard devops-project-metrics/project-and-engineering-velocity (k8s/monitoring/dashboards/project-metrics.json), values were multitudes higher than actual numbers (e.g. 34,000+ closed issues, inflated commits, traffic views, etc.).

    11 file(s) changed.

    How it was verified

    Check runs at 4a3f5bd:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1253-classify-project-metrics-and-upstream-status-snapshot-instruments-as-gauges.md:

    • InstrumentKind.GAUGE added and supported by emit() and tracer.record_gauge().
    • All point-in-time inventory and status code instruments reclassified from COUNTER to GAUGE.
    • Panel 5 in project-metrics.json computes release interval per release using sum divided by count.
    • docs/TELEMETRY.md and changelog fragment changelog.d/1253.md updated.
    • Unit test suite in tests/test_telemetry_instruments.py verifies gauge recording behavior.
    • Quality gate uv run devops ci completes with 100% passing status.
  4. added a commit that references this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/telemetrytype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions