Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add Env variables in OTLP exporter #1101
Add Env variables in OTLP exporter #1101
Changes from all commits
416d55d
a24a88d
ced438a
da5a7a2
045ad91
710a60b
d6995de
47a5dcb
c704a55
168771f
8e66bd1
fc4429e
269b8cb
d4c6192
e4c2c09
0b3e5fc
30ac5e7
8ed3903
dcd4f69
acd3024
b9527ef
af89d7d
f0d415d
f9ae58d
4e70e10
eff69d4
82e78de
49b2ed6
bdaebb1
a9f5bae
500f8c7
5a5708c
593f459
6f37169
9483813
2ff2492
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to use the OTLP Exporter today and I think I ran into an issue. If you don't have the
OTEL_PYTHON_EXPORTER_OTLP_CERTIFICATE
Env variable set, then the call toConfiguration().EXPORTER_OTLP_CERTIFICATE
https://github.com/open-telemetry/opentelemetry-python/blob/master/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py#L175
will return
None
instead of aString
. Then this line will throw errorTypeError: expected str, bytes or os.PathLike object, not NoneType
which is not caught by
FileNotFoundError
below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest opening a new issue to track these problems instead of continuing an already closed PR thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
protocol
,certificate_file
in constructor,compression
andtimeout
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add env vars for
protocol
compression
when those usecases are implemented. Currently exporter usesgrpc
only and no implementation forcompression
.certificate_file
is wrapped in ChannelCredentials object which is passed down fromOTLPSpanExporter|MetricExporter
. I'll changetimeout
logic to use env var too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compression is implemented in a separate PR https://github.com/open-telemetry/opentelemetry-python/pull/1141/files#diff-77db88bbe988c1d7f7d9f92f9e05400259a026e7203f7e9ee12aef76b3b0fdb3R142
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set
OTLPExporter(insecure=True)
this works fine, but if I leave that out, I get a messagewhich makes sense because
insecure=None
andcredentials=None
. I think a follow up would be to throw an Error Message ifinsecure=None (or False) && credentials=None
saying "Error: Either provide credentials or label as insecure."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NathanielRN Thanks for reporting this. I also ran into this issue. Causes a failure in the example code.