-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 [Bug]: OTeL duplicate and wrong counter metrics are generated infinitely #794
Comments
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
I think this issue can be moved to contrib repo. |
@efectn I have reported an related issue there: open-telemetry/opentelemetry-go#4563 |
This is incorrect usage of Fiber. See https://pkg.go.dev/github.com/gofiber/fiber/v2#Ctx.Params
|
Can you share the line you are referring to? |
Sorry I accidently send a comment when I was answering here open-telemetry/opentelemetry-go#4563 馃槈
The issue is here: https://github.com/oliverdding/otel-test/blob/1bb67cf571d89d836d20b44f6278ae166a008d6b/cmd/server/main.go#L132-L136 You should make a copy of appID = strings.Clone(appID)
requestCount.Add(c.UserContext(), 1, metric.WithAttributes(attribute.String("app_id", appID))) |
Oh馃槩, it's my fault... Thanks for pointing out @pellared |
Bug Description
I have raised a bug issue in opentelemetry-go SDK repository.
When using fiber to manually reporting request count with delta temporality, the server will keep reporting wrong attributes value and wrong datapoint size infinitely.
While using go http library or something else, everything work as expected so I got the right request count.
How to Reproduce
See my demo repository:
https://github.com/oliverdding/otel-test
Start with:
Or you can run go cmd program manually with:
Expected Behavior
There should be ten datapoints, with app_id from 1 to 10.
Fiber Version
v2.49.2
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: