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

style(internal/shared/semconv): Simplify request processing #6990

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gaiaz-iusipov
Copy link
Contributor

@gaiaz-iusipov gaiaz-iusipov commented Mar 26, 2025

I suggest a few changes to request processing:

  • Remove the redundant call to req.UserAgent().
  • Replace strings.Index() calls with strings.IndexByte().
  • Replace strings.LastIndex() calls with strings.LastIndexByte().

@gaiaz-iusipov gaiaz-iusipov requested review from dmathieu, a team and dashpole as code owners March 26, 2025 13:29
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 75.8%. Comparing base (cddf5c6) to head (57445c7).

Files with missing lines Patch % Lines
...ei/go-restful/otelrestful/internal/semconv/util.go 75.0% 0 Missing and 1 partial ⚠️
...com/gin-gonic/gin/otelgin/internal/semconv/util.go 75.0% 0 Missing and 1 partial ⚠️
...b.com/gorilla/mux/otelmux/internal/semconv/util.go 75.0% 0 Missing and 1 partial ⚠️
...p/httptrace/otelhttptrace/internal/semconv/util.go 75.0% 0 Missing and 1 partial ⚠️
...ntation/net/http/otelhttp/internal/semconv/util.go 75.0% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #6990   +/-   ##
=====================================
  Coverage   75.8%   75.8%           
=====================================
  Files        207     207           
  Lines      19494   19494           
=====================================
+ Hits       14783   14786    +3     
+ Misses      4275    4273    -2     
+ Partials     436     435    -1     
Files with missing lines Coverage Δ
...o-restful/otelrestful/internal/semconv/httpconv.go 86.9% <100.0%> (ø)
...gin-gonic/gin/otelgin/internal/semconv/httpconv.go 86.9% <100.0%> (ø)
...m/gorilla/mux/otelmux/internal/semconv/httpconv.go 86.9% <100.0%> (ø)
...tptrace/otelhttptrace/internal/semconv/httpconv.go 86.9% <100.0%> (ø)
...ion/net/http/otelhttp/internal/semconv/httpconv.go 86.9% <100.0%> (ø)
...ei/go-restful/otelrestful/internal/semconv/util.go 82.8% <75.0%> (ø)
...com/gin-gonic/gin/otelgin/internal/semconv/util.go 82.8% <75.0%> (ø)
...b.com/gorilla/mux/otelmux/internal/semconv/util.go 82.8% <75.0%> (ø)
...p/httptrace/otelhttptrace/internal/semconv/util.go 82.8% <75.0%> (ø)
...ntation/net/http/otelhttp/internal/semconv/util.go 82.8% <75.0%> (ø)

... 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.

@gaiaz-iusipov
Copy link
Contributor Author

Do I need to add anything to the changelog?

@dmathieu
Copy link
Member

semconvutil will be dropped after the next release.
As for semconv, it will be refactored later on.

So I wouldn't focus on refactoring those packages at the moment.

@gaiaz-iusipov
Copy link
Contributor Author

semconvutil will be dropped after the next release. As for semconv, it will be refactored later on.

So I wouldn't focus on refactoring those packages at the moment.

Thanks, can I close this pull request or keep a small part of the changes in the semconv package?

@gaiaz-iusipov gaiaz-iusipov changed the title style(internal/shared): Simplify request processing style(internal/shared/semconv): Simplify request processing Mar 26, 2025
@dmathieu
Copy link
Member

The semconv changes are small enough that we can keep them IMHO.

@dmathieu dmathieu added the Skip Changelog Allow PR to succeed without requiring an addition to the CHANGELOG label Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Allow PR to succeed without requiring an addition to the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants