Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTel: use semconv functions for filling out attributes #49

Closed
morigs opened this issue Dec 14, 2021 · 5 comments
Closed

OTel: use semconv functions for filling out attributes #49

morigs opened this issue Dec 14, 2021 · 5 comments

Comments

@morigs
Copy link

morigs commented Dec 14, 2021

Currently, otel middleware add all the attributes manually.
I think it's better to use semconv functions for cases when fasthttp.Request is compatible with http.Request because this will automatically add all recommended attributes. This is easier to maintain because following spec requires semconv package update only.

Besides, I think it should use SpanStatusFromHTTPStatusCodeAndSpanKind instead of SpanStatusFromHTTPStatusCode

@WLun001
Copy link
Contributor

WLun001 commented Jan 13, 2022

@morigs fasthttp is not compatible with http
https://github.com/valyala/fasthttp#faq

@morigs
Copy link
Author

morigs commented Jan 13, 2022

This is very unfortunate 😞
At least, we should ensure that the set of attributes is the same

@efectn
Copy link
Member

efectn commented Jan 13, 2022

I think we can create same semconv methods that compatible with fasthttp.Request. But i'm not sure about that, i didn't review semconv's code much

@WLun001
Copy link
Contributor

WLun001 commented Jan 13, 2022

@morigs yes i have checked it. If you found out any missing attributes please feel free to create issues or PRs

@morigs
Copy link
Author

morigs commented Jan 13, 2022

@WLun001 awesome, thank you!

@morigs morigs closed this as completed Jan 13, 2022
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

No branches or pull requests

3 participants