Skip to content

feat(js): Add OTEL support#1814

Merged
Jacob Lee (jacoblee93) merged 37 commits intomainfrom
jacob/otel
Jun 30, 2025
Merged

feat(js): Add OTEL support#1814
Jacob Lee (jacoblee93) merged 37 commits intomainfrom
jacob/otel

Conversation

@jacoblee93
Copy link
Copy Markdown
Collaborator

@jacoblee93 Jacob Lee (jacoblee93) commented Jun 25, 2025

js/src/client.ts Outdated
...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise),
this.batchIngestCaller.queue.onIdle(),
]);
await getDefaultOTLPTracerComponents()?.spanProcessor?.forceFlush();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this could block, do we need to flush always?

Copy link
Copy Markdown
Collaborator Author

@jacoblee93 Jacob Lee (jacoblee93) Jun 26, 2025

Choose a reason for hiding this comment

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

How would it block improperly? We want to wait for this to flush don't we?

@dgieselaar
Copy link
Copy Markdown

Jacob Lee (@jacoblee93) not sure if it's useful, but we've recently started using OpenTelemetry tracing for inference. You obviously have very different constraints but maybe there's something that'll help: elastic/kibana#218694.

@jacoblee93
Copy link
Copy Markdown
Collaborator Author

Dario Gieselaar (@dgieselaar) neat, thanks! Will take a look.

LangSmith also has an endpoint that ingests OTEL already if interesting to you folks: https://docs.smith.langchain.com/observability/how_to_guides/trace_with_opentelemetry

Just FYI rate limits are a bit lower at the moment

@jacoblee93 Jacob Lee (jacoblee93) merged commit 1064b47 into main Jun 30, 2025
12 of 13 checks passed
@jacoblee93 Jacob Lee (jacoblee93) deleted the jacob/otel branch June 30, 2025 18:52
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.

4 participants