Open srikanthccv opened 1 year ago
@srikanthccv Curious if we are formalizing going down the route of utilizing handlers in supporting telemetry collection of different Python logging libraries. For example, Java is utilizing instrumentations for logging capture support. I wonder what the implications are of having logging library support via handlers. Ex. users would need to install the sdk to get logging library collection support since handlers exist within our sdk.
That's a good question. Let me take a look at Java implementations and come back on this.
I have been using a custom handler for structlog
that I wrote. Although I'm not sure how much of it is specific to our use case and possibly specific to Signoz (it will need a few iterations to make it generic enough). It also uses some private bits from structlog
, so the optional dependency on it will need to be restricted.
I can open a PR for this if adding handlers to the sdk is fine.
@Samyak2
It would be great if you could open a pr for this. We probably do not want this as part of the sdk. Can you open up a pr to the contrib repo and add a folder called "handlers"? The structlog handler can be a separate package as we are not trying to support anymore third party libraries in the core repository.
Any update on it?
I have a draft PR for this here - https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2139
I'm no longer working with structlog and otel in python, so I'll need some help testing and validating this approach.
I am working on a team of 4 to contribute to this issue as a university project. We have been working on developing tests for the structlog handler.
My team has completed tests for the structlog handler and integrated the tests into the tox testing framework. https://github.com/carolinecgilbert/opentelemetry-python-contrib
The tests are located in the instrumentation/opentelemetry-instrumentation-logging/tests/test_logging.py file under the TestStructlogHandler class.
@carolinecgilbert I'd suggest you open PR against the @Samyak2's PR. One of you needs to take it to the ready state for review. And address the review comments post that etc.. So you might just want to create a separate with co-authoring @Samyak2 if they don't have the bandwidth to drive this forward.
@carolinecgilbert
Are you still working this? If so, would you be able to open up a pr?
So you might just want to create a separate with co-authoring @Samyak2 if they don't have the bandwidth to drive this forward.
@carolinecgilbert I'm ok with having my commits cherry-picked or squashed into a different PR. I can help answer questions/review comments with the code too. I'll complete the CLA soon.
Are you still working this? If so, would you be able to open up a pr?
@lzchen looks like they have a PR here: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2492
Any updates on this? I'm really looking forward to the solution.
Similar to stdlib logging library, adding a handler for
structlog
the popular alternative logging library can enable people to directly export with OTLP