-
Notifications
You must be signed in to change notification settings - Fork 499
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 autoinstrumentation for Python #532
Add autoinstrumentation for Python #532
Conversation
e971264
to
c5bfb96
Compare
pkg/instrumentation/sdk.go
Outdated
@@ -58,6 +58,12 @@ func inject(logger logr.Logger, insts languageInstrumentations, ns corev1.Namesp | |||
pod = injectCommonSDKConfig(otelinst, ns, pod) | |||
pod = injectNodeJSSDK(logger, otelinst.Spec.NodeJS, pod) | |||
} | |||
if insts.Python != nil { | |||
otelinst := *insts.Python | |||
logger.V(1).Info("injecting instrumentation into pod", "otelinst-namespace", otelinst.Namespace, "otelinst-name", otelinst.Name) |
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.
it would be good to include python in the log message
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.
Thanks, fixed
container.Env[idx].Value = fmt.Sprintf("%s:%s:%s", pythonPathPrefix, container.Env[idx].Value, pythonPathSuffix) | ||
} | ||
|
||
// Set OTEL_TRACES_EXPORTER to HTTP exporter if not set by user because it is what our autoinstrumentation supports. |
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.
python does not support OTLP GRPC?
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.
It does but uses a native extension wrapping gRPC-C. This means the extension can only be loaded on the same python version as when pip install was invoked.
HTTP transport is pure python so avoids causing potential version problems.
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.
By the way related comment here
…or into autoinstrumentation-pyton
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.
Approving based on @pavolloffay's approval.
* Add autoinstrumentation for Python * Better log * Fix merge
* Add autoinstrumentation for Python * Better log * Fix merge
No description provided.