Integrate OpenTelemetry and Prometheus metrics across services#67
Merged
oschwartz10612 merged 5 commits intodevfrom Apr 3, 2026
Merged
Integrate OpenTelemetry and Prometheus metrics across services#67oschwartz10612 merged 5 commits intodevfrom
oschwartz10612 merged 5 commits intodevfrom
Conversation
oschwartz10612
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
This pull request introduces comprehensive OpenTelemetry-based observability and metrics instrumentation for Gerbil, supporting both Prometheus-native and OTel/OTLP metrics export. It includes a pluggable backend architecture, detailed documentation, example configurations for both Prometheus and OTel Collector, and a full test suite for the metrics subsystem. The changes also add new dependencies for OpenTelemetry and Prometheus clients.
Observability and Metrics Architecture:
Documentation and Examples:
docs/observability.mddetailing the observability design, configuration (CLI, env vars), metric catalog, and backend selection guidance.README.mdto summarize observability features and direct users to the new documentation.examples/prometheus.ymlfor Prometheus scraping andexamples/otel-collector-config.yamlfor OTel Collector pipelines, demonstrating both pull and push-based metric flows. [1] [2]Testing and Validation:
internal/metrics/metrics_test.gocovering backend initialization, metric recording, and HTTP scraping for Prometheus, as well as validation for noop and invalid backends.Dependency Updates:
go.modto include OpenTelemetry and Prometheus client libraries, plus their transitive dependencies, enabling the new observability features.How to test?
See docs/observability.md