Skip to content

Clean Route setup in HTTP instrumentations #6919

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

Closed
5 tasks
dmathieu opened this issue Mar 12, 2025 · 11 comments
Closed
5 tasks

Clean Route setup in HTTP instrumentations #6919

dmathieu opened this issue Mar 12, 2025 · 11 comments
Labels
good first issue Good for newcomers

Comments

@dmathieu
Copy link
Member

dmathieu commented Mar 12, 2025

Now that we rely on the request.Pattern attribute to set the route attribute automatically (#6905), we should analyze all HTTP instrumentations that also set that attribute, and ensure the code can't be cleaned up to avoid repetition.

@dmathieu dmathieu added the good first issue Good for newcomers label Mar 12, 2025
@arshukla98
Copy link
Contributor

arshukla98 commented Mar 18, 2025

Hi @dmathieu , I'd like to work on this issue. Could you please assign it to me?

@dmathieu
Copy link
Member Author

This issue should actually bring multiple PRs, one for each instrumentation. I can add you to one of them. Which one would you like?

@arshukla98
Copy link
Contributor

@dmathieu , I would like to take up otelgin instrumentation.

@dmathieu
Copy link
Member Author

Done.

@Oloruntobi1
Copy link
Contributor

otelecho (seems to use semconv attribute directly. It shouldn't)

Hi @dmathieu stumbled upon this conversation and wanted to pick this up (for otelecho) and from what i see it uses both https://github.com/open-telemetry/opentelemetry-go-contrib/blob/7af8c94c5b95671bdb17a997d2d9c0094a3a5036/instrumentation/github.com/labstack/echo/otelecho/echo.go#L14C2-L14C102 and

semconv "go.opentelemetry.io/otel/semconv/v1.20.0"

This means the first work should trying to consolidate that like its been done for otelgin and others?

@Ananyasinha13
Copy link

hi @dmathieu can you assign otelhttp to me

@flc1125
Copy link
Member

flc1125 commented Mar 25, 2025

otelmux can be assigned to me.

@flc1125
Copy link
Member

flc1125 commented Mar 30, 2025

@dmathieu I checked all the related issues and PRs. I want to confirm the problems we need to address.

  1. Check if related extensions (e.g., otelmux) have duplicate configurations for http.Route information.

  2. If duplicates or incorrect configurations exist, they will be set based on request.Pattern, ensuring uniqueness.

  3. It's possible that extension packages have their own set of route information. If conflicts arise here, we need to establish a priority order for configuring http.Route. If I understand correctly, should it be: extension package's route > request.Pattern?

Is my understanding correct?

@flc1125
Copy link
Member

flc1125 commented Apr 1, 2025

@dmathieu I checked all the related issues and PRs. I want to confirm the problems we need to address.

  1. Check if related extensions (e.g., otelmux) have duplicate configurations for http.Route information.
  2. If duplicates or incorrect configurations exist, they will be set based on request.Pattern, ensuring uniqueness.
  3. It's possible that extension packages have their own set of route information. If conflicts arise here, we need to establish a priority order for configuring http.Route. If I understand correctly, should it be: extension package's route > request.Pattern?

Is my understanding correct?

@dmathieu Hello, is there any news?

@dmathieu
Copy link
Member Author

dmathieu commented Apr 2, 2025

It's possible that extension packages have their own set of route information. If conflicts arise here, we need to establish a priority order for configuring http.Route. If I understand correctly, should it be: extension package's route > request.Pattern?

You don't need this. If that happens, overriding attributes is fine.
Outside of that, your approach looks good.

@dmathieu
Copy link
Member Author

One of the big issues with those changes is that not many frameworks are already using/setting req.Pattern. And it's not our role to set that value.
So I'm going to close this issue. We may want to review things on a per-framework basis as a cleanup thing later in the future.

@dmathieu dmathieu closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants