Skip to content

Conversation

@yiyuan-he
Copy link
Contributor

Which problem is this PR solving?

This PR adds the initial project skeleton to kickstart a new instrumentation-langchain package.

Original PR raised by our intern: #3024

Short description of the changes

Mostly package metadata and licensing information. @mxiamxia and I (@yiyuan-he) also volunteer to be component owners for this new package.

@yiyuan-he yiyuan-he requested a review from a team as a code owner October 1, 2025 18:30
@yiyuan-he yiyuan-he force-pushed the skeleton-instrumentation-langchain branch from 952c0ef to 7a2c838 Compare October 1, 2025 18:47
@trentm trentm changed the title feat: add initial package skeleton for instrumentation-langchain feat(instrumentation-langchain): add initial package skeleton for instrumentation-langchain Oct 15, 2025

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `captureMessageContent` | `boolean` | `false` | Capture prompt and completion content. Can also be set via `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this env variable available in the specification? is it used in different places right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This env var is used in instrumentation-openai. I'll remove it from this PR to keep the skeleton minimal and focused on structure. Will add the env var back along with supporting implementation (for message content capture) in a follow-up PR.


## Semantic Conventions

This package uses OpenTelemetry Semantic Conventions for GenAI operations.
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 add specific semantic convention version planned for this, latest I assume?

https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/README.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added v1.38.0, thanks!

},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/contrib-test-utils": "^0.52.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@opentelemetry/contrib-test-utils": "^0.55.0",
"@opentelemetry/sdk-logs": "^0.208.0",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks


export class LangChainInstrumentation extends InstrumentationBase<LangChainInstrumentationConfig> {
constructor(config: LangChainInstrumentationConfig = {}) {
super(PACKAGE_NAME, PACKAGE_VERSION, config);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add code to handle env variable you mentioned in readme?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to remove the env var for now to facilitate a cleaner review. Related

"packages/instrumentation-knex": {},
"packages/instrumentation-koa": {},
"packages/instrumentation-langchain": {
"skip-github-release": true
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 ensure this would not be tried to be released as is currently a not fully functional instrumentation, I do not know if this will be sufficient

Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants