Skip to content
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

Merged
merged 4 commits into from
Nov 17, 2021

Conversation

anuraaga
Copy link
Contributor

No description provided.

@anuraaga anuraaga requested review from a team and bogdandrutu November 11, 2021 06:33
@anuraaga
Copy link
Contributor Author

@pavolloffay @jpkrohling

@@ -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)
Copy link
Member

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

Copy link
Contributor Author

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.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

#524 (comment)

Copy link
Member

@jpkrohling jpkrohling left a 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.

@jpkrohling jpkrohling merged commit c8053c6 into open-telemetry:main Nov 17, 2021
shree007 pushed a commit to shree007/opentelemetry-operator that referenced this pull request Dec 12, 2021
* Add autoinstrumentation for Python

* Better log

* Fix merge
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
* Add autoinstrumentation for Python

* Better log

* Fix merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants