Skip to content

otelgin: update default span name to align with semantic conventions #6381

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

Merged
merged 11 commits into from
Apr 17, 2025

Conversation

flc1125
Copy link
Member

@flc1125 flc1125 commented Nov 28, 2024

fixes #7088

SpanNameFormatter has undergone a breaking change, which can be considered when reviewing whether the project necessitates it.

From my previous recollection, I believe this part was adjusted according to this logic. Moreover, otelgin is still in an unstable version, meaning it permits some breaking changes.

@flc1125 flc1125 requested a review from a team as a code owner November 28, 2024 15:58
@github-actions github-actions bot requested a review from akats7 November 28, 2024 15:59
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.0%. Comparing base (da1ea48) to head (7e89019).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #6381   +/-   ##
=====================================
  Coverage   80.9%   81.0%           
=====================================
  Files        204     204           
  Lines      18065   18079   +14     
=====================================
+ Hits       14630   14650   +20     
+ Misses      3007    3003    -4     
+ Partials     428     426    -2     
Files with missing lines Coverage Δ
...ntation/github.com/gin-gonic/gin/otelgin/config.go 100.0% <100.0%> (ø)
...umentation/github.com/gin-gonic/gin/otelgin/gin.go 92.8% <100.0%> (-0.1%) ⬇️

... and 1 file with indirect coverage changes

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

@flc1125 flc1125 changed the title refactor(otelgin): refine span name formatting and deprecate SpanNameFormatter option otelgin: refine span name formatting and deprecate SpanNameFormatter option Nov 28, 2024
@dmathieu
Copy link
Member

dmathieu commented Dec 3, 2024

Based on the ongoing discussions with the need or not for SpanNameFormatter, could you update this PR to only include the default span name?

@flc1125
Copy link
Member Author

flc1125 commented Dec 3, 2024

Based on the ongoing discussions with the need or not for SpanNameFormatter, could you update this PR to only include the default span name?

OK, I will add another draft version of the PR (which may not have passed unit testing and CI).

@flc1125
Copy link
Member Author

flc1125 commented Dec 3, 2024

@dmathieu A draft version: #6396

@flc1125
Copy link
Member Author

flc1125 commented Apr 7, 2025

Temporarily closed for now; will be reprocessed once there are further developments.

@flc1125 flc1125 closed this Apr 7, 2025
@akats7
Copy link
Contributor

akats7 commented Apr 7, 2025

@flc1125 I missed this issue the first time around, but what was the blocker here?

@akats7 akats7 reopened this Apr 7, 2025
@flc1125
Copy link
Member Author

flc1125 commented Apr 8, 2025

@flc1125 I missed this issue the first time around, but what was the blocker here?

It's been quite some time, and I recall it was because there were still some content or semantic agreements that needed confirmation. Moreover, discussions were still ongoing. So, this matter was temporarily put on hold.

Due to the prolonged lack of progress, I have decided to close it for now. Until there are new developments, I will consider reopening it.

If there are any new changes, I will continue to address this issue.

@flc1125
Copy link
Member Author

flc1125 commented Apr 8, 2025

#7088 These two issues may have some correlation.

@akats7
Copy link
Contributor

akats7 commented Apr 8, 2025

Yep this seems to resolve that issue. I don’t see any blockers regarding only updating the default span names. Unless the goal was to have the logic sit in the semconv package and avoid duplication.

@flc1125
Copy link
Member Author

flc1125 commented Apr 8, 2025

Yep this seems to resolve that issue. I don’t see any blockers regarding updating only updating the default span names. Unless the goal was to have the logic sit in the semconv package and avoid duplication.

OK, if there are no problems hindered for now, I will continue to track this issue.

@akats7
Copy link
Contributor

akats7 commented Apr 8, 2025

Yep this seems to resolve that issue. I don’t see any blockers regarding updating only updating the default span names. Unless the goal was to have the logic sit in the semconv package and avoid duplication.

OK, if there are no problems hindered for now, I will continue to track this issue.

Do you mind either updating the PR title or opening a new PR to make it clear that we’re not deprecating SpanNameFormatter

@flc1125 flc1125 changed the title otelgin: refine span name formatting and deprecate SpanNameFormatter option otelgin: update default span name to align with semantic conventions Apr 8, 2025
@flc1125
Copy link
Member Author

flc1125 commented Apr 8, 2025

Do you mind either updating the PR title or opening a new PR to make it clear that we’re not deprecating SpanNameFormatter

It has been changed. If there is any mistake in the description, can you help me adjust it. (PS: My English is not very good)

@flc1125 flc1125 marked this pull request as ready for review April 12, 2025 15:09
@flc1125
Copy link
Member Author

flc1125 commented Apr 12, 2025

Ready for review. @akats7 @dmathieu

Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

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

FullPath() is a high cardinality value. We should make this the HTTP pattern/route, not the path.

If the path is /blog/1234, and the route is defined as /blog/{id} then, the latter should be used.

Copy link
Member

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

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

Left minor comments. It overall looks good.

@dmathieu
Copy link
Member

Unless someone objects, I will merge this tomorrow.

@dmathieu dmathieu merged commit 49d8c30 into open-telemetry:main Apr 17, 2025
28 checks passed
@flc1125 flc1125 deleted the otelgin-span branch April 17, 2025 13:49
@MrAlias MrAlias added this to the v1.36.0 milestone Apr 24, 2025
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.

Update the span name format for gin-gonic/gin to the latest semconv
4 participants