Skip to content

Conversation

@DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Nov 11, 2025

Description

More ways to look at what an agent is doing! Here are some metrics geared towards monitoring long-lived agents: agent workers running, pings, jobs, and log chunk uploads, plus all the default Go runtime metrics that the library creates.

Agent-specific metrics:

  • buildkite_agent_jobs_ended_total
  • buildkite_agent_jobs_started_total
  • buildkite_agent_logs_bytes_uploaded_total
  • buildkite_agent_logs_bytes_uploads_errored_total
  • buildkite_agent_logs_chunk_uploads_errored_total
  • buildkite_agent_logs_chunks_uploaded_total
  • buildkite_agent_logs_upload_duration_seconds_total
  • buildkite_agent_pings_actions_total
  • buildkite_agent_pings_duration_seconds_total
  • buildkite_agent_pings_errors_total
  • buildkite_agent_pings_sent_total
  • buildkite_agent_pings_wait_duration_seconds_total
  • buildkite_agent_workers_ended_total
  • buildkite_agent_workers_started_total

Context

https://linear.app/buildkite/issue/PB-920

Changes

  • Attach a promhttp.Handler() to the health-check server mux at the standard path, /metrics.
  • Define some basic metrics
  • Add data to the metrics

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)
  • A bit of manual testing

Disclosures / Credits

I enjoy this stuff.

@DrJosh9000 DrJosh9000 requested a review from a team November 11, 2025 05:58
@DrJosh9000 DrJosh9000 force-pushed the pb-920-add-prom-metrics branch 2 times, most recently from abb7bbd to 8d30131 Compare November 12, 2025 03:16
@DrJosh9000 DrJosh9000 force-pushed the pb-920-add-prom-metrics branch from 8d30131 to a00135e Compare November 12, 2025 04:29
@zhming0 zhming0 self-assigned this Nov 13, 2025
Copy link
Contributor

@zhming0 zhming0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍🏿

@DrJosh9000 DrJosh9000 merged commit ed03944 into main Nov 13, 2025
1 check passed
@DrJosh9000 DrJosh9000 deleted the pb-920-add-prom-metrics branch November 13, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants