Skip to content

Commit eaa4660

Browse files
committed
Plumb telemetry config from CRD to vMCP Server
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
1 parent f0c4439 commit eaa4660

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

cmd/thv-operator/api/v1alpha1/virtualmcpserver_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package v1alpha1
22

33
import (
4+
"github.com/stacklok/toolhive/pkg/telemetry"
45
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
56
"k8s.io/apimachinery/pkg/runtime"
67
)
@@ -53,6 +54,11 @@ type VirtualMCPServerSpec struct {
5354
// +kubebuilder:pruning:PreserveUnknownFields
5455
// +kubebuilder:validation:Type=object
5556
PodTemplateSpec *runtime.RawExtension `json:"podTemplateSpec,omitempty"`
57+
58+
// Telemetry configures OpenTelemetry-based observability for the Virtual MCP server
59+
// including distributed tracing, OTLP metrics export, and Prometheus metrics endpoint
60+
// +optional
61+
Telemetry *telemetry.Config `json:"telemetry,omitempty"`
5662
}
5763

5864
// GroupRef references an MCPGroup resource

cmd/thv-operator/pkg/vmcpconfig/converter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ func (c *Converter) Convert(
9696
config.Operational = c.convertOperational(ctx, vmcp)
9797
}
9898

99+
// Convert Telemetry - pass through directly as it's the same type
100+
101+
config.Telemetry = vmcp.Spec.Telemetry
102+
99103
// Apply operational defaults (fills missing values)
100104
config.EnsureOperationalDefaults()
101105

0 commit comments

Comments
 (0)