Skip to content

fix: spans should only include path in http.route (backport #7390)#7405

Merged
carodewig merged 4 commits into1.xfrom
mergify/bp/1.x/pr-7390
May 27, 2025
Merged

fix: spans should only include path in http.route (backport #7390)#7405
carodewig merged 4 commits into1.xfrom
mergify/bp/1.x/pr-7390

Conversation

@carodewig
Copy link
Contributor

@carodewig carodewig commented May 6, 2025

Per the OpenTelemetry spec, the http.route should only include "the matched route, that is, the path template used in the format used by the respective server framework."

The router currently sends the full URI in http.route, which can be high cardinality (ie /graphql?operation=one_of_many_values). After this change, the router will only include the path (/graphql).

In order to test this, I added a dependency on tracing-mock. It's currently in beta, but it's already used within the tracing library itself so I think it's probably pretty stable. However I'm happy to come up with another way to test this if preferred.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes


This is an automatic backport of pull request #7390 done by [Mergify](https://mergify.com).

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@carodewig carodewig requested a review from a team May 6, 2025 10:38
@carodewig carodewig requested review from a team as code owners May 6, 2025 10:38
@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented May 6, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 739aefb9f65d13c527e34859

@carodewig
Copy link
Contributor Author

tracing-mock requires a more modern version of tracing than we have in 1.x, so the tests as written don't work.
Ideally, I'd like to wait for the backport of #7369 which will allow us to easily test the attributes on spans.

@carodewig carodewig merged commit 85a4580 into 1.x May 27, 2025
14 checks passed
@carodewig carodewig deleted the mergify/bp/1.x/pr-7390 branch May 27, 2025 15:17
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.

3 participants