Add Structlog Handler as Instrumentation#4286
Add Structlog Handler as Instrumentation#4286JWinermaSplunk wants to merge 11 commits intoopen-telemetry:mainfrom
Conversation
e0317fa to
fab1022
Compare
| return _STD_TO_OTEL[levelno] | ||
|
|
||
|
|
||
| class StructlogHandler: |
There was a problem hiding this comment.
Could this be simplified by subclassing an existing type in structlog (which I don't know that well 🙂 )?
|
Thank you for undertaking this! |
| current_processors.insert(insert_position, processor) | ||
|
|
||
| # Reconfigure structlog with the new processor chain | ||
| structlog.configure(processors=current_processors) |
There was a problem hiding this comment.
During auto-instrumentation, instrumentors will run first, then the user's code will run, and if that code calls structlog.configure, looks like it will overwrite this config. The solution may be to monkeypatch structlog.configure.
There was a problem hiding this comment.
Believe I resolved this by intercepting the original call, injecting the handler into the processors list, then calling the original once. But, I will leave this comment unresolved for context just in case I did not.
fd07c37 to
ddae8b5
Compare
|
I think a rebase is needed. This PR is now reverting some unrelated docker-test fixes (this other PR) |
ef6ad9a to
ece1f64
Compare
Believe I went ahead and rebased, but feel free to let me know if it still looks off! |
|
Hey team, |
# Conflicts: # .github/workflows/test_0.yml # .github/workflows/test_1.yml # .github/workflows/test_2.yml # opentelemetry-contrib-instrumentations/pyproject.toml # Conflicts: # .github/workflows/core_contrib_test.yml
# Conflicts: # .github/workflows/test_1.yml # .github/workflows/test_2.yml # .github/workflows/test_3.yml
2648150 to
26c68f5
Compare
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 open-telemetry/opentelemetry-python#2993
Type of change
Please delete options that are not relevant.
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
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.