feat: add OpenTelemetry metrics middleware alongside go-metrics#531
Open
adityakrmishra wants to merge 1 commit intopalantir:developfrom
Open
feat: add OpenTelemetry metrics middleware alongside go-metrics#531adityakrmishra wants to merge 1 commit intopalantir:developfrom
adityakrmishra wants to merge 1 commit intopalantir:developfrom
Conversation
Member
|
Thanks for your interest in palantir/go-githubapp, @adityakrmishra! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
Generate changelog in
|
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.
Addresses #439
Hi team,
Following up on the discussion in #439, this PR introduces OpenTelemetry as an alternative metrics layer. It runs entirely parallel to the existing
rcrowley/go-metricsimplementation to ensure zero disruption to internal Palantir systems that rely on the legacy metrics.What this solves:
The legacy
go-metricslacks label/tag support, forcing high-cardinality data likeinstallation_idinto the metric names. This new OTel middleware maps the exact same data points but uses proper OTel attributes (e.g.,github.rate.remaining{installation.id="42"}).Changes:
go.opentelemetry.io/otel/metrictogo.mod(API only, keeping it lightweight without SDK bloat).githubapp/middleware_otel.gocontaining the parallel implementation.middleware.go,dispatcher.go,scheduler.go).New Entry Points:
Users can now opt-in via:
OTelClientMetrics(mp)OTelErrorCallback(mp)OTelAsyncErrorCallback(mp)WrapSchedulerWithOTel(inner, mp)All existing tests pass, and the code has been written to match the idiomatic style and comment density of the current project. Let me know if any adjustments are needed!