Structlog and Loguru Handlers with Examples
Description
Implemented unit tests for an existing structlog handler PR and implemented a log handler for the Loguru logging library located in the handlers directory. The tests are located in the opentelemetry-instrumentation-logging test_logging.py file to be compatible with the tox testing framework.
Built basic example OTel applications that use the structlog and loguru handlers to provide guidance on how to implement the handlers.
Dependencies Required: structlog, loguru
Fixes # (issue) https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2139
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
- [ ] Implemented handler unit tests in existing test_logging.py file in the tox framework
- [ ] tox -e test-instrumentation-logging
Does This PR Require a Core Repo Change?
- [ ] No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
- [x] Followed the style guidelines of this project
- [ ] Changelogs have been updated
- [x] Unit tests have been added
- [x] Documentation has been updated
Thanks for contributing but all 3 of you need to sign he CLA in order to get the code accepted
Thanks for the change. I might be missing some context, but perhaps consider splitting this into two PRs, one for loguru and the other for structlog. Multiple, smaller PRs tend to get through the review process faster than fewer larger ones.
Can this be merged if everything is ok?
Can this be merged if everything is ok?
This should be splitted per https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2492#issuecomment-2203873674
PR has been abandoned: https://github.com/open-telemetry/opentelemetry-python/issues/2993#issuecomment-2355851358
Anyone can feel free to pick up this work :)
If the PR is ready to merge, why not merge it as it is ? @xrmx
PR has been abandoned: open-telemetry/opentelemetry-python#2993 (comment)
Anyone can feel free to pick up this work :)
@lzchen I'd like to help but I'm a bit at loss with the status and expectations on this issue, I see @znd4 did most of the work here. Can you provide some guidance here on what is missing and what is expected?
I have some time available and a need to use this at the company I'm working for.
On https://github.com/Delgan/loguru/issues/674 there was a discussion about the instrumentation/formatting part of the integration. I'm now researching using an exporter to send logs through grpc/http.
Anyways, how can I help? Should I rebase https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2906 we do a round of review and go from there?