|
86 | 86 | runK8sPodPatch string
|
87 | 87 | runCACertPath string
|
88 | 88 | runVerifyImage string
|
| 89 | + |
| 90 | + // OpenTelemetry flags |
| 91 | + runOtelEndpoint string |
| 92 | + runOtelServiceName string |
| 93 | + runOtelSamplingRate float64 |
| 94 | + runOtelHeaders []string |
| 95 | + runOtelInsecure bool |
| 96 | + runOtelMetricsPort int |
89 | 97 | )
|
90 | 98 |
|
91 | 99 | func init() {
|
@@ -170,6 +178,20 @@ func init() {
|
170 | 178 |
|
171 | 179 | // Add OIDC validation flags
|
172 | 180 | AddOIDCFlags(runCmd)
|
| 181 | + |
| 182 | + // Add OpenTelemetry flags |
| 183 | + runCmd.Flags().StringVar(&runOtelEndpoint, "otel-endpoint", "", |
| 184 | + "OpenTelemetry OTLP endpoint URL (e.g., https://api.honeycomb.io)") |
| 185 | + runCmd.Flags().StringVar(&runOtelServiceName, "otel-service-name", "", |
| 186 | + "OpenTelemetry service name (defaults to toolhive-mcp-proxy)") |
| 187 | + runCmd.Flags().Float64Var(&runOtelSamplingRate, "otel-sampling-rate", 0.1, |
| 188 | + "OpenTelemetry trace sampling rate (0.0-1.0)") |
| 189 | + runCmd.Flags().StringArrayVar(&runOtelHeaders, "otel-headers", nil, |
| 190 | + "OpenTelemetry OTLP headers in key=value format (e.g., x-honeycomb-team=your-api-key)") |
| 191 | + runCmd.Flags().BoolVar(&runOtelInsecure, "otel-insecure", false, |
| 192 | + "Disable TLS verification for OpenTelemetry endpoint") |
| 193 | + runCmd.Flags().IntVar(&runOtelMetricsPort, "otel-metrics-port", 0, |
| 194 | + "Port to expose Prometheus-style /metrics endpoint (0 disables)") |
173 | 195 | }
|
174 | 196 |
|
175 | 197 | func runCmdFunc(cmd *cobra.Command, args []string) error {
|
@@ -224,6 +246,12 @@ func runCmdFunc(cmd *cobra.Command, args []string) error {
|
224 | 246 | oidcAudience,
|
225 | 247 | oidcJwksURL,
|
226 | 248 | oidcClientID,
|
| 249 | + runOtelEndpoint, |
| 250 | + runOtelServiceName, |
| 251 | + runOtelSamplingRate, |
| 252 | + runOtelHeaders, |
| 253 | + runOtelInsecure, |
| 254 | + runOtelMetricsPort, |
227 | 255 | )
|
228 | 256 |
|
229 | 257 | // Set the Kubernetes pod template patch if provided
|
|
0 commit comments