@@ -128,7 +128,8 @@ It currently supports:
128
128
* Virtualization of legacy APIs as MCP-compliant tools and servers
129
129
* Transport over HTTP, JSON-RPC, WebSocket, SSE (with configurable keepalive), stdio and streamable-HTTP
130
130
* An Admin UI for real-time management and configuration
131
- * Built-in auth, observability, retries, and rate-limiting
131
+ * Built-in auth, retries, and rate-limiting
132
+ * ** OpenTelemetry observability** with Phoenix, Jaeger, Zipkin, and other OTLP backends
132
133
* Scalable deployments via Docker or PyPI, Redis-backed caching, and multi-cluster federation
133
134
134
135
![ MCP Gateway Architecture] ( https://ibm.github.io/mcp-context-forge/images/mcpgateway.svg )
@@ -195,6 +196,35 @@ For a list of upcoming features, check out the [ContextForge MCP Gateway Roadmap
195
196
196
197
</details >
197
198
199
+ <details >
200
+ <summary ><strong >🔍 OpenTelemetry Observability</strong ></summary >
201
+
202
+ * ** Vendor-agnostic tracing** with OpenTelemetry (OTLP) protocol support
203
+ * ** Multiple backend support** : Phoenix (LLM-focused), Jaeger, Zipkin, Tempo, DataDog, New Relic
204
+ * ** Distributed tracing** across federated gateways and services
205
+ * ** Automatic instrumentation** of tools, prompts, resources, and gateway operations
206
+ * ** LLM-specific metrics** : Token usage, costs, model performance
207
+ * ** Zero-overhead when disabled** with graceful degradation
208
+ * ** Easy configuration** via environment variables
209
+
210
+ Quick start with Phoenix (LLM observability):
211
+ ``` bash
212
+ # Start Phoenix
213
+ docker run -p 6006:6006 -p 4317:4317 arizephoenix/phoenix:latest
214
+
215
+ # Configure gateway
216
+ export OTEL_ENABLE_OBSERVABILITY=true
217
+ export OTEL_TRACES_EXPORTER=otlp
218
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
219
+
220
+ # Run gateway - traces automatically sent to Phoenix
221
+ mcpgateway
222
+ ```
223
+
224
+ See [ Observability Documentation] ( https://ibm.github.io/mcp-context-forge/manage/observability/ ) for detailed setup with other backends.
225
+
226
+ </details >
227
+
198
228
---
199
229
200
230
## Quick Start - PyPI
@@ -1083,6 +1113,65 @@ LOG_FILE=gateway.log
1083
1113
- File logging is **disabled by default** (no files created)
1084
1114
- Set `LOG_TO_FILE=true` to enable optional file logging with JSON format
1085
1115
1116
+ ### Observability (OpenTelemetry)
1117
+
1118
+ MCP Gateway includes **vendor-agnostic OpenTelemetry support** for distributed tracing. Works with Phoenix, Jaeger, Zipkin, Tempo, DataDog, New Relic, and any OTLP-compatible backend.
1119
+
1120
+ | Setting | Description | Default | Options |
1121
+ | ------------------------------- | ---------------------------------------------- | --------------------- | ------------------------------------------ |
1122
+ | `OTEL_ENABLE_OBSERVABILITY` | Master switch for observability | `true` | `true`, `false` |
1123
+ | `OTEL_SERVICE_NAME` | Service identifier in traces | `mcp-gateway` | string |
1124
+ | `OTEL_SERVICE_VERSION` | Service version in traces | `0.5.0` | string |
1125
+ | `OTEL_DEPLOYMENT_ENVIRONMENT` | Environment tag (dev/staging/prod) | `development` | string |
1126
+ | `OTEL_TRACES_EXPORTER` | Trace exporter backend | `otlp` | `otlp`, `jaeger`, `zipkin`, `console`, `none` |
1127
+ | `OTEL_RESOURCE_ATTRIBUTES` | Custom resource attributes | (empty) | `key=value,key2=value2` |
1128
+
1129
+ **OTLP Configuration** (for Phoenix, Tempo, DataDog, etc.):
1130
+
1131
+ | Setting | Description | Default | Options |
1132
+ | ------------------------------- | ---------------------------------------------- | --------------------- | ------------------------------------------ |
1133
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint | (none) | `http://localhost:4317` |
1134
+ | `OTEL_EXPORTER_OTLP_PROTOCOL` | OTLP protocol | `grpc` | `grpc`, `http/protobuf` |
1135
+ | `OTEL_EXPORTER_OTLP_HEADERS` | Authentication headers | (empty) | `api-key=secret,x-auth=token` |
1136
+ | `OTEL_EXPORTER_OTLP_INSECURE` | Skip TLS verification | `true` | `true`, `false` |
1137
+
1138
+ **Alternative Backends** (optional):
1139
+
1140
+ | Setting | Description | Default | Options |
1141
+ | ------------------------------- | ---------------------------------------------- | --------------------- | ------------------------------------------ |
1142
+ | `OTEL_EXPORTER_JAEGER_ENDPOINT` | Jaeger collector endpoint | `http://localhost:14268/api/traces` | URL |
1143
+ | `OTEL_EXPORTER_ZIPKIN_ENDPOINT` | Zipkin collector endpoint | `http://localhost:9411/api/v2/spans` | URL |
1144
+
1145
+ **Performance Tuning**:
1146
+
1147
+ | Setting | Description | Default | Options |
1148
+ | ------------------------------- | ---------------------------------------------- | --------------------- | ------------------------------------------ |
1149
+ | `OTEL_TRACES_SAMPLER` | Sampling strategy | `parentbased_traceidratio` | `always_on`, `always_off`, `traceidratio` |
1150
+ | `OTEL_TRACES_SAMPLER_ARG` | Sample rate (0.0-1.0) | `0.1` | float (0.1 = 10% sampling) |
1151
+ | `OTEL_BSP_MAX_QUEUE_SIZE` | Max queued spans | `2048` | int > 0 |
1152
+ | `OTEL_BSP_MAX_EXPORT_BATCH_SIZE`| Max batch size for export | `512` | int > 0 |
1153
+ | `OTEL_BSP_SCHEDULE_DELAY` | Export interval (ms) | `5000` | int > 0 |
1154
+
1155
+ **Quick Start with Phoenix**:
1156
+ ```bash
1157
+ # Start Phoenix for LLM observability
1158
+ docker run -p 6006:6006 -p 4317:4317 arizephoenix/phoenix:latest
1159
+
1160
+ # Configure gateway
1161
+ export OTEL_ENABLE_OBSERVABILITY=true
1162
+ export OTEL_TRACES_EXPORTER=otlp
1163
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
1164
+
1165
+ # Run gateway - traces automatically sent to Phoenix
1166
+ mcpgateway
1167
+ ```
1168
+
1169
+ > 🔍 **What Gets Traced**: Tool invocations, prompt rendering, resource fetching, gateway federation, health checks, plugin execution (if enabled)
1170
+ >
1171
+ > 🚀 **Zero Overhead**: When `OTEL_ENABLE_OBSERVABILITY=false`, all tracing is disabled with no performance impact
1172
+ >
1173
+ > 📊 **View Traces**: Phoenix UI at `http://localhost:6006`, Jaeger at `http://localhost:16686`, or your configured backend
1174
+
1086
1175
### Transport
1087
1176
1088
1177
| Setting | Description | Default | Options |
0 commit comments