opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Structlog and Loguru Handlers with Examples

Open carolinecgilbert opened this issue 1 year ago • 3 comments

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

carolinecgilbert avatar May 03 '24 06:05 carolinecgilbert

CLA Signed


The committers listed above are authorized under a signed CLA.

Thanks for contributing but all 3 of you need to sign he CLA in order to get the code accepted

xrmx avatar May 03 '24 12:05 xrmx

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.

pmcollins avatar Jul 02 '24 17:07 pmcollins

Can this be merged if everything is ok?

giulioindev avatar Sep 16 '24 17:09 giulioindev

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

xrmx avatar Sep 17 '24 13:09 xrmx

PR has been abandoned: https://github.com/open-telemetry/opentelemetry-python/issues/2993#issuecomment-2355851358

Anyone can feel free to pick up this work :)

lzchen avatar Sep 18 '24 15:09 lzchen

If the PR is ready to merge, why not merge it as it is ? @xrmx

leonard-henriquez avatar Sep 25 '24 21:09 leonard-henriquez

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?

jlugao avatar Sep 29 '25 22:09 jlugao