Visitar URL original
Add snippets for prometheus clients compatibility documentation by jack-berg · Pull Request #8716 · open-telemetry/opentelemetry-go-contrib · GitHub
Skip to content

Add snippets for prometheus clients compatibility documentation - #8716

Merged
dmathieu merged 7 commits into
open-telemetry:mainfrom
jack-berg:add-prometheus-examples
Apr 14, 2026
Merged

dmathieu merged 7 commits into
open-telemetry:mainfrom
jack-berg:add-prometheus-examples

Conversation

@jack-berg

Copy link
Copy Markdown
Member

Over in opentelemetry.io, I'm writing a compatibility guide comparing how prometheus client concepts to opentelemetry API: open-telemetry/opentelemetry.io#9263

It includes working code snippets for a variety of key API usage patterns, in multiple languages.

opentelemetry.io has a pattern called "code excerpts" which allow code from git submodules to be referenced in docs. We use this liberally in opentelemetry java docs, and to a lesser extent with opentelemetry go docs. I recently updated opentelemetry.io to go examples which were relocated to opentelemetry-go-contrib here: open-telemetry/opentelemetry.io#9462.

This PR adds all the go code snippets for the compatibility page. Here's the PR to add the java-equivalent examples: open-telemetry/opentelemetry-java-examples#1032

cc @dashpole, @ArthurSens who have been helping review the PR from a go and prometheus perspective.

@jack-berg
jack-berg requested a review from a team as a code owner March 22, 2026 00:25

@dashpole dashpole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm with nits

@flc1125

flc1125 commented Mar 24, 2026

Copy link
Copy Markdown
Member

I think there might be a missing configuration here:

excluded-modules:
- go.opentelemetry.io/contrib/examples/dice/instrumented
- go.opentelemetry.io/contrib/examples/dice/uninstrumented
- go.opentelemetry.io/contrib/examples/namedtracer
- go.opentelemetry.io/contrib/examples/opencensus
- go.opentelemetry.io/contrib/examples/otel-collector
- go.opentelemetry.io/contrib/examples/passthrough
- go.opentelemetry.io/contrib/examples/prometheus
- go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/v2/mongo/otelmongo

@codecov

codecov Bot commented Mar 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.5%. Comparing base (2402eee) to head (2e9356c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #8716     +/-   ##
=======================================
+ Coverage   83.4%   83.5%   +0.1%     
=======================================
  Files        192     192             
  Lines      15639   15639             
=======================================
+ Hits       13046   13068     +22     
+ Misses      2145    2123     -22     
  Partials     448     448             

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg

Copy link
Copy Markdown
Member Author

I think there might be a missing configuration here:

Thanks @flc1125 - resolved!

@dashpole - the corresponding opentelemetry.io PR got an approval from docs maintainers. Can we merge this so I can update the submodules to the latest ref and get the build passing?

@dashpole

Copy link
Copy Markdown
Contributor

Yep, just need another approval. cc @open-telemetry/go-approvers

@dmathieu
dmathieu merged commit d217051 into open-telemetry:main Apr 14, 2026
29 checks passed
@pellared pellared added this to the v1.44.0 milestone May 27, 2026
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.

5 participants