Add standard observability metrics across all services per ADR-0018 #22293
+1,151
−145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Implements standard Prometheus metrics across all services according to ADR-0014 (Observability Tools) and ADR-0018 (Service Metrics). Previously, services lacked consistent metrics for version tracking, SLA monitoring, and cache performance.
Changes
Metrics Implementation
Added standard metric sets to 4 services (link, metadata, bff, proxy):
Build Information - Exposes version, commit, build time
SLA/SLO/SLI Metrics
service_availability_ratio- Uptime tracking for SLA compliancehttp_request_duration_seconds- Response time histogram for SLO monitoringerror_rate_per_minute- Error counter for reliability SLICache Metrics
cache_hit_total/cache_miss_total- Cache effectiveness trackinghits / (hits + misses)Service Metrics
requests_per_second- Load trackingresponse_time_seconds- Performance histogramerror_rate_percentage- Error rate gaugeService Updates
metrics.gowith Prometheus client usingpromautoStandardMetrics.tsusing OpenTelemetry Metrics APIDocumentation
docs/tutorial/observability-metrics.md- Complete metrics reference with PromQL examplesdocs/tutorial/observability-upgrade-summary.md- Implementation guide and integration stepsdocs/tutorial/observability.mdwith referencesIntegration Requirements
Services require build-time variable injection:
go build -ldflags "-X main.version=$VERSION -X main.commit=$COMMIT -X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)"Metrics are exposed but not yet actively recorded. Applications need to call metric functions in:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/open-telemetry/opentelemetry-go/releases/latestcurl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.