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

revert: feat(instrumentation/asgi): add target to metrics #1436

Closed
wants to merge 2 commits into from

Conversation

sk-
Copy link
Contributor

@sk- sk- commented Nov 10, 2022

Unfortunately I made a mistake in #1323 where I assumed that the scope was laready being processed by the framework at the moment of reporting, but of course that's not true as the framework has not even seen the request at that point.

Is for that reason that we are not able to extract any route information in the middleware to report what the target is.

Sorry for the noise, and be happy to help if anyone has any idea how we could fix this.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

Unfortunately I made a mistake in open-telemetry#1323 where I assumed that the scope was laready being processed by the framework at the moment of reporting, but of course that's not true as the framework has not even seen the request at that point.

Is for that reason that we are not able to extract any route information in the middleware to report what the target is.

Sorry for the noise, and be happy to help if anyone has any idea how we could fix this.
@sk- sk- requested a review from a team November 10, 2022 15:28
@sk-
Copy link
Contributor Author

sk- commented Nov 10, 2022

@srikanthccv could you please take a look

@srikanthccv
Copy link
Member

This is not breaking anything, right? It's just that target is not collected. I am not super familiar with this instrumentation, but if it's not breaking anything, we can spend some time and get the correct fix merged instead of reverting it.

@sk-
Copy link
Contributor Author

sk- commented Nov 16, 2022

@srikanthccv sounds good, I think I have found the way to fix it. Thanks for suggesting it. Will send a PR for that shortly.

@ocelotl
Copy link
Contributor

ocelotl commented Nov 18, 2022

t able to extract any route information in the middleware to report

@sk Is this PR still needed? If not please close it.

@sk-
Copy link
Contributor Author

sk- commented Nov 18, 2022

I think i have found a way to fix it, so closing it for now.

@sk- sk- closed this Nov 18, 2022
@gabrielqs
Copy link

was there ever a way to achieve this? i'm looking at span metrics emitted by the last version of the fastapi autoinstrumentation and i don't see the http.route attribute in them, even though this code is present in the otel sdk. maybe there's a way we could apply to have that attribute populate span metrics by using a custom span/metric processor?

@sk-
Copy link
Contributor Author

sk- commented Feb 21, 2024

Yes, this is working and being used in production. However, this was added for the asgi plugin, not sure how the fastapi plugin works.

Also note, that this was added some time ago, when the semantic conversions specified the attribute name was http.target, not http.route.

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.

4 participants