spectoconfig

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package spectoconfig provides functionality to convert CRD Telemetry types into telemetry.Config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTelemetryConfig

func ConvertTelemetryConfig(
	ctx context.Context,
	telemetryConfig *v1alpha1.TelemetryConfig,
	mcpServerName string,
) *telemetry.Config

ConvertTelemetryConfig converts the CRD TelemetryConfig to a telemetry.Config. It may return nil if no telemetry is configured.

func NormalizeMCPTelemetryConfig added in v0.15.0

func NormalizeMCPTelemetryConfig(
	spec *v1alpha1.MCPTelemetryConfigSpec,
	serviceNameOverride string,
	defaultServiceName string,
) *telemetry.Config

NormalizeMCPTelemetryConfig converts an MCPTelemetryConfigSpec to a normalized telemetry.Config. It maps the nested CRD structure (openTelemetry/prometheus) to a flat telemetry.Config, applies the per-server ServiceName override from the reference, then delegates to NormalizeTelemetryConfig for endpoint normalization and service name defaulting.

func NormalizeTelemetryConfig added in v0.7.0

func NormalizeTelemetryConfig(config *telemetry.Config, defaultServiceName string) *telemetry.Config

NormalizeTelemetryConfig applies runtime normalization to a telemetry.Config. This includes: - Stripping http:// or https:// prefixes from the endpoint (OTLP clients expect host:port format) - Defaulting ServiceName to the provided default name if not specified

Note: ServiceVersion is intentionally NOT defaulted here. It is resolved at runtime in telemetry.NewProvider() to always reflect the running binary version, avoiding stale versions persisted in configs. See #2296.

This function is used by both the VirtualMCPServer converter (for spec.config.telemetry) and indirectly by ConvertTelemetryConfig (for CRD-style configs).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL