Skip to content

Conversation

@vadimi
Copy link

@vadimi vadimi commented Jan 26, 2026

This version performs the same instrumentation as previously available otelecho in opentelemetry-go-contrib repo, but with echo v5 support

v5 sub-directory is used specifically in case of new v6, v7, etc versions of echo come out in the future

This version performs the same instrumentation as previously available
`otelecho` in `opentelemetry-go-contrib` repo, but with echo v5 support

v5 sub-directory is used specifically in case of new v6, v7, etc
versions of echo come out in the future
@aldas aldas self-assigned this Jan 26, 2026
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.69%. Comparing base (1e69e54) to head (f3a0cc8).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
+ Coverage   63.77%   67.69%   +3.91%     
==========================================
  Files           9        9              
  Lines         969      585     -384     
==========================================
- Hits          618      396     -222     
+ Misses        308      157     -151     
+ Partials       43       32      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@aldas
Copy link
Contributor

aldas commented Jan 29, 2026

Just a quick heads-up that I will be reviewing this over the weekend.

@mojixcoder
Copy link

mojixcoder commented Jan 31, 2026

Thanks, this PR is heavily needed and is our only blocker to upgrade to v5.
Moving this package to echo-contrib has a little difference with the otelecho one which is addressed in #143 .
But I think it's out of scope of this PR.

@aldas
Copy link
Contributor

aldas commented Feb 2, 2026

Update: I did review this PR on Saturday+Sunday and decided that I need to research more on that semconv package part and probably do some refactoring. I do not feel comfortable maintaining it in current form.

Let's see what progress I have on Wednesday. Currently this issue is on top of my Echo list.

@vadimi
Copy link
Author

vadimi commented Feb 6, 2026

thanks @aldas, anything I can do to help?

@aldas
Copy link
Contributor

aldas commented Feb 6, 2026

@vadimi , At the moment nothing. I made good progress yesterday, but have not finished it yet. Today was spent on fixing vulnerility reported in static middleware (fixed in 5.0.3). I will work on it over the weekend.

@aldas
Copy link
Contributor

aldas commented Feb 8, 2026

Hi @vadimi, I forked your PR to a branch in my repo.

  • I reworked semconv parts, added proper documentation in code. Hats down for Otel maintainers for Specification website, but having these rules in code is easier for reviewer.
  • To be honest, Otel API with the excessive use of functional options and need for ... everywhere is quite poor developer UX in my opinion so for Echo middleware I switched to more Go-esque config structs approach.
  • I have not finished with the tests yet
  • documentation needs some improvement
  • I probably ask Otel people if they are interested in that extraction part. The current code generation + API (without knowing details) feels real overkill for Go HTTP frameworks like Echo/Gin/Chi/Mux etc.

This is how it looks like:
https://github.com/aldas/echo-contrib/tree/echootel/echootel

working example is here: https://github.com/aldas/echo-contrib/blob/echootel/echootel/example/main.go
It is based on Otel Echo example

@vadimi
Copy link
Author

vadimi commented Feb 8, 2026

Thanks for making the progress @aldas! One difference I've noticed in your branch comparing to the OTel echo is the requestDuration metric:

m.requestDurationHistogram.Inst().Record(ctx, float64(v.RequestDuration.Milliseconds()), o)

OTel echo v4 divides it by 1000 as the bucket boundaries are in seconds:

n.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o)

In terms of semver/semnverutil Otel package there was a conversation some time ago: open-telemetry/opentelemetry-go-contrib#4580, doesn't look like there is a consensus.

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.

3 participants