@@ -20,50 +20,50 @@ import (
2020// Config holds the configuration for OpenTelemetry instrumentation.
2121type Config struct {
2222 // Endpoint is the OTLP endpoint URL
23- Endpoint string `json:"endpoint"`
23+ Endpoint string `json:"endpoint" yaml:"endpoint" `
2424
2525 // ServiceName is the service name for telemetry
26- ServiceName string `json:"serviceName"`
26+ ServiceName string `json:"serviceName" yaml:"serviceName" `
2727
2828 // ServiceVersion is the service version for telemetry
29- ServiceVersion string `json:"serviceVersion"`
29+ ServiceVersion string `json:"serviceVersion" yaml:"serviceVersion" `
3030
3131 // TracingEnabled controls whether distributed tracing is enabled
3232 // When false, no tracer provider is created even if an endpoint is configured
33- TracingEnabled bool `json:"tracingEnabled"`
33+ TracingEnabled bool `json:"tracingEnabled" yaml:"tracingEnabled" `
3434
3535 // MetricsEnabled controls whether OTLP metrics are enabled
3636 // When false, OTLP metrics are not sent even if an endpoint is configured
3737 // This is independent of EnablePrometheusMetricsPath
38- MetricsEnabled bool `json:"metricsEnabled"`
38+ MetricsEnabled bool `json:"metricsEnabled" yaml:"metricsEnabled" `
3939
4040 // SamplingRate is the trace sampling rate (0.0-1.0)
4141 // Only used when TracingEnabled is true
42- SamplingRate float64 `json:"samplingRate"`
42+ SamplingRate float64 `json:"samplingRate" yaml:"samplingRate" `
4343
4444 // Headers contains authentication headers for the OTLP endpoint
45- Headers map [string ]string `json:"headers"`
45+ Headers map [string ]string `json:"headers" yaml:"headers" `
4646
4747 // Insecure indicates whether to use HTTP instead of HTTPS for the OTLP endpoint
48- Insecure bool `json:"insecure"`
48+ Insecure bool `json:"insecure" yaml:"insecure" `
4949
5050 // EnablePrometheusMetricsPath controls whether to expose Prometheus-style /metrics endpoint
5151 // The metrics are served on the main transport port at /metrics
5252 // This is separate from OTLP metrics which are sent to the Endpoint
53- EnablePrometheusMetricsPath bool `json:"enablePrometheusMetricsPath"`
53+ EnablePrometheusMetricsPath bool `json:"enablePrometheusMetricsPath" yaml:"enablePrometheusMetricsPath" `
5454
5555 // EnvironmentVariables is a list of environment variable names that should be
5656 // included in telemetry spans as attributes. Only variables in this list will
5757 // be read from the host machine and included in spans for observability.
5858 // Example: []string{"NODE_ENV", "DEPLOYMENT_ENV", "SERVICE_VERSION"}
59- EnvironmentVariables []string `json:"environmentVariables"`
59+ EnvironmentVariables []string `json:"environmentVariables" yaml:"environmentVariables" `
6060
6161 // CustomAttributes contains custom resource attributes to be added to all telemetry signals.
6262 // These are parsed from CLI flags (--otel-custom-attributes) or environment variables
6363 // (OTEL_RESOURCE_ATTRIBUTES) as key=value pairs.
6464 // We use map[string]string for proper JSON serialization instead of []attribute.KeyValue
6565 // which doesn't marshal/unmarshal correctly.
66- CustomAttributes map [string ]string `json:"customAttributes,omitempty"`
66+ CustomAttributes map [string ]string `json:"customAttributes,omitempty" yaml:"customAttributes,omitempty" `
6767}
6868
6969// DefaultConfig returns a default telemetry configuration.
0 commit comments