LangSmith
Export GoodMem server traces to LangSmith with explicit parent policy and typed metadata.
LangSmith
The langsmith export profile adds run types and selected metadata to GoodMem traces, with numeric, boolean, and array values intact.
You need a LangSmith API key and access to the GoodMem server configuration.
For collector fan-out, follow Export traces from GoodMem with the neutral profile.
Select the parent policy
LangSmith needs every ancestor span in the same project to display a continued trace, even when a collector sits between the services. It can accept an upload but omit the trace if an ancestor is absent.
| Caller export | GoodMem policy | Result |
|---|---|---|
| Caller ancestors reach the same LangSmith project | parent | One continued trace |
| Caller ancestors do not reach that project | Explicit link | Separate GoodMem trace with a caller link |
| Request contains no remote parent | Either policy | GoodMem starts a local trace |
The default remains parent for all export profiles.
For caller setup, see Connect the caller trace.
Configure the endpoint
This example selects link. Set the policy from the table above in the GoodMem server environment:
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=none
OTEL_SERVICE_NAME=goodmem-server
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.smith.langchain.com/otel/v1/traces
GOODMEM_OTEL_EXPORT_PROFILE=langsmith
GOODMEM_OTEL_REMOTE_PARENT=linkThe example uses the US endpoint. For EU projects, use https://eu.api.smith.langchain.com/otel/v1/traces.
For other regions or self-hosted deployments, use the endpoint from the LangSmith OTel configuration.
Prepare the header file
See the installation directory for the location of .env.
In the installation's private .env file, replace <key> with your LangSmith API key:
OTEL_EXPORTER_OTLP_TRACES_HEADERS=x-api-key=<key>For a project other than default, append ,Langsmith-Project=<name> to that value.
Encode spaces in the project name as %20 and literal plus signs as %2B.
For example:
OTEL_EXPORTER_OTLP_TRACES_HEADERS=x-api-key=<key>,Langsmith-Project=my%20projectKeep .env outside version control; the header value contains credentials.
Apply the configuration
Restart the installation:
goodmem system stop
goodmem system startFor a direct JVM launch, export the same variables before the server starts.
Verify the runs
- Send the verification request.
- Find the request in the intended LangSmith project.
- Match its
request_idmetadata with the responsegoodmem-request-idheader. - If you have a populated space, run one retrieval.
- Inspect the run types and child parentage.
| GoodMem operation | LangSmith run type |
|---|---|
| Retrieval | retriever |
| Embedding | embedding |
| Typed LLM generation | llm |
| Rerank, proxy, or generic operation | chain |
Proxy and rerank spans keep their operation types even when they contain a model name. For empty input and output panels, see the trace data controls.
Query metadata
LangSmith stores the profile's selected metadata in extra.metadata, with numeric, boolean, and array values intact.
Each operation supplies its own metadata.
For a scalar metadata filter, use:
has(metadata, '{"hnsw_ef_search":80,"postprocess_fallback":true}')For exact membership in the retained space IDs, use the generated space tag:
has(tags, "goodmem.space:11111111-2222-4333-8444-555555555555")Replace the sample UUID with the space ID. The generated mappings list the fields that the profile exports when the operation supplies a value.
Interpret errors and retries
Use failure_category and failure_origin for provider failure filters.
Diagnose missing runs
Check the project, endpoint, and headers first. If uploads succeed but no request appears, check the parent policy before the sampler. See Troubleshoot tracing for checks at each export stage.