Observability
Integrating MCPTrust with monitoring and logging systems.
OpenTelemetry Tracing
Enable:
mcptrust lock --otel -- "..."Flags:
| Flag | Default | Description |
|---|---|---|
--otel | false | Enable tracing |
--otel-endpoint | localhost:4318 | OTLP endpoint |
--otel-protocol | otlphttp | otlphttp or otlpgrpc |
--otel-service-name | mcptrust | Service name |
--otel-sample-ratio | 1.0 | Sampling ratio |
--otel-insecure | false | Allow non-TLS connections (e.g. to localhost) |
Environment Variables:
OTEL_EXPORTER_OTLP_ENDPOINT: Overrides--otel-endpointif set.
Span Attributes
mcptrust.command: Command name (lock, scan, etc.)mcptrust.op_id: Unique operation ID for correlation- Context-specific: lockfile path, preset, server command
JSONL Logging
Enable:
mcptrust lock --log-format jsonl -- "..."Output: NDJSON lines to stderr or file. Fields: timestamp, level, message, op_id, etc.
Use Case: SIEM integration (Splunk, Datadog, Elastic).
Graceful Degradation
If OTel collector is down, mcptrust still runs (spans dropped silently).
No enforcement changes based on observability state.