-
Notifications
You must be signed in to change notification settings - Fork 731
Add credentials environment variables to let ChannelCredentials
and Session
be injected
#4689
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
base: main
Are you sure you want to change the base?
Conversation
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
|
||
from grpc import ChannelCredentials # pylint: disable=import-error |
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.
Could this be an issue if the SDK is running in an environment without grpcio installed? I know the operator auto-instrumentation layer for Python pre-installs the HTTP exporters and not the grpc exporters to avoid extension issues.
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.
Yeah that's a good point ! I don't think we should require these modules (requests, grpc) for the SDK, so we have to use try/catch blocks on the imports.. I updated the PR.. Let me know what you think
] | ||
|
||
|
||
def _load_credential_from_envvar( |
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.
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 think it would be better altough we are doing this kind of defensive import for psutil in SDK for resources
Description
Add environment variables to allow
ChannelCredentials
andSession
to be injected into OTLP exporters for auto instrumentation. See #4459 for more details..Fixes # 4459
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Unit tests
Does This PR Require a Contrib Repo Change?
Checklist: