MCPTelemetryConfig
MCPTelemetryConfig defines telemetry settings that can be shared across multiple MCP workloads. MCPServer, MCPRemoteProxy, and VirtualMCPServer reference a single MCPTelemetryConfig to emit traces and metrics to a common backend.
API: toolhive.stacklok.dev/v1alpha1
· Scope: Namespaced · Short names: mcpotel
Example
apiVersion: toolhive.stacklok.dev/v1alpha1
kind: MCPTelemetryConfig
metadata:
name: my-mcptelemetryconfig
namespace: default
spec: {}
Schema
spec
MCPTelemetryConfigSpec defines the desired state of MCPTelemetryConfig. The spec uses a nested structure with openTelemetry and prometheus sub-objects for clear separation of concerns.
| Field | Type | Description |
|---|---|---|
openTelemetry | object | OpenTelemetry defines OpenTelemetry configuration (OTLP endpoint, tracing, metrics) |
prometheus | object | Prometheus defines Prometheus-specific configuration |
spec.openTelemetry
OpenTelemetry defines OpenTelemetry configuration (OTLP endpoint, tracing, metrics)
| Field | Type | Description |
|---|---|---|
caBundleRef | object | CABundleRef references a ConfigMap containing a CA certificate bundle for the OTLP endpoint. When specified, the operator mounts the ConfigMap into the proxyrunner pod and configures the OTLP exporters to trust the custom CA. This is useful when the OTLP collector uses TLS with certificates signed by an internal or private CA. |
enabled | boolean | Enabled controls whether OpenTelemetry is enabled default false |
endpoint | string | Endpoint is the OTLP endpoint URL for tracing and metrics |
headers | map<string, string> | Headers contains authentication headers for the OTLP endpoint. For secret-backed credentials, use sensitiveHeaders instead. |
insecure | boolean | Insecure indicates whether to use HTTP instead of HTTPS for the OTLP endpoint default false |
metrics | object | Metrics defines OpenTelemetry metrics-specific configuration |
resourceAttributes | map<string, string> | ResourceAttributes contains custom resource attributes to be added to all telemetry signals. These become OTel resource attributes (e.g., deployment.environment, service.namespace). Note: service.name is intentionally excluded — it is set per-server via MCPTelemetryConfigReference.ServiceName. |
sensitiveHeaders | object[] | SensitiveHeaders contains headers whose values are stored in Kubernetes Secrets. Use this for credential headers (e.g., API keys, bearer tokens) instead of embedding secrets in the headers field. |
tracing | object | Tracing defines OpenTelemetry tracing configuration |
useLegacyAttributes | boolean | UseLegacyAttributes controls whether legacy attribute names are emitted alongside the new MCP OTEL semantic convention names. Defaults to true for backward compatibility. This will change to false in a future release and eventually be removed. default true |
spec.openTelemetry.caBundleRef
CABundleRef references a ConfigMap containing a CA certificate bundle for the OTLP endpoint. When specified, the operator mounts the ConfigMap into the proxyrunner pod and configures the OTLP exporters to trust the custom CA. This is useful when the OTLP collector uses TLS with certificates signed by an internal or private CA.
| Field | Type | Description |
|---|---|---|
configMapRef | object | ConfigMapRef references a ConfigMap containing the CA certificate bundle. If Key is not specified, it defaults to "ca.crt". |
spec.openTelemetry.caBundleRef.configMapRef
ConfigMapRef references a ConfigMap containing the CA certificate bundle. If Key is not specified, it defaults to "ca.crt".
| Field | Type | Description |
|---|---|---|
keyrequired | string | The key to select. |
name | string | Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names default "" |
optional | boolean | Specify whether the ConfigMap or its key must be defined |
spec.openTelemetry.metrics
Metrics defines OpenTelemetry metrics-specific configuration
| Field | Type | Description |
|---|---|---|
enabled | boolean | Enabled controls whether OTLP metrics are sent default false |
spec.openTelemetry.sensitiveHeaders[]
SensitiveHeaders contains headers whose values are stored in Kubernetes Secrets. Use this for credential headers (e.g., API keys, bearer tokens) instead of embedding secrets in the headers field.
| Field | Type | Description |
|---|---|---|
namerequired | string | Name is the header name (e.g., "Authorization", "X-API-Key") minLength 1 |
secretKeyRefrequired | object | SecretKeyRef is a reference to a Kubernetes Secret key containing the header value |
spec.openTelemetry.sensitiveHeaders.secretKeyRef
SecretKeyRef is a reference to a Kubernetes Secret key containing the header value
| Field | Type | Description |
|---|---|---|
keyrequired | string | Key is the key within the secret |
namerequired | string | Name is the name of the secret |
spec.openTelemetry.tracing
Tracing defines OpenTelemetry tracing configuration
| Field | Type | Description |
|---|---|---|
enabled | boolean | Enabled controls whether OTLP tracing is sent default false |
samplingRate | string | SamplingRate is the trace sampling rate (0.0-1.0) default "0.05" · pattern ^(0(\.\d+)?|1(\.0+)?)$ |
spec.prometheus
Prometheus defines Prometheus-specific configuration
| Field | Type | Description |
|---|---|---|
enabled | boolean | Enabled controls whether Prometheus metrics endpoint is exposed default false |
status
MCPTelemetryConfigStatus defines the observed state of MCPTelemetryConfig
| Field | Type | Description |
|---|---|---|
conditions | object[] | Conditions represent the latest available observations of the MCPTelemetryConfig's state |
configHash | string | ConfigHash is a hash of the current configuration for change detection |
observedGeneration | integer | ObservedGeneration is the most recent generation observed for this MCPTelemetryConfig. format int64 |
referencingWorkloads | object[] | ReferencingWorkloads lists workloads that reference this MCPTelemetryConfig |
status.conditions[]
Conditions represent the latest available observations of the MCPTelemetryConfig's state
| Field | Type | Description |
|---|---|---|
lastTransitionTimerequired | string | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format date-time |
messagerequired | string | message is a human readable message indicating details about the transition. This may be an empty string. maxLength 32768 |
observedGeneration | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. format int64 · min 0 |
reasonrequired | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. pattern ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ · minLength 1 · maxLength 1024 |
statusrequired | string | status of the condition, one of True, False, Unknown. enum: True | False | Unknown |
typerequired | string | type of condition in CamelCase or in foo.example.com/CamelCase. pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ · maxLength 316 |
status.referencingWorkloads[]
ReferencingWorkloads lists workloads that reference this MCPTelemetryConfig
| Field | Type | Description |
|---|---|---|
kindrequired | string | Kind is the type of workload resource enum: MCPServer | VirtualMCPServer | MCPRemoteProxy |
namerequired | string | Name is the name of the workload resource minLength 1 |
Related resources
Referenced by:
- MCPRemoteProxy - via
spec.telemetryConfigRef - MCPServer - via
spec.telemetryConfigRef - VirtualMCPServer - via
spec.telemetryConfigRef