Skip to content

Prometheus telemetry - #8

Merged
creativeprojects merged 3 commits into
mainfrom
prometheus
Jul 13, 2026
Merged

creativeprojects merged 3 commits into
mainfrom
prometheus

Conversation

@creativeprojects

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 13, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Prometheus/OpenTelemetry-based telemetry to expose runtime metrics (disk temperature/activity and fan zone speed) and adds a built-in HTTP endpoint for scraping, while also updating the simulation RNG to math/rand/v2 with two seeds.

Changes:

  • Add OpenTelemetry metric instrumentation for disks and fan zones, with a Prometheus exporter.
  • Add an HTTP metrics server and wire telemetry/metrics startup + shutdown into main.
  • Switch simulation RNG seeding to two uint64 seeds and migrate to math/rand/v2.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
telemetry.go Creates the OTel Prometheus exporter and initializes telemetry.
metrics.go Adds the /metrics HTTP server endpoint.
main.go Wires telemetry + metrics server lifecycle into startup/shutdown.
lib/telemetry.go Defines OTel metrics (observable gauges) for disks and fan zones.
lib/zone.go Adds CurrentSpeed() accessor used by telemetry.
lib/control.go Minor logging message change.
lib/global.go Switches simulation RNG to math/rand/v2 PCG with two seeds.
lib/simulation/sensor.go Migrates simulated sensors to math/rand/v2.
lib/simulation/sensor_test.go Updates tests for math/rand/v2 seeding.
flags.go Replaces single simulation seed flag with two seed flags.
cfg/config.go Adds telemetry config and replaces seed config with two seeds.
config.yaml Adds telemetry configuration example.
go.mod Adds Prometheus + OpenTelemetry metric dependencies.
go.sum Updates module checksums for new dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread metrics.go
Comment thread metrics.go
Comment thread main.go
Comment thread lib/zone.go Outdated
Comment thread config.yaml
@creativeprojects
creativeprojects merged commit f15e137 into main Jul 13, 2026
1 check passed
@creativeprojects
creativeprojects deleted the prometheus branch July 13, 2026 17:12
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.

2 participants