Export traces from GoodMem
Connect a GoodMem server to an OTLP collector or a trace backend.
Export traces from GoodMem
Connect an existing GoodMem server to your collector. An authenticated request then checks the export path. You need access to the server configuration, an OTLP receiver, and an API key with permission to list spaces.
Select the destination
| Destination | Profile | Protocol |
|---|---|---|
| Your collector, with one or more destinations | neutral | Match the collector receiver |
| Direct Jaeger or Tempo | neutral | Match the backend OTLP receiver |
| Direct Langfuse | langfuse | http/protobuf |
| Direct LangSmith | langsmith | http/protobuf |
Keep GOODMEM_OTEL_REMOTE_PARENT=parent unless the LangSmith guide says otherwise.
For collector fan-out, select neutral on GoodMem. Apply destination-specific transforms in separate collector pipelines.
A vendor profile adds its metadata before every destination, while the parent policy applies once at GoodMem ingress.
For direct SaaS export, follow the Langfuse or LangSmith guide. The steps below use your collector.
Configure the collector receiver
For an isolated verification environment, use this collector configuration:
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]This receiver is for verification only; production requires TLS, authentication, and a destination exporter.
Configure GoodMem
Set these variables in the server environment:
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=none
OTEL_SERVICE_NAME=goodmem-server
OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=development
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel-collector:4318/v1/traces
OTEL_TRACES_SAMPLER=always_on
GOODMEM_OTEL_EXPORT_PROFILE=neutral
GOODMEM_OTEL_REMOTE_PARENT=parentReplace otel-collector with an address that the server can reach.
Inside a container, localhost identifies that container.
For a collector on the same Compose network, use its service name.
For a collector on the host, use the host gateway address for your container runtime.
The example already includes the /v1/traces suffix that the trace-specific endpoint requires.
For a remote receiver, use HTTPS and its required authentication headers.
See OTLP transport settings.
Apply the configuration
Installer-managed deployments
- Find the installation profile with
goodmem system info. - Open its directory under
~/.goodmem/installs/local-docker/<profile-name>/. - Add the variables to its private
.envfile. - Restart the installation:
goodmem system stop
goodmem system startDirect JVM or IDE launch
Set the variables in the Java process environment or the IDE server run configuration. Restart the Java process after the change.
Alternatively, use JVM properties before -jar:
java \
-Dotel.traces.exporter=otlp \
-Dotel.exporter.otlp.traces.protocol=http/protobuf \
-Dotel.exporter.otlp.traces.endpoint=http://localhost:4318/v1/traces \
-jar goodmem-server.jarRetain the usual server configuration and JVM options. This example uses a collector on the same host as the Java process.
Kubernetes deployment notes
Set the same variables in the pod environment, with credentials from a Secret.
Use terminationGracePeriodSeconds: 30 as shown below.
Allow time for shutdown
The server stop grace period is 30 seconds. Before a planned stop, request a server drain with the CLI:
goodmem system drain --waitStop the container only after the command reports Quiesced: true.
For Compose or Kubernetes, use these settings:
# Compose server service
services:
server:
stop_grace_period: 30s# Kubernetes pod specification
spec:
terminationGracePeriodSeconds: 30Test the drain and stop sequence under representative load before production use.
Verify delivery
- Set
GOODMEM_URLto the REST base URL. - Supply
GOODMEM_API_KEYthrough your private environment. - Send one authenticated request:
curl --fail-with-body --silent --show-error \
--dump-header /tmp/goodmem-trace-check.headers \
-H "x-api-key: $GOODMEM_API_KEY" \
"$GOODMEM_URL/v1/spaces?maxResults=1"Use an API key with permission to list spaces.
- Find the request in the collector debug output under
service.name=goodmem-server. - Match its
goodmem.request.idwith the responsegoodmem-request-idheader. - If the collector forwards traces to a backend, find that span's trace ID there.
With the debug-only collector example, verification ends at collector receipt. A matching backend trace confirms delivery through the destination exporter as well. If a stage fails, use Troubleshoot tracing to locate the failure.
Set the production sampling policy
After verification, replace always_on with your production sampler.
For example:
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=0.1Restart the installation or Java process after the change.
Connect the caller trace
Configure the caller transport to inject W3C traceparent and tracestate.
The GoodMem client SDKs rely on caller transport instrumentation or explicit context injection for this step.
| Transport | Context source |
|---|---|
| REST or HTTP MCP | HTTP client instrumentation or explicit headers |
| Network gRPC | gRPC client instrumentation or explicit metadata |
| Stdio MCP | No HTTP header channel |
To retain one trace, use GOODMEM_OTEL_REMOTE_PARENT=parent. Export the caller spans to the same destination.
Verify a shared trace ID and the expected parent span ID at GoodMem ingress.