-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds environment variables for log exporter #3037
Conversation
@srikanthccv. This is the first draft of the PR. Please take a look. |
You are on the right track. Don't forget to add unit tests. Do you plan to implement the same for the HTTP exporter in another PR or update this PR itself? |
I plan to add HTTP changes as well here. Do you want them to be a separate PR? |
It's up to you. I am fine with either way. |
Please fix the conflicts and mark it ready if the implementation is complete. |
@srikanthccv Tests are not yet complete, I am trying to find the fix to the errors coming while writing the test. |
@srikanthccv grpc tests are failing for me. HTTP one is passing.
|
Were you able to find out why? |
@srikanthccv, I am not able to fix it. Can you help? Can you please point out what exactly am I doing wrong here, it will unblock me. |
When you have any failures, please try to understand the message and trace it back. It says
It says line 231 in exporter.py is the reason which links to one more invocation up in this call stack.
This is where it all started, line 93 in There are two lines in you code which I believe are the reason. ...
endpoint=endpoint or environ.get(OTEL_EXPORTER_OTLP_LOGS_ENDPOINT),
headers=headers or environ.get(OTEL_EXPORTER_OTLP_LOGS_HEADERS),
... I hope you know what trailing comma (,) in Python does >>>
>>> foo = 1,
>>> foo
(1,) |
@srikanthccv, I get it now. So, in layman's terms, the "," was making the variable a tuple and the This is the output I am getting.
|
Please spend some time reading about how mocks work and when the args list is non-empty. |
@srikanthccv, I read mocking and tried to fix the error. I had to call,
The tests are still failing for me. Trying to find the fix. |
I tried to look for all the properties the exporter is exposing via I only get the following.
How do I test properties like Ref: 9447d0e#diff-b46561f17e94b2de768ab7d81658ef144122a638a7ffb3fcd82fe122a9561b37R194-R195 |
@srikanthccv Do I have to add the label to "skip public api check symbol"? |
@pridhi-arora One last change before we merge this. Please update the minimum required SDK version to |
@pridhi-arora friendly ping |
Signed-off-by: PridhiArora <pridhiarora17@gmail.com>
@srikanthccv Done! |
Thanks! |
* main: fixed all instances of @tracer.start_as_current_span("name"): to @tracer.start_as_current_span("name") as decorators do not have colons (open-telemetry#3127) Add attribute name to type warning message. (open-telemetry#3124) Fix requirements file for example (open-telemetry#3126) Add db metric name to semantic conventions (open-telemetry#3115) Adds environment variables for log exporter (open-telemetry#3037) Fix bug in example (open-telemetry#3111)
Description
Fixes #2939
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
tox -e test-exporter-otlp-proto-grpc
tox -e test-exporter-otlp-proto-http
Does This PR Require a Contrib Repo Change?
Checklist: