LangSmith blueprint · Developer tooling
Tracing any app with OpenTelemetry
Instruments a non-LangChain, multi-service LLM app with @traceable, wrap_openai and the OpenTelemetry SDK. Spans go over OTLP to a collector that fans them out to LangSmith and an infrastructure backend, so one request yields one connected trace in both. It must never break trace context between services, and it must never ship secrets or raw PII to either backend.
- Steps
- 7
- Subjective questions
- 33
- Objective questions
- 33
The problem and the outcome
Problem: Teams running plain Python or Node services, with no LangChain involved, cannot see why an LLM answer was slow or wrong. Their LLM calls, retrieval and HTTP hops are scattered across separate logs and tools.
Outcome: Every request becomes a single distributed trace, from the API edge through workers, retrieval and model calls. LangSmith shows the LLM view with inputs, outputs, tokens and feedback. The infra backend shows the same trace IDs for latency and errors.
Architecture
How it works, step by step
- A user sends a chat message. The Chat API receives it inside an OpenTelemetry server span, which is created by framework auto-instrumentation such as FastAPI or Express.
- The API's handler and helper functions are wrapped with @traceable, with LANGSMITH_TRACING and OTel mode enabled in the LangSmith SDK. They become child spans carrying LangSmith run attributes like run type, inputs and outputs, and they nest under the active OTel context.
- On outbound calls, the OTel propagator injects the W3C traceparent header. The worker and the retriever extract it, so their spans join the same trace instead of starting new ones.
- The worker calls the model through wrap_openai, which records prompt, completion, model name and token usage as an LLM span. The retriever's vector DB query is captured as its own span.
- Each service batches spans and exports them over OTLP to a local OpenTelemetry Collector, never directly to the vendors. Collector processors drop or hash sensitive attributes, batch spans, and split them into two pipelines.
- One otlphttp exporter sends LLM-relevant spans to the LangSmith OTLP endpoint, with the API key and target project set as headers. A second exporter sends the full trace to Tempo or Jaeger with the same trace IDs.
- In LangSmith, the trace appears in the chosen project, and multi-turn conversations are grouped as threads via a shared thread or session metadata key. Online evaluators with filters and sampling rates score runs, and automation rules or alerts fire on regressions.
Tech stack
- LangSmith SDK (@traceable, wrap_openai, OTel mode)
- OpenTelemetry SDK + auto-instrumentation (Python/Node)
- W3C Trace Context propagation (traceparent, baggage)
- OpenTelemetry Collector (otlp receiver, batch, attributes/filter processors)
- LangSmith OTLP endpoint + projects + threads
- Grafana Tempo or Jaeger for infra traces
- LangSmith online evaluators, dashboards and alerts
Key design decisions
- Export from services only to a collector, not straight to LangSmith. The collector owns credentials, redaction, retries and fan-out, so adding or swapping a backend needs no app redeploy.
- Use standard W3C traceparent propagation across all hops, so LangSmith and Tempo see identical trace IDs. Avoid mixing it with LangSmith-specific header propagation on the same path.
- Route only LLM-relevant spans, such as @traceable, model and retrieval spans, to LangSmith, and send everything to the infra backend. This keeps LangSmith projects readable and controls ingestion volume.
- Put redaction in collector processors as a central policy, and also mask at the source for fields that must never leave the process, such as raw user identifiers.
- Use head sampling sparingly in services so LLM traces stay complete. Apply sampling decisions in online evaluators rather than dropping production traces before they are stored.
Common mistakes
- A missing propagator on one hop, often a message queue or a custom HTTP client, creates orphan traces. The worker's LLM spans then show up as separate roots in LangSmith.
- Running both a LangSmith-native exporter and OTel export without a clear setup produces duplicate or split traces. Pick one export path per service.
- The collector's batch or queue limits are too small under load, so spans are silently dropped and traces look truncated. Watch the exporter's failed-send metrics.
- Prompt and completion attributes can contain PII or secrets. Without attribute processors, they reach both backends and stay for the full retention period.
- Forgetting to set the project header on the LangSmith exporter sends all services' traces to a default project, which mixes environments.
What to measure
- Share of requests whose spans form a single connected trace (orphan-root rate)
- Collector exporter failed or dropped spans per minute, per backend
- Trace ingestion lag from request end to visible in LangSmith (p95)
- LLM span latency and token usage per model, per service
- Online evaluator scores and alert counts on sampled production runs
Most-asked interview questions
Subjective questions 33
1How would you get one end-to-end trace across three services when only one of them calls the LLM?Asked almost every time
I'd instrument every service with the OpenTelemetry SDK and framework auto-instrumentation, so HTTP and gRPC servers and clients create spans and propagate W3C traceparent automatically. In the LLM worker, I'd wrap business functions with @traceable in OTel mode and the client with wrap_openai. That way the LLM runs nest under whatever OTel span is active. All services export OTLP to a collector, which forwards to LangSmith and Tempo. Because the trace ID comes from the edge span and travels in headers, the worker's model call lands under the API's root span. I'd check the hops that auto-instrumentation misses, such as queues and custom clients, and inject and extract context manually there. Then I'd track the orphan-root rate to prove it holds.
Sourced from Docs by LangChain (MCP)
2Walk me through what happens, span by span, when a user sends one chat message in this design.Asked almost every time
Framework auto-instrumentation in the Chat API, for example FastAPI or Express, opens an OpenTelemetry server span. Handler and helper functions decorated with @traceable become child spans carrying LangSmith run attributes such as run type, inputs and outputs. When the API calls the worker and the retriever, the propagator injects a W3C traceparent header. Those services extract it, so their spans join the same trace. Inside the worker, wrap_openai records an LLM span, and the retriever records its vector DB query as its own span. Every service batches spans and sends them over OTLP to a local Collector. The Collector redacts sensitive attributes, batches spans, and fans them out: LLM-relevant spans go to LangSmith and the full trace goes to Tempo or Jaeger, both with the same trace ID.
Sourced from Docs by LangChain (MCP)
3How does a @traceable function end up nested under the server span that FastAPI auto-instrumentation created?Asked almost every time
With LangSmith tracing and OTel mode enabled, the SDK does not keep a separate context tree. It reads the active OpenTelemetry context when the decorated function starts, then creates its span as a child of whatever span is current, which here is the FastAPI server span. It also sets itself as the current span while the function runs, so nested @traceable helpers and wrapped OpenAI calls become its children. If OTel mode is off, LangSmith builds its own run tree and the server span and runs will not share a parent. That is the most common reason people see two disconnected views of one request.
Sourced from Docs by LangChain (MCP)
4In LangSmith, the worker's LLM spans appear as separate traces instead of under the Chat API request. How do you debug that?Asked almost every time
First, confirm that the API actually sends traceparent. Capture the outbound request and check the header. If it is missing, the HTTP client is not instrumented or the call runs outside the active context, for example in a thread pool or a fire-and-forget task that lost context. Second, confirm that the worker extracts the header before it opens its first span. Middleware order matters. Third, check that the propagators match on both sides; a W3C-only setup and a B3-only setup will not interoperate. Fourth, check the Collector filter. If the parent span was dropped from the LangSmith pipeline, the child may look like a root. Comparing trace IDs in Tempo usually shows quickly which of these it is.
Sourced from Docs by LangChain (MCP)
5Why put an OpenTelemetry Collector in the middle instead of exporting directly to LangSmith?Very often asked
The collector separates the app from its backends. Services know one OTLP endpoint, and the collector holds the LangSmith API key and the project header, so credentials don't spread across every deployment. It gives me one place for policy: attribute processors for redaction, batching and retry for resilience, and separate pipelines so LLM spans go to LangSmith while everything goes to Tempo. Adding a backend, or moving between regions, becomes a config change rather than a code release. The costs are another component to run and monitor and a possible point of span loss. So I watch its queue and failed-send metrics and run it as a sidecar or agent close to the services.
Sourced from Docs by LangChain (MCP)
6How do you keep sensitive data out of traces while keeping them useful for debugging and evaluation?Very often asked
I treat it in layers. At the source, I avoid putting secrets in span attributes at all. I mask fields like raw user IDs or tokens before @traceable records inputs and outputs, because data that never leaves the process can't leak. In the collector, attribute processors delete or hash known keys centrally, so policy changes don't need app releases. I keep LangSmith traces useful by retaining prompts, model names, token counts and outputs that evaluators need, and by replacing identifiers with stable hashes so threads still group correctly. I'd also remember that online evaluation upgrades traces to extended retention, so whatever is stored may live longer. That's another reason to redact before ingestion, not after.
Sourced from Docs by LangChain (MCP)
7What does wrap_openai give you that a hand-written span around the OpenAI call would not?Very often asked
wrap_openai patches the client, so every call automatically becomes an LLM-type run. It records the prompt messages, the completion, the model name and token usage in the attribute shape LangSmith expects. LangSmith can then render the call as a proper LLM run, show token counts, and let evaluators and dashboards filter on it. A hand-written span gives you timing, but you would have to map the message and usage fields yourself, keep them consistent across services, and update them when the API changes. The trade-off is that wrap_openai records full prompts by default. That makes the PII controls, at the source or in the Collector, essential rather than optional.
Sourced from Docs by LangChain (MCP)
8The worker is triggered through a message queue instead of HTTP. How do you keep trace context intact?Very often asked
HTTP auto-instrumentation will not help here, so the producer must inject context into the message itself. The OTel propagator writes traceparent, and tracestate if you use it, into message headers or attributes. The consumer extracts that context before it starts its processing span. Use a consumer span linked to, or parented by, the extracted context, depending on whether one message maps to one request. Many queue client instrumentations already do this. If yours does not, write a small wrapper so every team does it the same way. Then test that a message produced in a traced request yields worker spans with the same trace ID, including on retries and redeliveries.
Sourced from Docs by LangChain (MCP)
9How do you make a multi-turn conversation show up as one thread in LangSmith when each turn is a separate trace?Very often asked
Each user turn is its own trace, which is correct because it is its own request. To group turns, attach a shared conversation identifier as metadata on the root run of every turn, using the thread or session metadata key that LangSmith recognises. The Chat API is the natural place to set it, because it already knows the conversation ID. Do not use raw user identifiers or anything personally identifying as the thread key. Use an opaque ID. Once the turns are grouped, online evaluators can run at thread level, for example to judge whether the whole conversation resolved the user's issue.
Sourced from Docs by LangChain (MCP)
10How would you decide which spans count as LLM-relevant and go to LangSmith, versus the full trace going to Tempo?Very often asked
Route on attributes, not on service names. Spans created by @traceable and wrap_openai carry LangSmith run attributes, so the LangSmith pipeline can keep spans that have them, plus the root request span, so the tree stays anchored. Database driver spans, HTTP client internals and runtime spans go only to the infrastructure backend. Be careful about parents: if you drop an intermediate span that LLM spans hang under, LangSmith may show orphaned or re-rooted runs. So either keep the ancestors of kept spans or decorate the intermediate functions with @traceable. Tempo receives everything after redaction, so infra engineers still see the full picture with the same trace ID.
Sourced from Docs by LangChain (MCP)
11How do LangSmith's data model concepts map onto OpenTelemetry concepts in this design?Very often asked
An OpenTelemetry trace with one trace ID corresponds to a LangSmith trace. Each span becomes a run, and the span's parent ID gives the run tree. LangSmith-specific attributes on the span supply the run type, such as chain, llm, tool or retriever, along with the inputs, outputs and metadata. Traces are stored in a project, which you choose with the project header on the exporter. Threads sit above traces and group several traces that share a thread or session metadata key. The infrastructure backend uses the same trace and span IDs but simply ignores the LangSmith attributes it does not understand.
Sourced from Docs by LangChain (MCP)
12How do you sample without ending up with partial traces or traces that exist in Tempo but not in LangSmith?Very often asked
Sampling decisions must be made per trace, not per span. With head sampling, the root service decides and the decision travels in the traceparent sampled flag. Downstream services honour it through a parent-based sampler, so every service keeps or drops the same traces. If you want to keep all errors or slow requests, use tail sampling in the Collector. That requires all spans of a trace to reach the same Collector instance, often through a load-balancing tier keyed by trace ID. Apply the sampling before the fan-out so both pipelines see the same set. LangSmith online evaluators then add their own sampling rate on top, which is a separate choice.
Sourced from Docs by LangChain (MCP)
13What happens if the local Collector is down, and how do you make sure tracing never takes the app down with it?Very often asked
The SDK's batch span processor exports in the background with a bounded queue. If the Collector is unreachable, exports fail and the queue fills. Once it is full, new spans are dropped rather than blocking request threads. That is the behaviour you want: lose telemetry, not requests. Keep export timeouts short and never use a synchronous span processor in production. On the Collector side, a memory limiter protects it from overload, and sending queues with retry absorb short vendor outages. Monitor the SDK's dropped-span counts and the Collector's own metrics, and alert on export failures, so silent data loss is noticed.
Sourced from Docs by LangChain (MCP)
14Where should the LangSmith API key live in this architecture, and why?Very often asked
Only in the Collector, and injected from a secret store such as a Kubernetes secret or a vault through an environment variable that the exporter header config references. It should not be in the application services, because they export to the local Collector and never talk to LangSmith directly. That shrinks the number of places a key can leak and makes rotation a Collector redeploy instead of a fleet-wide change. Never put the key in span attributes or resource attributes, and do not log the Collector config with expanded values. Use separate keys per environment, so a staging leak cannot write into production projects.
Sourced from Docs by LangChain (MCP)
15wrap_openai records full prompts, and users paste personal data into chat. Do you redact at the source or in the Collector?Very often asked
Both, for different reasons. At the source you know the semantics. You can mask emails, phone numbers or ID numbers in inputs before they are attached to the run, or turn off input and output capture for especially sensitive functions. The Collector is the central backstop. Attribute and redaction processors drop or hash known sensitive keys and patterns for every service, including ones a team forgot to configure. Relying only on the Collector means raw PII still crosses the network to it, and pattern rules miss free text. Relying only on the source means one careless service leaks. Defence in depth, plus tests that send known fake PII through and assert it never reaches either backend.
Sourced from Docs by LangChain (MCP)
16How would you estimate the load on the Collector and on each backend before rollout?Often asked
I would avoid guessing and measure the inputs. Take peak requests per second and multiply by the average number of spans per request. Get that span count by tracing a sample of real requests in staging, because agent loops and retries inflate it. Then multiply by the average serialized span size, which is dominated by prompt and completion attributes on LLM spans. That gives bytes per second into the Collector. The LangSmith pipeline carries only the filtered subset and Tempo carries everything, so compute each separately. Add headroom for retries during backend outages, size the Collector's memory and queue from that figure, and validate with a load test using the batch settings you plan to run.
Sourced from Docs by LangChain (MCP)
17LangSmith starts rejecting or slowing down exports, but Tempo is fine. How should the Collector behave?Often asked
Each exporter should have its own sending queue and retry policy, so a slow or failing LangSmith exporter backs up only its own pipeline. Tempo keeps receiving the full trace. Set bounded queues so the Collector sheds LangSmith data instead of growing memory without limit, and alert on queue size and failed sends. Check whether the failures are authentication errors, which should not be retried forever, or transient errors, which should be retried with backoff. A persistent queue on disk can carry you through longer outages if losing LLM traces is costly. The important property is that one vendor's outage never degrades the other pipeline or the application.
Sourced from Docs by LangChain (MCP)
18When would you hash a sensitive attribute rather than drop it entirely?Often asked
Hash when you still need to correlate but never need the raw value. Examples are a user ID or email, where you want to see that the same user hit the same failure several times or filter a thread by user. A keyed hash, such as an HMAC with a secret held only in the Collector, prevents dictionary attacks on low-entropy values like phone numbers, which a plain unsalted hash would not. Drop when the value has no debugging use or when even a pseudonym is too risky, such as passwords, tokens, card numbers or authorisation headers. Remember that hashed identifiers can still be personal data under privacy law, so retention and access rules still apply.
Sourced from Docs by LangChain (MCP)
19How would you set up online evaluation on this production traffic without scoring every run?Often asked
In LangSmith, attach online evaluators to the project with a filter and a sampling rate. The filter narrows which runs are scored, for example only root runs of the chat endpoint, or only runs with negative user feedback, or a particular model. The sampling rate controls cost when the evaluator is an LLM-as-judge. Use cheap code rules at a higher rate, such as checking for valid JSON or an empty answer, and the expensive judge at a lower rate. Thread-level evaluators can score whole conversations. Results feed dashboards, and alerts or automation rules can act on them. Remember that runs scored online get upgraded to extended retention.
Sourced from Docs by LangChain (MCP)
20How would you get notified when answer quality regresses after a deployment?Often asked
Online evaluator scores become feedback on runs, and LangSmith dashboards chart them over time. I would set an alert on a drop in the key evaluator's average score, or a rise in error rate or latency, on the production project. Automation rules can act on matching runs, for example sending low-scoring runs to an annotation queue for human review, adding them to a dataset, or calling a webhook that posts to the on-call channel. Tagging runs with the deployed version or prompt tag in metadata lets you filter the dashboard and tie the regression to a specific release. The same trace ID lets on-call jump into Tempo for infrastructure context.
Sourced from Docs by LangChain (MCP)
21Why use OpenTelemetry here instead of just LangSmith's native tracing in each service?Often asked
Native LangSmith tracing works well for LLM-only views, but this app is multi-service and the platform team already runs Tempo or Jaeger. With OTel, one set of instrumentation and one trace ID serve both audiences. LLM engineers see runs in LangSmith, and SREs see the same request with database and network spans in Tempo. Context propagation uses the W3C standard, which already works across languages and frameworks. Redaction and routing live centrally in the Collector instead of in every service. The cost is more moving parts: you run and monitor a Collector, and you must make sure LangSmith attributes survive the pipeline.
Sourced from Docs by LangChain (MCP)
22The Chat API is Python and the worker is Node.js. What changes?Often asked
Very little at the protocol level. That is the point of W3C Trace Context and OTLP. The Python side uses the LangSmith Python SDK with @traceable and wrap_openai. The Node side uses the LangSmith JS/TS SDK with its traceable and OpenAI wrapper equivalents, plus the Node OpenTelemetry SDK with OTel mode enabled. Both use the W3C propagator, so traceparent written by Python is read by Node. Both export OTLP to the same local Collector. Watch for drift in attribute conventions, such as metadata key names for thread IDs or tenant IDs. Put them in a shared convention document or library so the Collector filters and LangSmith views behave consistently.
Sourced from Docs by LangChain (MCP)
23How do you trace a streaming chat response correctly?Often asked
The LLM span must stay open until the stream finishes, not end when the first chunk arrives. Otherwise latency is wrong and the completion and token usage are missing. The OpenAI wrapper handles streaming by aggregating chunks and finishing the run at the end of the stream, but your own @traceable function that returns a generator or async iterator must also be traced in a way that covers the full iteration. Make sure token usage is actually returned for streamed calls, since some APIs need an option to include it. Also record time to first token as metadata, because users perceive that latency, not total duration.
Sourced from Docs by LangChain (MCP)
24How would you test in CI that context propagation and redaction actually work?Often asked
Run the services against an in-memory or local OTLP receiver, such as a Collector with a file or debug exporter, using the same processor config as production. Send a request containing known fake PII and a fake secret. Then assert on the exported spans: every span shares one trace ID, parent-child links form the expected tree across API, worker and retriever, LLM spans have model and token attributes, and none of the planted sensitive strings appear anywhere in attributes or events. Run this test whenever the Collector config or instrumentation libraries change, because upgrades often silently change header handling or attribute names.
Sourced from Docs by LangChain (MCP)
25How would you organise LangSmith projects across environments and services?Often asked
Use one project per environment per application, such as chat-prod and chat-staging, not one per service. The point of this design is that a request is one trace across services, and splitting services into separate projects would split the view. The project is set by the header on the Collector's LangSmith exporter, so each environment's Collector points at its own project with its own key. Distinguish services inside a project with metadata or the service name resource attribute. Keep experiments from offline evaluation separate from production projects so dashboards and online evaluators only see real traffic.
Sourced from Docs by LangChain (MCP)
26How do production traces collected this way feed back into offline evaluation?Often asked
Interesting production runs, such as low online scores, negative user feedback or flagged failures, can be routed by automation rules or annotation queues into a dataset. Reviewers in a single-run annotation queue can correct the output against a rubric and export it as a reference example. That dataset becomes the regression suite. Before changing a prompt or model, run evaluate() against it with evaluators such as code checks or an LLM-as-judge, and compare the experiment with the baseline. Because redaction happens before traces reach LangSmith, the dataset inherits the redacted inputs, which is what you want for privacy.
Sourced from Docs by LangChain (MCP)
27How do you keep the cost of tracing under control as traffic grows?Often asked
Control volume at three layers. In the SDKs, sample by trace with a parent-based sampler, and avoid decorating tiny hot-path helpers with @traceable. In the Collector, filter non-LLM spans out of the LangSmith pipeline, truncate very large attributes such as long documents, and consider tail sampling that keeps all errors but only a fraction of successes. In LangSmith, scope online evaluators with filters and sampling rates, because LLM-as-judge calls cost money and scored traces move to extended retention. Measure spans per request and bytes per span regularly, because new agent steps quietly multiply both.
Sourced from Docs by LangChain (MCP)
28How would you roll this out to an existing production system with minimal risk?Often asked
Start with the Collector deployed and receiving, with only the infrastructure exporter enabled. Turn on framework auto-instrumentation and propagation service by service, and confirm in Tempo that traces connect. Next, enable the redaction processors and verify them with planted test data. Then add @traceable and wrap_openai in the worker, enable OTel mode in the LangSmith SDK, and turn on the LangSmith pipeline pointing at a staging project. Once traces look correct and redaction is proven, point the production Collector at the production project. Add online evaluators and alerts last, with low sampling rates at first. Every step can be rolled back with config alone.
Sourced from Docs by LangChain (MCP)
29Running an online evaluator changes retention for the traces it scores. Why does that matter for your privacy design?Sometimes asked
Traces that an online evaluator runs on are upgraded to extended retention, so they live longer than ordinary traces. For privacy, that means any data that slipped past redaction sticks around longer, which raises the stakes of getting the Collector rules right. It also affects cost and data-retention commitments you may have made to users. So scope online evaluators with filters and sampling instead of running them on everything. Make sure the retention policy you document matches what is actually stored, and have a deletion process for traces tied to a user who exercises data rights.
Sourced from Docs by LangChain (MCP)
30What should the retriever's span record to be useful without leaking data?Sometimes asked
Use run type retriever so LangSmith renders it correctly. Record the query after redaction, the index or collection name, the number of results requested and returned, and the IDs and scores of the returned documents. Document content is useful for evaluating relevance and groundedness, but it may contain customer data, so include it only if your data classification allows it, or truncate or hash it. Never record database credentials or connection strings. Duration and errors come for free from the span. With document IDs and scores, you can later build retrieval evaluators and spot whether a bad answer came from bad retrieval or bad generation.
Sourced from Docs by LangChain (MCP)
31Spans from different services sometimes appear to start before their parent. Why, and does it matter?Sometimes asked
Each service timestamps spans with its own clock, so clock skew between hosts can make a child appear to start before its parent, or extend past it. Parent-child structure comes from IDs, not timestamps, so the tree is still correct. Only the timeline rendering looks odd. Fix the root cause with proper NTP time sync on all hosts. Do not try to correct timestamps in the Collector, because that hides real latency problems. When analysing latency, trust durations within a single service more than cross-service gaps.
Sourced from Docs by LangChain (MCP)
32The app is multi-tenant. How do you trace it safely?Sometimes asked
Attach an opaque tenant ID as metadata on the root run and as a span attribute, so you can filter traces, dashboards and evaluator results per tenant. Never use tenant names or customer contact details for this. Redaction rules must hold for every tenant, and some tenants may contractually forbid prompt capture. Handle that with a per-tenant flag that disables input and output recording at the source, not only in the Collector. Access to LangSmith projects and to Tempo should follow least privilege, because traces contain customer conversations even after masking.
Sourced from Docs by LangChain (MCP)
33How do you tie a trace back to the exact prompt version that produced it?Sometimes asked
If prompts are managed in the LangSmith Prompt Hub, pull them by commit or tag at runtime and record the prompt name and commit identifier as metadata on the LLM run or its parent. Then you can filter traces and online evaluator scores by prompt version, and compare how a newly tagged commit performs against the previous one in production. The same metadata goes to Tempo, so infrastructure incidents can be correlated with prompt changes. Avoid logging the full prompt template as an attribute on every span. The commit reference is enough, and it keeps spans smaller.
Sourced from Docs by LangChain (MCP)
Objective questions 33
1In this design, what creates the root server span when the Chat API receives a request?Asked almost every time
Why: The workflow has framework auto-instrumentation open the OTel server span. @traceable functions then nest under it.
Sourced from Docs by LangChain (MCP)
2Where do application services send their spans in this design?Asked almost every time
Why: Services export over OTLP only to the local Collector, never directly to the vendors.
Sourced from Docs by LangChain (MCP)
3Which header carries trace context between services under the W3C Trace Context standard?Very often asked
Why: W3C Trace Context defines traceparent, which holds the trace ID, parent span ID and flags. tracestate carries optional vendor data.
Sourced from Docs by LangChain (MCP)
4You want the same spans in LangSmith and in Tempo without changing application code twice. What is the standard approach?Very often asked
Why: An OpenTelemetry Collector receives OTLP once and fans out through multiple exporters. Backends are added or changed in collector config, not in app code.
Sourced from Docs by LangChain (MCP)
5What must be enabled in the LangSmith SDK so that @traceable spans nest under the active OpenTelemetry context?Very often asked
Why: With LANGSMITH_TRACING and OTel mode both on, the SDK emits OTel spans that use the current OTel context as their parent.
Sourced from Docs by LangChain (MCP)
6Which of the following does wrap_openai record on the LLM span?Very often asked
Why: The workflow states that wrap_openai records prompt, completion, model name and token usage.
Sourced from Docs by LangChain (MCP)
7The worker starts a new trace instead of joining the API's trace. What is the most likely cause?Very often asked
Why: Cross-service joining depends entirely on injecting and extracting the W3C traceparent header.
Sourced from Docs by LangChain (MCP)
8How does the Collector send the same spans to both LangSmith and Tempo?Very often asked
Why: The workflow splits spans into two pipelines: an otlphttp exporter to LangSmith and a second exporter to Tempo or Jaeger.
Sourced from Docs by LangChain (MCP)
9How are separate turns of one conversation grouped in LangSmith?Very often asked
Why: Threads group multi-turn conversations using a shared thread or session metadata key.
Sourced from Docs by LangChain (MCP)
10Which component should hold the LangSmith API key?Very often asked
Why: Only the Collector talks to LangSmith, so keeping the key there limits exposure and makes rotation simpler.
Sourced from Docs by LangChain (MCP)
11The SDK export queue is full because the Collector is unreachable. What should happen with a batch span processor?Very often asked
Why: Batch processors use bounded queues and drop spans when full, so telemetry problems do not take down the app.
Sourced from Docs by LangChain (MCP)
12With head sampling across services, what keeps the keep-or-drop decision consistent across the whole trace?Very often asked
Why: Parent-based samplers follow the upstream decision carried in traceparent, so every service keeps or drops the same traces.
Sourced from Docs by LangChain (MCP)
13Why redact at the source in addition to the Collector?Very often asked
Why: Source redaction prevents raw PII from crossing the network and uses domain knowledge. The Collector acts as a central backstop.
Sourced from Docs by LangChain (MCP)
14Which feature lets you score a fraction of production runs automatically in LangSmith?Very often asked
Why: Online evaluators run on production runs or threads, with filters and sampling rates.
Sourced from Docs by LangChain (MCP)
15When exporting OTLP from a collector to LangSmith, where does authentication normally go?Often asked
Why: The LangSmith OTLP endpoint authenticates with an API key sent as an exporter header, and the target project can also be set as a header. Keeping both in the collector config keeps them out of services.
Sourced from Docs by LangChain (MCP)
16Which Collector component is the natural place to hash or drop sensitive span attributes?Often asked
Why: Processors modify telemetry in the pipeline. Attribute, transform and redaction processors change or remove span attributes.
Sourced from Docs by LangChain (MCP)
17What is the main reason the trace IDs match in LangSmith and Tempo?Often asked
Why: The IDs come from the instrumented services and are only forwarded by the Collector, so both backends see identical IDs.
Sourced from Docs by LangChain (MCP)
18What determines which LangSmith project the traces land in, in this design?Often asked
Why: The LangSmith exporter sets the API key and the target project as headers.
Sourced from Docs by LangChain (MCP)
19Why is a synchronous (simple) span processor a poor choice in production?Often asked
Why: A simple processor exports each span as it ends, on the calling thread. That puts export latency and failures on the request path.
Sourced from Docs by LangChain (MCP)
20LangSmith is slow but Tempo is healthy. Which Collector setting best stops this from affecting the Tempo pipeline?Often asked
Why: Separate exporter queues isolate backpressure, so one slow destination does not stall the other.
Sourced from Docs by LangChain (MCP)
21What is a requirement for tail sampling in the Collector to work correctly?Often asked
Why: Tail sampling decides per trace after seeing its spans, so all of a trace's spans must be routed to one instance, for example by trace ID.
Sourced from Docs by LangChain (MCP)
22Routing only LLM-relevant spans to LangSmith, you drop an intermediate span that LLM runs are children of. What is the likely effect?Often asked
Why: Removing a parent span breaks the visible tree in that backend, so its children lose their place in the hierarchy.
Sourced from Docs by LangChain (MCP)
23Which approach best protects low-entropy identifiers such as phone numbers when you need correlation but not the raw value?Often asked
Why: A keyed hash cannot be reversed by dictionary lookup without the secret. Base64 is reversible, and unsalted hashes of small value spaces are easy to brute-force.
Sourced from Docs by LangChain (MCP)
24What run type should the retriever's vector DB span carry so LangSmith renders it properly?Often asked
Why: LangSmith run types include retriever for retrieval steps, which lets the UI and evaluators treat the span as retrieval.
Sourced from Docs by LangChain (MCP)
25Low-scoring production runs should be sent to humans for correction. Which LangSmith feature fits?Often asked
Why: Automation rules can route runs to annotation queues. Single-run queues support rubrics and export to datasets, while pairwise queues compare exactly two experiments.
Sourced from Docs by LangChain (MCP)
26The Chat API is Python and the worker is Node.js. What makes their spans join one trace?Often asked
Why: W3C Trace Context is language-neutral, so a traceparent written by Python is understood by Node.
Sourced from Docs by LangChain (MCP)
27For a streamed completion, when should the LLM span end?Often asked
Why: Ending at stream completion captures the full completion, accurate duration and token usage.
Sourced from Docs by LangChain (MCP)
28Which project layout best preserves one connected trace per request?Often asked
Why: Splitting services into separate projects would split a single request's trace. Environment-level projects keep it whole.
Sourced from Docs by LangChain (MCP)
29Which test best proves that redaction works end to end?Often asked
Why: Only an end-to-end assertion on exported data proves that sensitive values never reach the backends.
Sourced from Docs by LangChain (MCP)
30What happens to a trace's retention when an online evaluator runs on it?Sometimes asked
Why: The reference notes state that running an online evaluator upgrades a trace to extended retention.
Sourced from Docs by LangChain (MCP)
31A child span from another host appears to start before its parent. What is the most likely cause?Sometimes asked
Why: Each host timestamps its own spans. Parentage comes from IDs, so skew affects only the timeline display.
Sourced from Docs by LangChain (MCP)
32What is the most useful way to link a production trace to the prompt version that produced it?Sometimes asked
Why: Prompts in the Prompt Hub are versioned by commits and tags, so a reference in metadata is precise and small.
Sourced from Docs by LangChain (MCP)
33What is the safest identifier to use as a thread key for grouping conversations?Sometimes asked
Why: An opaque ID groups turns without putting personal data into trace metadata.
Sourced from Docs by LangChain (MCP)
Track your progress through every blueprint in your dashboard.
Start learning