Conversation
xrmx
left a comment
There was a problem hiding this comment.
LGTM, I think we are missing the entry point
There was a problem hiding this comment.
Testing this locally and this is not working out of the box and am not able to figure out how it's supposed to load something that is not the default.
Anyway after adding to pyproject.toml:
[project.entry-points.opentelemetry_event_logger_provider]
sdk_event_logger_provider = "opentelemetry.sdk._events:EventLoggerProvider"
And using the env var to set it via:
OTEL_PYTHON_EVENT_LOGGER_PROVIDER=sdk_event_logger_provider
I get an exception because the proxy logger does not have the resource attribute:
File "/venv/lib/python3.10/site-packages/opentelemetry/sdk/_events/__init__.py", line 59, in emit
resource=self._logger.resource,
AttributeError: 'ProxyLogger' object has no attribute 'resource'
Adding OTEL_PYTHON_LOGGER_PROVIDER=sdk_logger_provider did fix the the exception but still did not see anything exported under opentelemetry-instrument. This could well be a generic issue with logs more than something events specific though (or a case of PEBKAC).
In the api pyproject we should probably add the following to match what the other providers are doing:
[project.entry-points.opentelemetry_event_logger_provider]
default_event_logger_provider = "opentelemetry._events:NoOpEventLoggerProvider"
pmcollins
left a comment
There was a problem hiding this comment.
LGTM overall -- thx for doing this. Added a comment about testing methodology.
|
I would prefer to keep the scope of this pr to just manual implementation and include support for autoinstrumentation in a separate pr. |
|
Thanks a lot for working on this one 🙌🏻 . For anyone who wants to review, here is my basic checklist:
|
From the specs
Fixes #4156