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

feat: add HTTP_ROUTE attribute to http incoming metrics if present #3581

Merged

Conversation

hermogenes
Copy link
Contributor

Which problem is this PR solving?

Fixes #3553

Short description of the changes

Add HTTP_ROUTE attribute to metrics if SpanAttribute also has it.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@hermogenes hermogenes requested a review from a team February 1, 2023 14:26
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 1, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: hermogenes / name: Hermógenes Ferreira (e155137)

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #3581 (347c575) into main (65e83d4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 347c575 differs from pull request most recent head 8e69b75. Consider uploading reports for the commit 8e69b75 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3581   +/-   ##
=======================================
  Coverage   93.96%   93.96%           
=======================================
  Files         260      260           
  Lines        7803     7805    +2     
  Branches     1621     1622    +1     
=======================================
+ Hits         7332     7334    +2     
  Misses        471      471           
Impacted Files Coverage Δ
...es/opentelemetry-instrumentation-http/src/utils.ts 99.18% <100.00%> (+<0.01%) ⬆️

@hermogenes
Copy link
Contributor Author

Thanks for working on this!

Thanks! Could you run the workflow again @legendecas?

@legendecas
Copy link
Member

Would you mind adding an entry to /~https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/CHANGELOG.md? Thanks!

@hermogenes
Copy link
Contributor Author

@hermogenes
Copy link
Contributor Author

hermogenes commented Feb 8, 2023

Hey @legendecas! Given I don't have write permission, someone else must merge this PR. do we have a timeline? Just to understand when I could use this new version

@legendecas
Copy link
Member

We need another approval from @open-telemetry/javascript-approvers then we can land this PR.

@Flarna
Copy link
Member

Flarna commented Feb 8, 2023

Maybe worth to mention that this likely wont work with e.g. fastify because there HTTP_ROUTE is set directly on span and therefore not included in the attributes returned by getIncomingRequestAttributesOnResponse().

Created open-telemetry/opentelemetry-js-contrib#1381 to track this.

@hermogenes
Copy link
Contributor Author

Maybe worth to mention that this likely wont work with e.g. fastify because there HTTP_ROUTE is set directly on span and therefore not included in the attributes returned by getIncomingRequestAttributesOnResponse().

Created open-telemetry/opentelemetry-js-contrib#1381 to track this.

Hello @Flarna valid point! But it doesn’t block this change right?

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding this 🙂

@legendecas
Copy link
Member

But it doesn’t block this change right?

I don't think it is a blocker to this.

@Flarna
Copy link
Member

Flarna commented Feb 8, 2023

No blocker. Just want to leave this info to avoid others start debugging if the "wrong" framework is used.
The changes there should be not that hard, maybe I find some free slot the next days.

@dyladan dyladan merged commit e0d6e14 into open-telemetry:main Feb 9, 2023
@hermogenes hermogenes deleted the add-http-route-to-metrics-attribute branch February 9, 2023 14:39
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.

Please, add http.target and http.url to metric attributes
5 participants