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

Add instrumentation for fastapi-events #1229

Closed
wants to merge 9 commits into from

Conversation

melvinkcx
Copy link

Description

Hi 👋 , this PR adds instrumentation for fastapi-events. This is my first contribution to opentelemetry-python-contrib, any feedback is much appreciated. Thanks =)

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • 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 cases have been added to cover standard usage of dispatching and handling events with fastapi-events.

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

@melvinkcx melvinkcx requested a review from a team August 16, 2022 06:07
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 16, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@srikanthccv
Copy link
Member

This looks like an instrumentation for a middleware package for FastAPI. I am not sure if this should be part of this repo. In an ideal scenario we want all the package authors to support OTEL natively but we maintain the instrumentation packages for various reasons. It already takes lot of compute resources to run the contrib tests and maintenance burden. I would suggest you pursue the author of the original middleware package to include the instrumentation support directly instead of writing another layer on top of it.

@ocelotl
Copy link
Contributor

ocelotl commented Aug 17, 2022

This looks like an instrumentation for a middleware package for FastAPI. I am not sure if this should be part of this repo. In an ideal scenario we want all the package authors to support OTEL natively but we maintain the instrumentation packages for various reasons. It already takes lot of compute resources to run the contrib tests and maintenance burden. I would suggest you pursue the author of the original middleware package to include the instrumentation support directly instead of writing another layer on top of it.

@srikanthccv Please discuss this topic in tomorrow SIG. I wont' be able to join but wanted to state this:

I'm personally not sure if we should reject this contribution on the grounds above because:

  1. It is not clearly determined what counts as an instrumentation we should keep in the contrib repo and what not (I would prefer for instrumentations to be each in their own individual repo but that is another discussion topic), maybe this can be included in the current fastapi instrumentation?
  2. It would be ideal if the OTel instrumentation is "natively" included in each third party library/framework, but unfortunately we have no control over that. If the third party library/framework community refuses to include it for whatever reason, users will be impacted by the lack of an alternative to do this kind of instrumentation.

Thanks! ✌️

@melvinkcx
Copy link
Author

Hi @srikanthccv @ocelotl 👋, thanks for the feedback.

I am the original author of fastapi-events, it is totally possible for me to add OTel support to it.

However, I was under the impression that instrumentation libraries should be added to this repo and it (ideally) serves as a collection of all available instrumentation. Perhaps it is worth updating the contributing guide to mention this to future contributors?

@srikanthccv
Copy link
Member

If you the author of the package then you should directly add it directly. The instrumentations are maintained here because package authors are/were not ready to support OTEL for various reasons. Some showed interest but didn't make much progress for example falconry/falcon#1828 . What serves as collection/index for instrumentations is this https://opentelemetry.io/registry/. If a package supports OTEL directly it should be listed there by adding entry.

@melvinkcx
Copy link
Author

melvinkcx commented Aug 17, 2022

@srikanthccv Got it! It makes a lot of sense to me now.

@srikanthccv
Copy link
Member

Yeah, people have this misconception that the instrumentaion should live here. That's not what we want to happen in the long run. Maybe my initial wording is not good I didn't mean to convey reject this but rather encourage you to pursue adding this support natively in the package (didn't know you are also the authour). There are number of reasons why I suggest this, the PRs for instrumentations do not get fast reviews because maintainers are busy and are not experts with specific library. And issues don't get addressed fast for the same reason. They pile up overtime and you can see this already in this repo. An regular python programmer can themselves write and publish opentelemetry-instrumentation-X on their own. There is restriction on that. Essentially I would like to see the community to pick up momentum and grow itself without having to depend on opentelemtry python team.

@srikanthccv
Copy link
Member

@srikanthccv srikanthccv closed this Nov 8, 2022
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