Enable sensitive data for langchain programmatically#201
Merged
rads-1996 merged 5 commits intoJun 23, 2026
Conversation
Performance comparisonThreshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds programmatic support in use_microsoft_opentelemetry(...) for enabling LangChain/GenAI message content capture by wiring new kwargs (enable_experimental_mode, capture_message_content) to the upstream environment variables read by opentelemetry-util-genai and the in-repo LangChain helpers.
Changes:
- Add new public kwargs to
use_microsoft_opentelemetry(...)that setOTEL_SEMCONV_STABILITY_OPT_INand (when valid)OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT. - Introduce shared constants for the env var names and allowed capture modes.
- Add unit/integration tests and update the LangChain sample README to document the kwarg-based configuration.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/microsoft/opentelemetry/_distro.py |
Implements kwarg → env-var wiring and warning behavior for invalid/ignored values. |
src/microsoft/opentelemetry/_constants.py |
Adds kwarg names, env var keys, and allowed capture-mode values. |
tests/test_distro.py |
Adds tests validating env-var propagation semantics and non-overwrite behavior. |
tests/test_langchain_integration.py |
Adds integration coverage verifying the wiring matches what LangChain content-capture utilities read. |
samples/langchain/README.md |
Documents using kwargs instead of exporting env vars, plus accepted values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d4cc005 to
3b09907
Compare
hectorhdzg
reviewed
Jun 17, 2026
hectorhdzg
reviewed
Jun 17, 2026
hectorhdzg
reviewed
Jun 17, 2026
1b2cfb1 to
a027029
Compare
JacksonWeber
previously approved these changes
Jun 22, 2026
hectorhdzg
reviewed
Jun 23, 2026
86f31d4 to
d6912ac
Compare
hectorhdzg
reviewed
Jun 23, 2026
d6912ac to
187b097
Compare
hectorhdzg
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.