Skip to content

opentelemetry: fix import ordering #99

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

Merged
merged 6 commits into from
Jun 10, 2025
Merged

opentelemetry: fix import ordering #99

merged 6 commits into from
Jun 10, 2025

Conversation

danberdev
Copy link
Member

@danberdev danberdev commented May 28, 2025

Just an import ordering fix
Also one ignore for mypy due to untyped auto_instrumentation (ugh!)

@vrslev
Copy link
Contributor

vrslev commented Jun 2, 2025

LGTM, давай ещё исправим CI?

@danberdev danberdev force-pushed the hotfix/lint branch 2 times, most recently from 0f12183 to ca0c60c Compare June 9, 2025 18:20
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
unittests 98.85% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
microbootstrap/bootstrappers/fastapi.py 100.00% <100.00%> (ø)
...obootstrap/instruments/opentelemetry_instrument.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danberdev danberdev force-pushed the hotfix/lint branch 2 times, most recently from 0837272 to a44e88b Compare June 9, 2025 18:30
danberdev added 2 commits June 9, 2025 18:47
- auto_instrumentation patched away
- Results checked in the test were missing one is_ready() call
danberdev added 3 commits June 9, 2025 18:48
- resources module uses constants that are just aliases to ResourceAttributes module. The module has
a @deprecated message though. But it doesn't appear to matter at the moment.
- resources certainly have Resource!
@danberdev
Copy link
Member Author

@vrslev fixed all issues, also fixed one test that you've added, please take a look, thanks!

@vrslev
Copy link
Contributor

vrslev commented Jun 10, 2025

All good, do we need to test the actual auto instrumentation? or is it too hard?

@danberdev
Copy link
Member Author

All good, do we need to test the actual auto instrumentation? or is it too hard?

I think it's pointless due to these reasons:

  1. It's an obscure magic method from opentelemetry with unpredictable side-effects. (Honestly, I don't like it, I'd better stick with explicit initializations, but in the end of the day no code is better than a little code)
  2. Auto instrumentation behavior depends on installed instruments
  3. We have some tests on installed instrumentation (Pyroscope e.g.)
  4. Yeah, it's really hard in the end of the day. I can think of some possible ways (and considering obscure magic method it might be even desirable in case of changes in opentelemetry), but it would take considerable time and effort to engineer that, I'd keep it as a good task for later.

@vrslev vrslev merged commit 675c1a4 into main Jun 10, 2025
18 checks passed
@vrslev vrslev deleted the hotfix/lint branch June 10, 2025 11:04
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.

2 participants