From 1156a1170299c5d6c303baa29b26b20f2f5c197f Mon Sep 17 00:00:00 2001 From: alex boten <223565+codeboten@users.noreply.github.com> Date: Tue, 3 Feb 2026 16:03:34 -0800 Subject: [PATCH 1/4] otelconf: update to latest config schema rc Updates the library to rc.3 of the otel config schema. Some notable changes listed in the release notes of the schema: https://github.com/open-telemetry/opentelemetry-configuration/releases/tag/v1.0.0-rc.3 Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com> --- Makefile | 4 +- otelconf/config_json.go | 63 +- otelconf/config_test.go | 365 +++--- otelconf/config_yaml.go | 72 +- otelconf/generated_config.go | 2122 ++++++++++++++++++++++++++------- otelconf/log.go | 16 +- otelconf/log_test.go | 92 +- otelconf/metric.go | 39 +- otelconf/metric_test.go | 136 ++- otelconf/propagator.go | 2 +- otelconf/propagator_test.go | 26 +- otelconf/resource.go | 2 +- otelconf/resource_test.go | 12 +- otelconf/testdata/v1.0.0.json | 70 +- otelconf/testdata/v1.0.0.yaml | 199 ++-- otelconf/trace.go | 20 +- otelconf/trace_test.go | 107 +- 17 files changed, 2242 insertions(+), 1105 deletions(-) diff --git a/Makefile b/Makefile index 12a7f5c9e5e..c9b2f9b8111 100644 --- a/Makefile +++ b/Makefile @@ -323,7 +323,7 @@ update-all-otel-deps: OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR=tmp/opentelemetry-configuration # The SHA matching the current version of the opentelemetry-configuration schema to use -OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION=v1.0.0-rc.2 +OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION=v1.0.0-rc.3 # Cleanup temporary directory genjsonschema-cleanup: @@ -342,7 +342,7 @@ genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA) --package otelconf \ --only-models \ --output ${GENERATED_CONFIG} \ - ${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR}/schema/opentelemetry_configuration.json + ${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR}/opentelemetry_configuration.json @echo Modify jsonschema generated files. sed -f ./otelconf/jsonschema_patch.sed ${GENERATED_CONFIG} > ${GENERATED_CONFIG}.tmp mv ${GENERATED_CONFIG}.tmp ${GENERATED_CONFIG} diff --git a/otelconf/config_json.go b/otelconf/config_json.go index 08376162b06..30695413faf 100644 --- a/otelconf/config_json.go +++ b/otelconf/config_json.go @@ -251,11 +251,11 @@ func (j *PushMetricExporter) UnmarshalJSON(b []byte) error { } if sh.Console != nil { - var c ConsoleExporter + var c ConsoleMetricExporter if err := json.Unmarshal(sh.Console, &c); err != nil { return err } - sh.Plain.Console = c + sh.Plain.Console = &c } *j = PushMetricExporter(sh.Plain) return nil @@ -458,7 +458,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } if sh.LoggerProvider != nil { - var l LoggerProviderJson + var l LoggerProvider if err := json.Unmarshal(sh.LoggerProvider, &l); err != nil { return errors.Join(newErrUnmarshal(j), err) } @@ -466,7 +466,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } if sh.MeterProvider != nil { - var m MeterProviderJson + var m MeterProvider if err := json.Unmarshal(sh.MeterProvider, &m); err != nil { return errors.Join(newErrUnmarshal(j), err) } @@ -474,7 +474,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } if sh.TracerProvider != nil { - var t TracerProviderJson + var t TracerProvider if err := json.Unmarshal(sh.TracerProvider, &t); err != nil { return errors.Join(newErrUnmarshal(j), err) } @@ -482,7 +482,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } if sh.Propagator != nil { - var p PropagatorJson + var p Propagator if err := json.Unmarshal(sh.Propagator, &p); err != nil { return errors.Join(newErrUnmarshal(j), err) } @@ -490,7 +490,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } if sh.Resource != nil { - var r ResourceJson + var r Resource if err := json.Unmarshal(sh.Resource, &r); err != nil { return errors.Join(newErrUnmarshal(j), err) } @@ -498,7 +498,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } if sh.InstrumentationDevelopment != nil { - var r InstrumentationJson + var r ExperimentalInstrumentation if err := json.Unmarshal(sh.InstrumentationDevelopment, &r); err != nil { return errors.Join(newErrUnmarshal(j), err) } @@ -530,7 +530,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { } else { // Configure the log level of the internal logger used by the SDK. // If omitted, info is used. - sh.Plain.LogLevel = ptr("info") + sh.Plain.LogLevel = ptr(SeverityNumberInfo) } *j = OpenTelemetryConfiguration(sh.Plain) @@ -689,21 +689,19 @@ func (j *OTLPGrpcExporter) UnmarshalJSON(b []byte) error { // UnmarshalJSON implements json.Unmarshaler. func (j *AttributeType) UnmarshalJSON(b []byte) error { - var v struct { - Value any - } - if err := json.Unmarshal(b, &v.Value); err != nil { + var v string + if err := json.Unmarshal(b, &v); err != nil { return errors.Join(newErrUnmarshal(j), err) } var ok bool for _, expected := range enumValuesAttributeType { - if reflect.DeepEqual(v.Value, expected) { + if reflect.DeepEqual(v, expected) { ok = true break } } if !ok { - return newErrInvalid(fmt.Sprintf("unexpected value type %#v, expected one of %#v)", v.Value, enumValuesAttributeType)) + return newErrInvalid(fmt.Sprintf("unexpected value type %#v, expected one of %#v)", v, enumValuesAttributeType)) } *j = AttributeType(v) return nil @@ -735,14 +733,14 @@ func (j *AttributeNameValue) UnmarshalJSON(b []byte) error { } // json unmarshaller defaults to unmarshalling to float for int values - if sh.Type != nil && sh.Type.Value == "int" { + if sh.Type != nil && *sh.Type == AttributeTypeInt { val, ok := sh.Plain.Value.(float64) if ok { sh.Plain.Value = int(val) } } - if sh.Type != nil && sh.Type.Value == "int_array" { + if sh.Type != nil && *sh.Type == AttributeTypeIntArray { m, ok := sh.Plain.Value.([]any) if ok { var vals []any @@ -806,31 +804,6 @@ func (j *SimpleSpanProcessor) UnmarshalJSON(b []byte) error { return nil } -// UnmarshalJSON implements json.Unmarshaler. -func (j *ZipkinSpanExporter) UnmarshalJSON(b []byte) error { - type Plain ZipkinSpanExporter - type shadow struct { - Plain - Endpoint json.RawMessage `json:"endpoint"` - } - var sh shadow - if err := json.Unmarshal(b, &sh); err != nil { - return errors.Join(newErrUnmarshal(j), err) - } - if sh.Endpoint == nil { - return newErrRequired(j, "endpoint") - } - - if err := json.Unmarshal(sh.Endpoint, &sh.Plain.Endpoint); err != nil { - return err - } - if sh.Timeout != nil && 0 > *sh.Timeout { - return newErrGreaterOrEqualZero("timeout") - } - *j = ZipkinSpanExporter(sh.Plain) - return nil -} - // UnmarshalJSON implements json.Unmarshaler. func (j *NameStringValuePair) UnmarshalJSON(b []byte) error { type Plain NameStringValuePair @@ -874,8 +847,8 @@ func (j *InstrumentType) UnmarshalJSON(b []byte) error { } // UnmarshalJSON implements json.Unmarshaler. -func (j *ExperimentalPeerInstrumentationServiceMappingElem) UnmarshalJSON(b []byte) error { - type Plain ExperimentalPeerInstrumentationServiceMappingElem +func (j *ExperimentalPeerServiceMapping) UnmarshalJSON(b []byte) error { + type Plain ExperimentalPeerServiceMapping type shadow struct { Plain Peer json.RawMessage `json:"peer"` @@ -898,7 +871,7 @@ func (j *ExperimentalPeerInstrumentationServiceMappingElem) UnmarshalJSON(b []by return errors.Join(newErrUnmarshal(j), err) } - *j = ExperimentalPeerInstrumentationServiceMappingElem(sh.Plain) + *j = ExperimentalPeerServiceMapping(sh.Plain) return nil } diff --git a/otelconf/config_test.go b/otelconf/config_test.go index f7cbfe14b7c..0b0471de780 100644 --- a/otelconf/config_test.go +++ b/otelconf/config_test.go @@ -27,10 +27,6 @@ func TestUnmarshalPushMetricExporterInvalidData(t *testing.T) { err := cl.UnmarshalJSON([]byte(`{:2000}`)) assert.ErrorIs(t, err, newErrUnmarshal(&PushMetricExporter{})) - cl = PushMetricExporter{} - err = cl.UnmarshalJSON([]byte(`{"console":2000}`)) - assert.ErrorIs(t, err, newErrUnmarshal(&ConsoleExporter{})) - cl = PushMetricExporter{} err = yaml.Unmarshal([]byte("console: !!str str"), &cl) assert.ErrorIs(t, err, newErrUnmarshal(&PushMetricExporter{})) @@ -373,10 +369,10 @@ func TestNewSDK(t *testing.T) { cfg: []ConfigurationOption{ WithContext(t.Context()), WithOpenTelemetryConfiguration(OpenTelemetryConfiguration{ - TracerProvider: &TracerProviderJson{}, - MeterProvider: &MeterProviderJson{}, - LoggerProvider: &LoggerProviderJson{}, - Propagator: &PropagatorJson{}, + TracerProvider: &TracerProvider{}, + MeterProvider: &MeterProvider{}, + LoggerProvider: &LoggerProvider{}, + Propagator: &Propagator{}, }), }, wantTracerProvider: &sdktrace.TracerProvider{}, @@ -390,9 +386,9 @@ func TestNewSDK(t *testing.T) { WithContext(t.Context()), WithOpenTelemetryConfiguration(OpenTelemetryConfiguration{ Disabled: ptr(true), - TracerProvider: &TracerProviderJson{}, - MeterProvider: &MeterProviderJson{}, - LoggerProvider: &LoggerProviderJson{}, + TracerProvider: &TracerProvider{}, + MeterProvider: &MeterProvider{}, + LoggerProvider: &LoggerProvider{}, }), }, wantTracerProvider: tracenoop.NewTracerProvider(), @@ -441,7 +437,7 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ AttributeCountLimit: ptr(128), AttributeValueLengthLimit: ptr(4096), }, - InstrumentationDevelopment: &InstrumentationJson{ + InstrumentationDevelopment: &ExperimentalInstrumentation{ Cpp: ExperimentalLanguageSpecificInstrumentation{ "example": map[string]any{ "property": "value", @@ -459,17 +455,17 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, General: &ExperimentalGeneralInstrumentation{ Http: &ExperimentalHttpInstrumentation{ - Client: &ExperimentalHttpInstrumentationClient{ + Client: &ExperimentalHttpClientInstrumentation{ RequestCapturedHeaders: []string{"Content-Type", "Accept"}, ResponseCapturedHeaders: []string{"Content-Type", "Content-Encoding"}, }, - Server: &ExperimentalHttpInstrumentationServer{ + Server: &ExperimentalHttpServerInstrumentation{ RequestCapturedHeaders: []string{"Content-Type", "Accept"}, ResponseCapturedHeaders: []string{"Content-Type", "Content-Encoding"}, }, }, Peer: &ExperimentalPeerInstrumentation{ - ServiceMapping: []ExperimentalPeerInstrumentationServiceMappingElem{ + ServiceMapping: []ExperimentalPeerServiceMapping{ {Peer: "1.2.3.4", Service: "FooService"}, {Peer: "2.3.4.5", Service: "BarService"}, }, @@ -516,18 +512,18 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, }, }, - LogLevel: ptr("info"), - LoggerProvider: &LoggerProviderJson{ + LogLevel: ptr(SeverityNumberInfo), + LoggerProvider: &LoggerProvider{ LoggerConfiguratorDevelopment: &ExperimentalLoggerConfigurator{ DefaultConfig: &ExperimentalLoggerConfig{ Disabled: ptr(true), }, Loggers: []ExperimentalLoggerMatcherAndConfig{ { - Config: &ExperimentalLoggerConfig{ + Config: ExperimentalLoggerConfig{ Disabled: ptr(false), }, - Name: ptr("io.opentelemetry.contrib.*"), + Name: "io.opentelemetry.contrib.*", }, }, }, @@ -541,12 +537,14 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ ExportTimeout: ptr(30000), Exporter: LogRecordExporter{ OTLPHttp: &OTLPHttpExporter{ - CertificateFile: ptr("testdata/ca.crt"), - ClientCertificateFile: ptr("testdata/client.crt"), - ClientKeyFile: ptr("testdata/client.key"), - Compression: ptr("gzip"), - Encoding: ptr(OTLPHttpEncodingProtobuf), - Endpoint: ptr("http://localhost:4318/v1/logs"), + Tls: &HttpTls{ + CaFile: ptr("testdata/ca.crt"), + CertFile: ptr("testdata/client.crt"), + KeyFile: ptr("testdata/client.key"), + }, + Compression: ptr("gzip"), + Encoding: ptr(OTLPHttpEncodingProtobuf), + Endpoint: ptr("http://localhost:4318/v1/logs"), Headers: []NameStringValuePair{ {Name: "api-key", Value: ptr("1234")}, }, @@ -563,17 +561,19 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPGrpc: &OTLPGrpcExporter{ - CertificateFile: ptr("testdata/ca.crt"), - ClientCertificateFile: ptr("testdata/client.crt"), - ClientKeyFile: ptr("testdata/client.key"), - Compression: ptr("gzip"), - Endpoint: ptr("http://localhost:4317"), + Tls: &GrpcTls{ + CaFile: ptr("testdata/ca.crt"), + CertFile: ptr("testdata/client.crt"), + KeyFile: ptr("testdata/client.key"), + Insecure: ptr(false), + }, + Compression: ptr("gzip"), + Endpoint: ptr("http://localhost:4317"), Headers: []NameStringValuePair{ {Name: "api-key", Value: ptr("1234")}, }, HeadersList: ptr("api-key=1234"), Timeout: ptr(10000), - Insecure: ptr(false), }, }, }, @@ -605,7 +605,7 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, }, }, - MeterProvider: &MeterProviderJson{ + MeterProvider: &MeterProvider{ ExemplarFilter: ptr(ExemplarFilter("trace_based")), MeterConfiguratorDevelopment: &ExperimentalMeterConfigurator{ DefaultConfig: &ExperimentalMeterConfig{ @@ -613,10 +613,10 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, Meters: []ExperimentalMeterMatcherAndConfig{ { - Config: &ExperimentalMeterConfig{ + Config: ExperimentalMeterConfig{ Disabled: ptr(false), }, - Name: ptr("io.opentelemetry.contrib.*"), + Name: "io.opentelemetry.contrib.*", }, }, }, @@ -642,7 +642,7 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ PrometheusDevelopment: &ExperimentalPrometheusMetricExporter{ Host: ptr("localhost"), Port: ptr(9464), - TranslationStrategy: ptr(ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithSuffixes), + TranslationStrategy: ptr(ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithSuffixes), WithResourceConstantLabels: &IncludeExclude{ Excluded: []string{"service.attr1"}, Included: []string{"service*"}, @@ -673,9 +673,11 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, Exporter: PushMetricExporter{ OTLPHttp: &OTLPHttpMetricExporter{ - CertificateFile: ptr("testdata/ca.crt"), - ClientCertificateFile: ptr("testdata/client.crt"), - ClientKeyFile: ptr("testdata/client.key"), + Tls: &HttpTls{ + CaFile: ptr("testdata/ca.crt"), + CertFile: ptr("testdata/client.crt"), + KeyFile: ptr("testdata/client.key"), + }, Compression: ptr("gzip"), DefaultHistogramAggregation: ptr(ExporterDefaultHistogramAggregationBase2ExponentialBucketHistogram), Endpoint: ptr("http://localhost:4318/v1/metrics"), @@ -696,9 +698,12 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPGrpc: &OTLPGrpcMetricExporter{ - CertificateFile: ptr("testdata/ca.crt"), - ClientCertificateFile: ptr("testdata/client.crt"), - ClientKeyFile: ptr("testdata/client.key"), + Tls: &GrpcTls{ + CaFile: ptr("testdata/ca.crt"), + CertFile: ptr("testdata/client.crt"), + KeyFile: ptr("testdata/client.key"), + Insecure: ptr(false), + }, Compression: ptr("gzip"), DefaultHistogramAggregation: ptr(ExporterDefaultHistogramAggregationBase2ExponentialBucketHistogram), Endpoint: ptr("http://localhost:4317"), @@ -708,7 +713,6 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ HeadersList: ptr("api-key=1234"), TemporalityPreference: ptr(ExporterTemporalityPreferenceDelta), Timeout: ptr(10000), - Insecure: ptr(false), }, }, }, @@ -738,14 +742,14 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ - Console: ConsoleExporter{}, + Console: &ConsoleMetricExporter{}, }, }, }, }, Views: []View{ { - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("my-instrument"), InstrumentType: ptr(InstrumentTypeHistogram), MeterName: ptr("my-meter"), @@ -753,7 +757,7 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ MeterVersion: ptr("1.0.0"), Unit: ptr("ms"), }, - Stream: &ViewStream{ + Stream: ViewStream{ Aggregation: &Aggregation{ ExplicitBucketHistogram: &ExplicitBucketHistogramAggregation{ Boundaries: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000}, @@ -771,7 +775,7 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, }, }, - Propagator: &PropagatorJson{ + Propagator: &Propagator{ Composite: []TextMapPropagator{ { Tracecontext: TraceContextPropagator{}, @@ -794,17 +798,17 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, CompositeList: ptr("tracecontext,baggage,b3,b3multi,jaeger,ottrace,xray"), }, - Resource: &ResourceJson{ + Resource: &Resource{ Attributes: []AttributeNameValue{ {Name: "service.name", Value: "unknown_service"}, - {Name: "string_key", Type: &AttributeType{Value: "string"}, Value: "value"}, - {Name: "bool_key", Type: &AttributeType{Value: "bool"}, Value: true}, - {Name: "int_key", Type: &AttributeType{Value: "int"}, Value: 1}, - {Name: "double_key", Type: &AttributeType{Value: "double"}, Value: 1.1}, - {Name: "string_array_key", Type: &AttributeType{Value: "string_array"}, Value: []any{"value1", "value2"}}, - {Name: "bool_array_key", Type: &AttributeType{Value: "bool_array"}, Value: []any{true, false}}, - {Name: "int_array_key", Type: &AttributeType{Value: "int_array"}, Value: []any{1, 2}}, - {Name: "double_array_key", Type: &AttributeType{Value: "double_array"}, Value: []any{1.1, 2.2}}, + {Name: "string_key", Type: ptr(AttributeTypeString), Value: "value"}, + {Name: "bool_key", Type: ptr(AttributeTypeBool), Value: true}, + {Name: "int_key", Type: ptr(AttributeTypeInt), Value: 1}, + {Name: "double_key", Type: ptr(AttributeTypeDouble), Value: 1.1}, + {Name: "string_array_key", Type: ptr(AttributeTypeStringArray), Value: []any{"value1", "value2"}}, + {Name: "bool_array_key", Type: ptr(AttributeTypeBoolArray), Value: []any{true, false}}, + {Name: "int_array_key", Type: ptr(AttributeTypeIntArray), Value: []any{1, 2}}, + {Name: "double_array_key", Type: ptr(AttributeTypeDoubleArray), Value: []any{1.1, 2.2}}, }, AttributesList: ptr("service.namespace=my-namespace,service.version=1.0.0"), DetectionDevelopment: &ExperimentalResourceDetection{ @@ -820,17 +824,17 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, }, }, - TracerProvider: &TracerProviderJson{ + TracerProvider: &TracerProvider{ TracerConfiguratorDevelopment: &ExperimentalTracerConfigurator{ DefaultConfig: &ExperimentalTracerConfig{ Disabled: ptr(true), }, Tracers: []ExperimentalTracerMatcherAndConfig{ { - Config: ptr(ExperimentalTracerConfig{ + Config: ExperimentalTracerConfig{ Disabled: ptr(false), - }), - Name: ptr("io.opentelemetry.contrib.*"), + }, + Name: "io.opentelemetry.contrib.*", }, }, }, @@ -849,12 +853,14 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ ExportTimeout: ptr(30000), Exporter: SpanExporter{ OTLPHttp: &OTLPHttpExporter{ - CertificateFile: ptr("testdata/ca.crt"), - ClientCertificateFile: ptr("testdata/client.crt"), - ClientKeyFile: ptr("testdata/client.key"), - Compression: ptr("gzip"), - Encoding: ptr(OTLPHttpEncodingProtobuf), - Endpoint: ptr("http://localhost:4318/v1/traces"), + Tls: &HttpTls{ + CaFile: ptr("testdata/ca.crt"), + CertFile: ptr("testdata/client.crt"), + KeyFile: ptr("testdata/client.key"), + }, + Compression: ptr("gzip"), + Encoding: ptr(OTLPHttpEncodingProtobuf), + Endpoint: ptr("http://localhost:4318/v1/traces"), Headers: []NameStringValuePair{ {Name: "api-key", Value: ptr("1234")}, }, @@ -871,17 +877,19 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPGrpc: &OTLPGrpcExporter{ - CertificateFile: ptr("testdata/ca.crt"), - ClientCertificateFile: ptr("testdata/client.crt"), - ClientKeyFile: ptr("testdata/client.key"), - Compression: ptr("gzip"), - Endpoint: ptr("http://localhost:4317"), + Tls: &GrpcTls{ + CaFile: ptr("testdata/ca.crt"), + CertFile: ptr("testdata/client.crt"), + KeyFile: ptr("testdata/client.key"), + Insecure: ptr(false), + }, + Compression: ptr("gzip"), + Endpoint: ptr("http://localhost:4317"), Headers: []NameStringValuePair{ {Name: "api-key", Value: ptr("1234")}, }, HeadersList: ptr("api-key=1234"), Timeout: ptr(10000), - Insecure: ptr(false), }, }, }, @@ -904,16 +912,6 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ }, }, }, - { - Batch: &BatchSpanProcessor{ - Exporter: SpanExporter{ - Zipkin: &ZipkinSpanExporter{ - Endpoint: ptr("http://localhost:9411/api/v2/spans"), - Timeout: ptr(10000), - }, - }, - }, - }, { Simple: &SimpleSpanProcessor{ Exporter: SpanExporter{ @@ -949,49 +947,49 @@ var v10OpenTelemetryConfig = OpenTelemetryConfiguration{ var v100OpenTelemetryConfigEnvParsing = OpenTelemetryConfiguration{ Disabled: ptr(false), FileFormat: "1.0", - LogLevel: ptr("info"), + LogLevel: ptr(SeverityNumberInfo), AttributeLimits: &AttributeLimits{ AttributeCountLimit: ptr(128), AttributeValueLengthLimit: ptr(4096), }, - Resource: &ResourceJson{ + Resource: &Resource{ Attributes: []AttributeNameValue{ {Name: "service.name", Value: "unknown_service"}, - {Name: "string_key", Type: &AttributeType{Value: "string"}, Value: "value"}, - {Name: "bool_key", Type: &AttributeType{Value: "bool"}, Value: true}, - {Name: "int_key", Type: &AttributeType{Value: "int"}, Value: 1}, - {Name: "double_key", Type: &AttributeType{Value: "double"}, Value: 1.1}, - {Name: "string_array_key", Type: &AttributeType{Value: "string_array"}, Value: []any{"value1", "value2"}}, - {Name: "bool_array_key", Type: &AttributeType{Value: "bool_array"}, Value: []any{true, false}}, - {Name: "int_array_key", Type: &AttributeType{Value: "int_array"}, Value: []any{1, 2}}, - {Name: "double_array_key", Type: &AttributeType{Value: "double_array"}, Value: []any{1.1, 2.2}}, - {Name: "string_value", Type: &AttributeType{Value: "string"}, Value: "value"}, - {Name: "bool_value", Type: &AttributeType{Value: "bool"}, Value: true}, - {Name: "int_value", Type: &AttributeType{Value: "int"}, Value: 1}, - {Name: "float_value", Type: &AttributeType{Value: "double"}, Value: 1.1}, - {Name: "hex_value", Type: &AttributeType{Value: "int"}, Value: int(48879)}, - {Name: "quoted_string_value", Type: &AttributeType{Value: "string"}, Value: "value"}, - {Name: "quoted_bool_value", Type: &AttributeType{Value: "string"}, Value: "true"}, - {Name: "quoted_int_value", Type: &AttributeType{Value: "string"}, Value: "1"}, - {Name: "quoted_float_value", Type: &AttributeType{Value: "string"}, Value: "1.1"}, - {Name: "quoted_hex_value", Type: &AttributeType{Value: "string"}, Value: "0xbeef"}, - {Name: "alternative_env_syntax", Type: &AttributeType{Value: "string"}, Value: "value"}, - {Name: "invalid_map_value", Type: &AttributeType{Value: "string"}, Value: "value\nkey:value"}, - {Name: "multiple_references_inject", Type: &AttributeType{Value: "string"}, Value: "foo value 1.1"}, - {Name: "undefined_key", Type: &AttributeType{Value: "string"}, Value: nil}, - {Name: "undefined_key_fallback", Type: &AttributeType{Value: "string"}, Value: "fallback"}, - {Name: "env_var_in_key", Type: &AttributeType{Value: "string"}, Value: "value"}, - {Name: "replace_me", Type: &AttributeType{Value: "string"}, Value: "${DO_NOT_REPLACE_ME}"}, - {Name: "undefined_defaults_to_var", Type: &AttributeType{Value: "string"}, Value: "${STRING_VALUE}"}, - {Name: "escaped_does_not_substitute", Type: &AttributeType{Value: "string"}, Value: "${STRING_VALUE}"}, - {Name: "escaped_does_not_substitute_fallback", Type: &AttributeType{Value: "string"}, Value: "${STRING_VALUE:-fallback}"}, - {Name: "escaped_and_substituted_fallback", Type: &AttributeType{Value: "string"}, Value: "${STRING_VALUE:-value}"}, - {Name: "escaped_and_substituted", Type: &AttributeType{Value: "string"}, Value: "$value"}, - {Name: "multiple_escaped_and_not_substituted", Type: &AttributeType{Value: "string"}, Value: "$${STRING_VALUE}"}, - {Name: "undefined_key_with_escape_sequence_in_fallback", Type: &AttributeType{Value: "string"}, Value: "${UNDEFINED_KEY}"}, - {Name: "value_with_escape", Type: &AttributeType{Value: "string"}, Value: "value$$"}, - {Name: "escape_sequence", Type: &AttributeType{Value: "string"}, Value: "a $ b"}, - {Name: "no_escape_sequence", Type: &AttributeType{Value: "string"}, Value: "a $ b"}, + {Name: "string_key", Type: ptr(AttributeTypeString), Value: "value"}, + {Name: "bool_key", Type: ptr(AttributeTypeBool), Value: true}, + {Name: "int_key", Type: ptr(AttributeTypeInt), Value: 1}, + {Name: "double_key", Type: ptr(AttributeTypeDouble), Value: 1.1}, + {Name: "string_array_key", Type: ptr(AttributeTypeStringArray), Value: []any{"value1", "value2"}}, + {Name: "bool_array_key", Type: ptr(AttributeTypeBoolArray), Value: []any{true, false}}, + {Name: "int_array_key", Type: ptr(AttributeTypeIntArray), Value: []any{1, 2}}, + {Name: "double_array_key", Type: ptr(AttributeTypeDoubleArray), Value: []any{1.1, 2.2}}, + {Name: "string_value", Type: ptr(AttributeTypeString), Value: "value"}, + {Name: "bool_value", Type: ptr(AttributeTypeBool), Value: true}, + {Name: "int_value", Type: ptr(AttributeTypeInt), Value: 1}, + {Name: "float_value", Type: ptr(AttributeTypeDouble), Value: 1.1}, + {Name: "hex_value", Type: ptr(AttributeTypeInt), Value: int(48879)}, + {Name: "quoted_string_value", Type: ptr(AttributeTypeString), Value: "value"}, + {Name: "quoted_bool_value", Type: ptr(AttributeTypeString), Value: "true"}, + {Name: "quoted_int_value", Type: ptr(AttributeTypeString), Value: "1"}, + {Name: "quoted_float_value", Type: ptr(AttributeTypeString), Value: "1.1"}, + {Name: "quoted_hex_value", Type: ptr(AttributeTypeString), Value: "0xbeef"}, + {Name: "alternative_env_syntax", Type: ptr(AttributeTypeString), Value: "value"}, + {Name: "invalid_map_value", Type: ptr(AttributeTypeString), Value: "value\nkey:value"}, + {Name: "multiple_references_inject", Type: ptr(AttributeTypeString), Value: "foo value 1.1"}, + {Name: "undefined_key", Type: ptr(AttributeTypeString), Value: nil}, + {Name: "undefined_key_fallback", Type: ptr(AttributeTypeString), Value: "fallback"}, + {Name: "env_var_in_key", Type: ptr(AttributeTypeString), Value: "value"}, + {Name: "replace_me", Type: ptr(AttributeTypeString), Value: "${DO_NOT_REPLACE_ME}"}, + {Name: "undefined_defaults_to_var", Type: ptr(AttributeTypeString), Value: "${STRING_VALUE}"}, + {Name: "escaped_does_not_substitute", Type: ptr(AttributeTypeString), Value: "${STRING_VALUE}"}, + {Name: "escaped_does_not_substitute_fallback", Type: ptr(AttributeTypeString), Value: "${STRING_VALUE:-fallback}"}, + {Name: "escaped_and_substituted_fallback", Type: ptr(AttributeTypeString), Value: "${STRING_VALUE:-value}"}, + {Name: "escaped_and_substituted", Type: ptr(AttributeTypeString), Value: "$value"}, + {Name: "multiple_escaped_and_not_substituted", Type: ptr(AttributeTypeString), Value: "$${STRING_VALUE}"}, + {Name: "undefined_key_with_escape_sequence_in_fallback", Type: ptr(AttributeTypeString), Value: "${UNDEFINED_KEY}"}, + {Name: "value_with_escape", Type: ptr(AttributeTypeString), Value: "value$$"}, + {Name: "escape_sequence", Type: ptr(AttributeTypeString), Value: "a $ b"}, + {Name: "no_escape_sequence", Type: ptr(AttributeTypeString), Value: "a $ b"}, }, AttributesList: ptr("service.namespace=my-namespace,service.version=1.0.0"), // Detectors: &Detectors{ @@ -1080,7 +1078,7 @@ func TestUnmarshalOpenTelemetryConfiguration(t *testing.T) { wantType: OpenTelemetryConfiguration{ Disabled: ptr(false), FileFormat: "1.0", - LogLevel: ptr("info"), + LogLevel: ptr(SeverityNumberInfo), }, }, { @@ -1304,31 +1302,31 @@ func TestUnmarshalPeriodicMetricReader(t *testing.T) { name: "valid with null console exporter", jsonConfig: []byte(`{"exporter":{"console":null}}`), yamlConfig: []byte("exporter:\n console:\n"), - wantExporter: PushMetricExporter{Console: ConsoleExporter{}}, + wantExporter: PushMetricExporter{Console: &ConsoleMetricExporter{}}, }, { name: "valid with console exporter", jsonConfig: []byte(`{"exporter":{"console":{}}}`), yamlConfig: []byte("exporter:\n console: {}"), - wantExporter: PushMetricExporter{Console: ConsoleExporter{}}, + wantExporter: PushMetricExporter{Console: &ConsoleMetricExporter{}}, }, { name: "valid with all fields positive", jsonConfig: []byte(`{"exporter":{"console":{}},"timeout":5000,"interval":1000}`), yamlConfig: []byte("exporter:\n console: {}\ntimeout: 5000\ninterval: 1000"), - wantExporter: PushMetricExporter{Console: ConsoleExporter{}}, + wantExporter: PushMetricExporter{Console: &ConsoleMetricExporter{}}, }, { name: "valid with zero timeout", jsonConfig: []byte(`{"exporter":{"console":{}},"timeout":0}`), yamlConfig: []byte("exporter:\n console: {}\ntimeout: 0"), - wantExporter: PushMetricExporter{Console: ConsoleExporter{}}, + wantExporter: PushMetricExporter{Console: &ConsoleMetricExporter{}}, }, { name: "valid with zero interval", jsonConfig: []byte(`{"exporter":{"console":{}},"interval":0}`), yamlConfig: []byte("exporter:\n console: {}\ninterval: 0"), - wantExporter: PushMetricExporter{Console: ConsoleExporter{}}, + wantExporter: PushMetricExporter{Console: &ConsoleMetricExporter{}}, }, { name: "missing required exporter field", @@ -1883,59 +1881,6 @@ func TestUnmarshalOTLPGrpcMetricExporter(t *testing.T) { } } -func TestUnmarshalZipkinSpanExporter(t *testing.T) { - for _, tt := range []struct { - name string - yamlConfig []byte - jsonConfig []byte - wantErrT error - wantExporter ZipkinSpanExporter - }{ - { - name: "valid with exporter", - jsonConfig: []byte(`{"endpoint":"localhost:9000"}`), - yamlConfig: []byte("endpoint: localhost:9000\n"), - wantExporter: ZipkinSpanExporter{Endpoint: ptr("localhost:9000")}, - }, - { - name: "missing required endpoint field", - jsonConfig: []byte(`{}`), - yamlConfig: []byte("{}"), - wantErrT: newErrRequired(&ZipkinSpanExporter{}, "endpoint"), - }, - { - name: "valid with zero timeout", - jsonConfig: []byte(`{"endpoint":"localhost:9000", "timeout":0}`), - yamlConfig: []byte("endpoint: localhost:9000\ntimeout: 0"), - wantExporter: ZipkinSpanExporter{Endpoint: ptr("localhost:9000"), Timeout: ptr(0)}, - }, - { - name: "invalid data", - jsonConfig: []byte(`{:2000}`), - yamlConfig: []byte("endpoint: localhost:9000\ntimeout: !!str str"), - wantErrT: newErrUnmarshal(&ZipkinSpanExporter{}), - }, - { - name: "invalid timeout negative", - jsonConfig: []byte(`{"endpoint":"localhost:9000", "timeout":-1}`), - yamlConfig: []byte("endpoint: localhost:9000\ntimeout: -1"), - wantErrT: newErrGreaterOrEqualZero("timeout"), - }, - } { - t.Run(tt.name, func(t *testing.T) { - cl := ZipkinSpanExporter{} - err := cl.UnmarshalJSON(tt.jsonConfig) - assert.ErrorIs(t, err, tt.wantErrT) - assert.Equal(t, tt.wantExporter, cl) - - cl = ZipkinSpanExporter{} - err = yaml.Unmarshal(tt.yamlConfig, &cl) - assert.ErrorIs(t, err, tt.wantErrT) - assert.Equal(t, tt.wantExporter, cl) - }) - } -} - func TestUnmarshalAttributeNameValueType(t *testing.T) { for _, tt := range []struct { name string @@ -1969,7 +1914,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: "test-val", - Type: &AttributeType{Value: "string"}, + Type: ptr(AttributeTypeString), }, }, { @@ -1979,7 +1924,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: []any{"test-val", "test-val-2"}, - Type: &AttributeType{Value: "string_array"}, + Type: ptr(AttributeTypeStringArray), }, }, { @@ -1989,7 +1934,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: true, - Type: &AttributeType{Value: "bool"}, + Type: ptr(AttributeTypeBool), }, }, { @@ -1999,7 +1944,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: []any{"test-val", "test-val-2"}, - Type: &AttributeType{Value: "string_array"}, + Type: ptr(AttributeTypeStringArray), }, }, { @@ -2009,7 +1954,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: int(1), - Type: &AttributeType{Value: "int"}, + Type: ptr(AttributeTypeInt), }, }, { @@ -2019,7 +1964,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: []any{1, 2}, - Type: &AttributeType{Value: "int_array"}, + Type: ptr(AttributeTypeIntArray), }, }, { @@ -2029,7 +1974,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: float64(1), - Type: &AttributeType{Value: "double"}, + Type: ptr(AttributeTypeDouble), }, }, { @@ -2039,7 +1984,7 @@ func TestUnmarshalAttributeNameValueType(t *testing.T) { wantAttributeNameValue: AttributeNameValue{ Name: "test", Value: []any{float64(1), float64(2)}, - Type: &AttributeType{Value: "double_array"}, + Type: ptr(AttributeTypeDoubleArray), }, }, { @@ -2167,43 +2112,43 @@ func TestUnmarshalInstrumentType(t *testing.T) { } } -func TestUnmarshalExperimentalPeerInstrumentationServiceMappingElemType(t *testing.T) { +func TestUnmarshalExperimentalPeerServiceMappingType(t *testing.T) { for _, tt := range []struct { - name string - yamlConfig []byte - jsonConfig []byte - wantErrT error - wantExperimentalPeerInstrumentationServiceMappingElem ExperimentalPeerInstrumentationServiceMappingElem + name string + yamlConfig []byte + jsonConfig []byte + wantErrT error + wantExperimentalPeerServiceMapping ExperimentalPeerServiceMapping }{ { name: "invalid data", jsonConfig: []byte(`{:2000}`), yamlConfig: []byte("peer: []\nservice: true"), - wantErrT: newErrUnmarshal(&ExperimentalPeerInstrumentationServiceMappingElem{}), + wantErrT: newErrUnmarshal(&ExperimentalPeerServiceMapping{}), }, { name: "missing required peer field", jsonConfig: []byte(`{}`), yamlConfig: []byte("{}"), - wantErrT: newErrRequired(&ExperimentalPeerInstrumentationServiceMappingElem{}, "peer"), + wantErrT: newErrRequired(&ExperimentalPeerServiceMapping{}, "peer"), }, { name: "missing required service field", jsonConfig: []byte(`{"peer":"test"}`), yamlConfig: []byte("peer: test"), - wantErrT: newErrRequired(&ExperimentalPeerInstrumentationServiceMappingElem{}, "service"), + wantErrT: newErrRequired(&ExperimentalPeerServiceMapping{}, "service"), }, { name: "invalid string_array peer", jsonConfig: []byte(`{"peer":[], "service": ["test-val", "test-val-2"], "type": "string_array"}`), yamlConfig: []byte("peer: []\nservice: [test-val, test-val-2]\ntype: string_array\n"), - wantErrT: newErrUnmarshal(&ExperimentalPeerInstrumentationServiceMappingElem{}), + wantErrT: newErrUnmarshal(&ExperimentalPeerServiceMapping{}), }, { name: "valid string service", jsonConfig: []byte(`{"peer":"test", "service": "test-val"}`), yamlConfig: []byte("peer: test\nservice: test-val"), - wantExperimentalPeerInstrumentationServiceMappingElem: ExperimentalPeerInstrumentationServiceMappingElem{ + wantExperimentalPeerServiceMapping: ExperimentalPeerServiceMapping{ Peer: "test", Service: "test-val", }, @@ -2212,19 +2157,19 @@ func TestUnmarshalExperimentalPeerInstrumentationServiceMappingElemType(t *testi name: "invalid string_array service", jsonConfig: []byte(`{"peer":"test", "service": ["test-val", "test-val-2"], "type": "string_array"}`), yamlConfig: []byte("peer: test\nservice: [test-val, test-val-2]\ntype: string_array\n"), - wantErrT: newErrUnmarshal(&ExperimentalPeerInstrumentationServiceMappingElem{}), + wantErrT: newErrUnmarshal(&ExperimentalPeerServiceMapping{}), }, } { t.Run(tt.name, func(t *testing.T) { - val := ExperimentalPeerInstrumentationServiceMappingElem{} + val := ExperimentalPeerServiceMapping{} err := val.UnmarshalJSON(tt.jsonConfig) assert.ErrorIs(t, err, tt.wantErrT) - assert.Equal(t, tt.wantExperimentalPeerInstrumentationServiceMappingElem, val) + assert.Equal(t, tt.wantExperimentalPeerServiceMapping, val) - val = ExperimentalPeerInstrumentationServiceMappingElem{} + val = ExperimentalPeerServiceMapping{} err = yaml.Unmarshal(tt.yamlConfig, &val) assert.ErrorIs(t, err, tt.wantErrT) - assert.Equal(t, tt.wantExperimentalPeerInstrumentationServiceMappingElem, val) + assert.Equal(t, tt.wantExperimentalPeerServiceMapping, val) }) } } @@ -2318,13 +2263,13 @@ func TestUnmarshalResourceJson(t *testing.T) { yamlConfig []byte jsonConfig []byte wantErrT error - wantResource ResourceJson + wantResource Resource }{ { name: "valid with all detectors", jsonConfig: []byte(`{"detection/development": {"detectors": [{"container": null},{"host": null},{"process": null},{"service": null}]}}`), yamlConfig: []byte("detection/development:\n detectors:\n - container:\n - host:\n - process:\n - service:"), - wantResource: ResourceJson{ + wantResource: Resource{ DetectionDevelopment: &ExperimentalResourceDetection{ Detectors: []ExperimentalResourceDetector{ { @@ -2347,7 +2292,7 @@ func TestUnmarshalResourceJson(t *testing.T) { name: "valid non-nil with all detectors", jsonConfig: []byte(`{"detection/development": {"detectors": [{"container": {}},{"host": {}},{"process": {}},{"service": {}}]}}`), yamlConfig: []byte("detection/development:\n detectors:\n - container: {}\n - host: {}\n - process: {}\n - service: {}"), - wantResource: ResourceJson{ + wantResource: Resource{ DetectionDevelopment: &ExperimentalResourceDetection{ Detectors: []ExperimentalResourceDetector{ { @@ -2370,7 +2315,7 @@ func TestUnmarshalResourceJson(t *testing.T) { name: "invalid container detector", jsonConfig: []byte(`{"detection/development": {"detectors": [{"container": 1}]}}`), yamlConfig: []byte("detection/development:\n detectors:\n - container: 1"), - wantResource: ResourceJson{ + wantResource: Resource{ DetectionDevelopment: &ExperimentalResourceDetection{ Detectors: []ExperimentalResourceDetector{ {}, @@ -2383,7 +2328,7 @@ func TestUnmarshalResourceJson(t *testing.T) { name: "invalid host detector", jsonConfig: []byte(`{"detection/development": {"detectors": [{"host": 1}]}}`), yamlConfig: []byte("detection/development:\n detectors:\n - host: 1"), - wantResource: ResourceJson{ + wantResource: Resource{ DetectionDevelopment: &ExperimentalResourceDetection{ Detectors: []ExperimentalResourceDetector{ {}, @@ -2396,7 +2341,7 @@ func TestUnmarshalResourceJson(t *testing.T) { name: "invalid service detector", jsonConfig: []byte(`{"detection/development": {"detectors": [{"service": 1}]}}`), yamlConfig: []byte("detection/development:\n detectors:\n - service: 1"), - wantResource: ResourceJson{ + wantResource: Resource{ DetectionDevelopment: &ExperimentalResourceDetection{ Detectors: []ExperimentalResourceDetector{ {}, @@ -2409,7 +2354,7 @@ func TestUnmarshalResourceJson(t *testing.T) { name: "invalid process detector", jsonConfig: []byte(`{"detection/development": {"detectors": [{"process": 1}]}}`), yamlConfig: []byte("detection/development:\n detectors:\n - process: 1"), - wantResource: ResourceJson{ + wantResource: Resource{ DetectionDevelopment: &ExperimentalResourceDetection{ Detectors: []ExperimentalResourceDetector{ {}, @@ -2420,12 +2365,12 @@ func TestUnmarshalResourceJson(t *testing.T) { }, } { t.Run(tt.name, func(t *testing.T) { - r := ResourceJson{} + r := Resource{} err := json.Unmarshal(tt.jsonConfig, &r) assert.ErrorIs(t, err, tt.wantErrT) assert.Equal(t, tt.wantResource, r) - r = ResourceJson{} + r = Resource{} err = yaml.Unmarshal(tt.yamlConfig, &r) assert.ErrorIs(t, err, tt.wantErrT) assert.Equal(t, tt.wantResource, r) diff --git a/otelconf/config_yaml.go b/otelconf/config_yaml.go index 8c251e83c24..bcb3da50474 100644 --- a/otelconf/config_yaml.go +++ b/otelconf/config_yaml.go @@ -62,7 +62,7 @@ func (j *PushMetricExporter) UnmarshalYAML(node *yaml.Node) error { } // console can be nil, must check and set here if hasYAMLMapKey(node, "console") && plain.Console == nil { - plain.Console = ConsoleExporter{} + plain.Console = &ConsoleMetricExporter{} } *j = PushMetricExporter(plain) return nil @@ -76,16 +76,16 @@ func (j *OpenTelemetryConfiguration) UnmarshalYAML(node *yaml.Node) error { type Plain OpenTelemetryConfiguration type shadow struct { Plain - LogLevel *string `yaml:"log_level,omitempty"` - AttributeLimits *AttributeLimits `yaml:"attribute_limits,omitempty"` - Disabled *bool `yaml:"disabled,omitempty"` - FileFormat string `yaml:"file_format"` - LoggerProvider *LoggerProviderJson `yaml:"logger_provider,omitempty"` - MeterProvider *MeterProviderJson `yaml:"meter_provider,omitempty"` - TracerProvider *TracerProviderJson `yaml:"tracer_provider,omitempty"` - Propagator *PropagatorJson `yaml:"propagator,omitempty"` - Resource *ResourceJson `yaml:"resource,omitempty"` - InstrumentationDevelopment *InstrumentationJson `yaml:"instrumentation/development"` + LogLevel *SeverityNumber `yaml:"log_level,omitempty"` + AttributeLimits *AttributeLimits `yaml:"attribute_limits,omitempty"` + Disabled *bool `yaml:"disabled,omitempty"` + FileFormat string `yaml:"file_format"` + LoggerProvider *LoggerProvider `yaml:"logger_provider,omitempty"` + MeterProvider *MeterProvider `yaml:"meter_provider,omitempty"` + TracerProvider *TracerProvider `yaml:"tracer_provider,omitempty"` + Propagator *Propagator `yaml:"propagator,omitempty"` + Resource *Resource `yaml:"resource,omitempty"` + InstrumentationDevelopment *ExperimentalInstrumentation `yaml:"instrumentation/development"` } var sh shadow @@ -129,7 +129,7 @@ func (j *OpenTelemetryConfiguration) UnmarshalYAML(node *yaml.Node) error { } else { // Configure the log level of the internal logger used by the SDK. // If omitted, info is used. - sh.Plain.LogLevel = ptr("info") + sh.Plain.LogLevel = ptr(SeverityNumberInfo) } *j = OpenTelemetryConfiguration(sh.Plain) @@ -382,21 +382,19 @@ func (j *OTLPGrpcExporter) UnmarshalYAML(node *yaml.Node) error { // UnmarshalYAML implements yaml.Unmarshaler. func (j *AttributeType) UnmarshalYAML(node *yaml.Node) error { - var v struct { - Value any - } - if err := node.Decode(&v.Value); err != nil { + var v string + if err := node.Decode(&v); err != nil { return errors.Join(newErrUnmarshal(j), err) } var ok bool for _, expected := range enumValuesAttributeType { - if reflect.DeepEqual(v.Value, expected) { + if reflect.DeepEqual(v, expected) { ok = true break } } if !ok { - return newErrInvalid(fmt.Sprintf("unexpected value type %#v, expected one of %#v)", v.Value, enumValuesAttributeType)) + return newErrInvalid(fmt.Sprintf("unexpected value type %#v, expected one of %#v)", v, enumValuesAttributeType)) } *j = AttributeType(v) return nil @@ -417,14 +415,14 @@ func (j *AttributeNameValue) UnmarshalYAML(node *yaml.Node) error { } // yaml unmarshaller defaults to unmarshalling to int - if plain.Type != nil && plain.Type.Value == "double" { + if plain.Type != nil && *plain.Type == AttributeTypeDouble { val, ok := plain.Value.(int) if ok { plain.Value = float64(val) } } - if plain.Type != nil && plain.Type.Value == "double_array" { + if plain.Type != nil && *plain.Type == AttributeTypeDoubleArray { m, ok := plain.Value.([]any) if ok { var vals []any @@ -472,23 +470,6 @@ func (j *SimpleSpanProcessor) UnmarshalYAML(node *yaml.Node) error { return nil } -// UnmarshalYAML implements yaml.Unmarshaler. -func (j *ZipkinSpanExporter) UnmarshalYAML(node *yaml.Node) error { - if !hasYAMLMapKey(node, "endpoint") { - return newErrRequired(j, "endpoint") - } - type Plain ZipkinSpanExporter - var plain Plain - if err := node.Decode(&plain); err != nil { - return errors.Join(newErrUnmarshal(j), err) - } - if plain.Timeout != nil && 0 > *plain.Timeout { - return newErrGreaterOrEqualZero("timeout") - } - *j = ZipkinSpanExporter(plain) - return nil -} - // UnmarshalYAML implements yaml.Unmarshaler. func (j *NameStringValuePair) UnmarshalYAML(node *yaml.Node) error { if !hasYAMLMapKey(node, "name") { @@ -524,7 +505,7 @@ func (j *InstrumentType) UnmarshalYAML(node *yaml.Node) error { } // UnmarshalYAML implements yaml.Unmarshaler. -func (j *ExperimentalPeerInstrumentationServiceMappingElem) UnmarshalYAML(node *yaml.Node) error { +func (j *ExperimentalPeerServiceMapping) UnmarshalYAML(node *yaml.Node) error { if !hasYAMLMapKey(node, "peer") { return newErrRequired(j, "peer") } @@ -532,13 +513,13 @@ func (j *ExperimentalPeerInstrumentationServiceMappingElem) UnmarshalYAML(node * return newErrRequired(j, "service") } - type Plain ExperimentalPeerInstrumentationServiceMappingElem + type Plain ExperimentalPeerServiceMapping var plain Plain if err := node.Decode(&plain); err != nil { return errors.Join(newErrUnmarshal(j), err) } - *j = ExperimentalPeerInstrumentationServiceMappingElem(plain) + *j = ExperimentalPeerServiceMapping(plain) return nil } @@ -570,14 +551,3 @@ func (j *PullMetricReader) UnmarshalYAML(node *yaml.Node) error { *j = PullMetricReader(plain) return nil } - -// UnmarshalYAML implements yaml.Unmarshaler. -func (j *ExperimentalLanguageSpecificInstrumentation) UnmarshalYAML(unmarshal func(any) error) error { - var raw map[string]any - if err := unmarshal(&raw); err != nil { - return err - } - - *j = raw - return nil -} diff --git a/otelconf/generated_config.go b/otelconf/generated_config.go index 79d05e5d7e8..b881c108698 100644 --- a/otelconf/generated_config.go +++ b/otelconf/generated_config.go @@ -3,24 +3,50 @@ package otelconf type Aggregation struct { - // Base2ExponentialBucketHistogram corresponds to the JSON schema field - // "base2_exponential_bucket_histogram". + // Configures the stream to collect data for the exponential histogram metric + // point, which uses a base-2 exponential formula to determine bucket boundaries + // and an integer scale parameter to control resolution. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation + // for details. + // If omitted, ignore. + // Base2ExponentialBucketHistogram *Base2ExponentialBucketHistogramAggregation `json:"base2_exponential_bucket_histogram,omitempty" yaml:"base2_exponential_bucket_histogram,omitempty" mapstructure:"base2_exponential_bucket_histogram,omitempty"` - // Default corresponds to the JSON schema field "default". + // Configures the stream to use the instrument kind to select an aggregation and + // advisory parameters to influence aggregation configuration parameters. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation + // for details. + // If omitted, ignore. + // Default DefaultAggregation `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"` - // Drop corresponds to the JSON schema field "drop". + // Configures the stream to ignore/drop all instrument measurements. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#drop-aggregation + // for details. + // If omitted, ignore. + // Drop DropAggregation `json:"drop,omitempty" yaml:"drop,omitempty" mapstructure:"drop,omitempty"` - // ExplicitBucketHistogram corresponds to the JSON schema field - // "explicit_bucket_histogram". + // Configures the stream to collect data for the histogram metric point using a + // set of explicit boundary values for histogram bucketing. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation + // for details + // If omitted, ignore. + // ExplicitBucketHistogram *ExplicitBucketHistogramAggregation `json:"explicit_bucket_histogram,omitempty" yaml:"explicit_bucket_histogram,omitempty" mapstructure:"explicit_bucket_histogram,omitempty"` - // LastValue corresponds to the JSON schema field "last_value". + // Configures the stream to collect data using the last measurement. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#last-value-aggregation + // for details. + // If omitted, ignore. + // LastValue LastValueAggregation `json:"last_value,omitempty" yaml:"last_value,omitempty" mapstructure:"last_value,omitempty"` - // Sum corresponds to the JSON schema field "sum". + // Configures the stream to collect the arithmetic sum of measurement values. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#sum-aggregation + // for details. + // If omitted, ignore. + // Sum SumAggregation `json:"sum,omitempty" yaml:"sum,omitempty" mapstructure:"sum,omitempty"` } @@ -29,35 +55,66 @@ type AlwaysOffSampler map[string]interface{} type AlwaysOnSampler map[string]interface{} type AttributeLimits struct { - // AttributeCountLimit corresponds to the JSON schema field - // "attribute_count_limit". + // Configure max attribute count. + // Value must be non-negative. + // If omitted or null, 128 is used. + // AttributeCountLimit AttributeLimitsAttributeCountLimit `json:"attribute_count_limit,omitempty" yaml:"attribute_count_limit,omitempty" mapstructure:"attribute_count_limit,omitempty"` - // AttributeValueLengthLimit corresponds to the JSON schema field - // "attribute_value_length_limit". + // Configure max attribute value size. + // Value must be non-negative. + // If omitted or null, there is no limit. + // AttributeValueLengthLimit AttributeLimitsAttributeValueLengthLimit `json:"attribute_value_length_limit,omitempty" yaml:"attribute_value_length_limit,omitempty" mapstructure:"attribute_value_length_limit,omitempty"` - - AdditionalProperties interface{} `mapstructure:",remain"` } +// Configure max attribute count. +// Value must be non-negative. +// If omitted or null, 128 is used. type AttributeLimitsAttributeCountLimit *int +// Configure max attribute value size. +// Value must be non-negative. +// If omitted or null, there is no limit. type AttributeLimitsAttributeValueLengthLimit *int type AttributeNameValue struct { - // Name corresponds to the JSON schema field "name". + // The attribute name. + // Property is required and must be non-null. + // Name string `json:"name" yaml:"name" mapstructure:"name"` - // Type corresponds to the JSON schema field "type". + // The attribute type. + // Values include: + // * bool: Boolean attribute value. + // * bool_array: Boolean array attribute value. + // * double: Double attribute value. + // * double_array: Double array attribute value. + // * int: Integer attribute value. + // * int_array: Integer array attribute value. + // * string: String attribute value. + // * string_array: String array attribute value. + // If omitted, string is used. + // Type *AttributeType `json:"type,omitempty" yaml:"type,omitempty" mapstructure:"type,omitempty"` - // Value corresponds to the JSON schema field "value". + // The attribute value. + // The type of value must match .type. + // Property is required and must be non-null. + // Value interface{} `json:"value" yaml:"value" mapstructure:"value"` } -type AttributeType struct { - Value interface{} -} +type AttributeType string + +const AttributeTypeBool AttributeType = "bool" +const AttributeTypeBoolArray AttributeType = "bool_array" +const AttributeTypeDouble AttributeType = "double" +const AttributeTypeDoubleArray AttributeType = "double_array" +const AttributeTypeInt AttributeType = "int" +const AttributeTypeIntArray AttributeType = "int_array" +const AttributeTypeString AttributeType = "string" +const AttributeTypeStringArray AttributeType = "string_array" type B3MultiPropagator map[string]interface{} @@ -66,121 +123,236 @@ type B3Propagator map[string]interface{} type BaggagePropagator map[string]interface{} type Base2ExponentialBucketHistogramAggregation struct { - // MaxScale corresponds to the JSON schema field "max_scale". + // Configure the max scale factor. + // If omitted or null, 20 is used. + // MaxScale Base2ExponentialBucketHistogramAggregationMaxScale `json:"max_scale,omitempty" yaml:"max_scale,omitempty" mapstructure:"max_scale,omitempty"` - // MaxSize corresponds to the JSON schema field "max_size". + // Configure the maximum number of buckets in each of the positive and negative + // ranges, not counting the special zero bucket. + // If omitted or null, 160 is used. + // MaxSize Base2ExponentialBucketHistogramAggregationMaxSize `json:"max_size,omitempty" yaml:"max_size,omitempty" mapstructure:"max_size,omitempty"` - // RecordMinMax corresponds to the JSON schema field "record_min_max". + // Configure whether or not to record min and max. + // If omitted or null, true is used. + // RecordMinMax Base2ExponentialBucketHistogramAggregationRecordMinMax `json:"record_min_max,omitempty" yaml:"record_min_max,omitempty" mapstructure:"record_min_max,omitempty"` } +// Configure the max scale factor. +// If omitted or null, 20 is used. type Base2ExponentialBucketHistogramAggregationMaxScale *int +// Configure the maximum number of buckets in each of the positive and negative +// ranges, not counting the special zero bucket. +// If omitted or null, 160 is used. type Base2ExponentialBucketHistogramAggregationMaxSize *int +// Configure whether or not to record min and max. +// If omitted or null, true is used. type Base2ExponentialBucketHistogramAggregationRecordMinMax *bool type BatchLogRecordProcessor struct { - // ExportTimeout corresponds to the JSON schema field "export_timeout". + // Configure maximum allowed time (in milliseconds) to export data. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 30000 is used. + // ExportTimeout BatchLogRecordProcessorExportTimeout `json:"export_timeout,omitempty" yaml:"export_timeout,omitempty" mapstructure:"export_timeout,omitempty"` - // Exporter corresponds to the JSON schema field "exporter". + // Configure exporter. + // Property is required and must be non-null. + // Exporter LogRecordExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` - // MaxExportBatchSize corresponds to the JSON schema field - // "max_export_batch_size". + // Configure maximum batch size. Value must be positive. + // If omitted or null, 512 is used. + // MaxExportBatchSize BatchLogRecordProcessorMaxExportBatchSize `json:"max_export_batch_size,omitempty" yaml:"max_export_batch_size,omitempty" mapstructure:"max_export_batch_size,omitempty"` - // MaxQueueSize corresponds to the JSON schema field "max_queue_size". + // Configure maximum queue size. Value must be positive. + // If omitted or null, 2048 is used. + // MaxQueueSize BatchLogRecordProcessorMaxQueueSize `json:"max_queue_size,omitempty" yaml:"max_queue_size,omitempty" mapstructure:"max_queue_size,omitempty"` - // ScheduleDelay corresponds to the JSON schema field "schedule_delay". + // Configure delay interval (in milliseconds) between two consecutive exports. + // Value must be non-negative. + // If omitted or null, 1000 is used. + // ScheduleDelay BatchLogRecordProcessorScheduleDelay `json:"schedule_delay,omitempty" yaml:"schedule_delay,omitempty" mapstructure:"schedule_delay,omitempty"` } +// Configure maximum allowed time (in milliseconds) to export data. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 30000 is used. type BatchLogRecordProcessorExportTimeout *int +// Configure maximum batch size. Value must be positive. +// If omitted or null, 512 is used. type BatchLogRecordProcessorMaxExportBatchSize *int +// Configure maximum queue size. Value must be positive. +// If omitted or null, 2048 is used. type BatchLogRecordProcessorMaxQueueSize *int +// Configure delay interval (in milliseconds) between two consecutive exports. +// Value must be non-negative. +// If omitted or null, 1000 is used. type BatchLogRecordProcessorScheduleDelay *int type BatchSpanProcessor struct { - // ExportTimeout corresponds to the JSON schema field "export_timeout". + // Configure maximum allowed time (in milliseconds) to export data. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 30000 is used. + // ExportTimeout BatchSpanProcessorExportTimeout `json:"export_timeout,omitempty" yaml:"export_timeout,omitempty" mapstructure:"export_timeout,omitempty"` - // Exporter corresponds to the JSON schema field "exporter". + // Configure exporter. + // Property is required and must be non-null. + // Exporter SpanExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` - // MaxExportBatchSize corresponds to the JSON schema field - // "max_export_batch_size". + // Configure maximum batch size. Value must be positive. + // If omitted or null, 512 is used. + // MaxExportBatchSize BatchSpanProcessorMaxExportBatchSize `json:"max_export_batch_size,omitempty" yaml:"max_export_batch_size,omitempty" mapstructure:"max_export_batch_size,omitempty"` - // MaxQueueSize corresponds to the JSON schema field "max_queue_size". + // Configure maximum queue size. Value must be positive. + // If omitted or null, 2048 is used. + // MaxQueueSize BatchSpanProcessorMaxQueueSize `json:"max_queue_size,omitempty" yaml:"max_queue_size,omitempty" mapstructure:"max_queue_size,omitempty"` - // ScheduleDelay corresponds to the JSON schema field "schedule_delay". + // Configure delay interval (in milliseconds) between two consecutive exports. + // Value must be non-negative. + // If omitted or null, 5000 is used. + // ScheduleDelay BatchSpanProcessorScheduleDelay `json:"schedule_delay,omitempty" yaml:"schedule_delay,omitempty" mapstructure:"schedule_delay,omitempty"` } +// Configure maximum allowed time (in milliseconds) to export data. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 30000 is used. type BatchSpanProcessorExportTimeout *int +// Configure maximum batch size. Value must be positive. +// If omitted or null, 512 is used. type BatchSpanProcessorMaxExportBatchSize *int +// Configure maximum queue size. Value must be positive. +// If omitted or null, 2048 is used. type BatchSpanProcessorMaxQueueSize *int +// Configure delay interval (in milliseconds) between two consecutive exports. +// Value must be non-negative. +// If omitted or null, 5000 is used. type BatchSpanProcessorScheduleDelay *int type CardinalityLimits struct { - // Counter corresponds to the JSON schema field "counter". + // Configure default cardinality limit for counter instruments. + // If omitted or null, the value from .default is used. + // Counter CardinalityLimitsCounter `json:"counter,omitempty" yaml:"counter,omitempty" mapstructure:"counter,omitempty"` - // Default corresponds to the JSON schema field "default". + // Configure default cardinality limit for all instrument types. + // Instrument-specific cardinality limits take priority. + // If omitted or null, 2000 is used. + // Default CardinalityLimitsDefault `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"` - // Gauge corresponds to the JSON schema field "gauge". + // Configure default cardinality limit for gauge instruments. + // If omitted or null, the value from .default is used. + // Gauge CardinalityLimitsGauge `json:"gauge,omitempty" yaml:"gauge,omitempty" mapstructure:"gauge,omitempty"` - // Histogram corresponds to the JSON schema field "histogram". + // Configure default cardinality limit for histogram instruments. + // If omitted or null, the value from .default is used. + // Histogram CardinalityLimitsHistogram `json:"histogram,omitempty" yaml:"histogram,omitempty" mapstructure:"histogram,omitempty"` - // ObservableCounter corresponds to the JSON schema field "observable_counter". + // Configure default cardinality limit for observable_counter instruments. + // If omitted or null, the value from .default is used. + // ObservableCounter CardinalityLimitsObservableCounter `json:"observable_counter,omitempty" yaml:"observable_counter,omitempty" mapstructure:"observable_counter,omitempty"` - // ObservableGauge corresponds to the JSON schema field "observable_gauge". + // Configure default cardinality limit for observable_gauge instruments. + // If omitted or null, the value from .default is used. + // ObservableGauge CardinalityLimitsObservableGauge `json:"observable_gauge,omitempty" yaml:"observable_gauge,omitempty" mapstructure:"observable_gauge,omitempty"` - // ObservableUpDownCounter corresponds to the JSON schema field - // "observable_up_down_counter". + // Configure default cardinality limit for observable_up_down_counter instruments. + // If omitted or null, the value from .default is used. + // ObservableUpDownCounter CardinalityLimitsObservableUpDownCounter `json:"observable_up_down_counter,omitempty" yaml:"observable_up_down_counter,omitempty" mapstructure:"observable_up_down_counter,omitempty"` - // UpDownCounter corresponds to the JSON schema field "up_down_counter". + // Configure default cardinality limit for up_down_counter instruments. + // If omitted or null, the value from .default is used. + // UpDownCounter CardinalityLimitsUpDownCounter `json:"up_down_counter,omitempty" yaml:"up_down_counter,omitempty" mapstructure:"up_down_counter,omitempty"` } +// Configure default cardinality limit for counter instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsCounter *int +// Configure default cardinality limit for all instrument types. +// Instrument-specific cardinality limits take priority. +// If omitted or null, 2000 is used. type CardinalityLimitsDefault *int +// Configure default cardinality limit for gauge instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsGauge *int +// Configure default cardinality limit for histogram instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsHistogram *int +// Configure default cardinality limit for observable_counter instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsObservableCounter *int +// Configure default cardinality limit for observable_gauge instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsObservableGauge *int +// Configure default cardinality limit for observable_up_down_counter instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsObservableUpDownCounter *int +// Configure default cardinality limit for up_down_counter instruments. +// If omitted or null, the value from .default is used. type CardinalityLimitsUpDownCounter *int type ConsoleExporter map[string]interface{} +type ConsoleMetricExporter struct { + // Configure default histogram aggregation. + // Values include: + // * base2_exponential_bucket_histogram: Use base2 exponential histogram as the + // default aggregation for histogram instruments. + // * explicit_bucket_histogram: Use explicit bucket histogram as the default + // aggregation for histogram instruments. + // If omitted, explicit_bucket_histogram is used. + // + DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `json:"default_histogram_aggregation,omitempty" yaml:"default_histogram_aggregation,omitempty" mapstructure:"default_histogram_aggregation,omitempty"` + + // Configure temporality preference. + // Values include: + // * cumulative: Use cumulative aggregation temporality for all instrument types. + // * delta: Use delta aggregation for all instrument types except up down counter + // and asynchronous up down counter. + // * low_memory: Use delta aggregation temporality for counter and histogram + // instrument types. Use cumulative aggregation temporality for all other + // instrument types. + // If omitted, cumulative is used. + // + TemporalityPreference *ExporterTemporalityPreference `json:"temporality_preference,omitempty" yaml:"temporality_preference,omitempty" mapstructure:"temporality_preference,omitempty"` +} + type DefaultAggregation map[string]interface{} +type Distribution map[string]map[string]interface{} + type DropAggregation map[string]interface{} type ExemplarFilter string @@ -189,178 +361,640 @@ const ExemplarFilterAlwaysOff ExemplarFilter = "always_off" const ExemplarFilterAlwaysOn ExemplarFilter = "always_on" const ExemplarFilterTraceBased ExemplarFilter = "trace_based" +type ExperimentalComposableAlwaysOffSampler map[string]interface{} + +type ExperimentalComposableAlwaysOnSampler map[string]interface{} + +type ExperimentalComposableParentThresholdSampler struct { + // Sampler to use when there is no parent. + // Property is required and must be non-null. + // + Root ExperimentalComposableSampler `json:"root" yaml:"root" mapstructure:"root"` +} + +type ExperimentalComposableProbabilitySampler struct { + // Configure ratio. + // If omitted or null, 1.0 is used. + // + Ratio ExperimentalComposableProbabilitySamplerRatio `json:"ratio,omitempty" yaml:"ratio,omitempty" mapstructure:"ratio,omitempty"` +} + +// Configure ratio. +// If omitted or null, 1.0 is used. +type ExperimentalComposableProbabilitySamplerRatio *float64 + +type ExperimentalComposableRuleBasedSampler struct { + // The rules for the sampler, matched in order. If no rules match, the span is not + // sampled. + // If omitted or null, no span is sampled. + // + Rules *ExperimentalComposableRuleBasedSamplerRules `json:"rules,omitempty" yaml:"rules,omitempty" mapstructure:"rules,omitempty"` +} + +// A rule for ExperimentalComposableRuleBasedSampler. A rule can have multiple +// match conditions - the sampler will be applied if all match. +// If no conditions are specified, the rule matches all spans that reach it. +type ExperimentalComposableRuleBasedSamplerRule struct { + // Patterns to match against a single attribute. Non-string attributes are matched + // using their string representation: + // for example, a pattern of "4*" would match any http.response.status_code in + // 400-499. For array attributes, if any + // item matches, it is considered a match. + // If omitted, ignore. + // + AttributePatterns *ExperimentalComposableRuleBasedSamplerRuleAttributePatterns `json:"attribute_patterns,omitempty" yaml:"attribute_patterns,omitempty" mapstructure:"attribute_patterns,omitempty"` + + // Values to match against a single attribute. Non-string attributes are matched + // using their string representation: + // for example, a value of "404" would match the http.response.status_code 404. + // For array attributes, if any + // item matches, it is considered a match. + // If omitted, ignore. + // + AttributeValues *ExperimentalComposableRuleBasedSamplerRuleAttributeValues `json:"attribute_values,omitempty" yaml:"attribute_values,omitempty" mapstructure:"attribute_values,omitempty"` + + // The parent span types to match. + // Values include: + // * local: local, a local parent. + // * none: none, no parent, i.e., the trace root. + // * remote: remote, a remote parent. + // If omitted, ignore. + // + Parent []ExperimentalSpanParent `json:"parent,omitempty" yaml:"parent,omitempty" mapstructure:"parent,omitempty"` + + // The sampler to use for matching spans. + // Property is required and must be non-null. + // + Sampler ExperimentalComposableSampler `json:"sampler" yaml:"sampler" mapstructure:"sampler"` + + // The span kinds to match. If the span's kind matches any of these, it matches. + // Values include: + // * client: client, a client span. + // * consumer: consumer, a consumer span. + // * internal: internal, an internal span. + // * producer: producer, a producer span. + // * server: server, a server span. + // If omitted, ignore. + // + SpanKinds []SpanKind `json:"span_kinds,omitempty" yaml:"span_kinds,omitempty" mapstructure:"span_kinds,omitempty"` +} + +type ExperimentalComposableRuleBasedSamplerRuleAttributePatterns struct { + // Configure list of value patterns to exclude. Applies after .included (i.e. + // excluded has higher priority than included). + // Values are evaluated to match as follows: + // * If the value exactly matches. + // * If the value matches the wildcard pattern, where '?' matches any single + // character and '*' matches any number of characters including none. + // If omitted, .included attributes are included. + // + Excluded []string `json:"excluded,omitempty" yaml:"excluded,omitempty" mapstructure:"excluded,omitempty"` + + // Configure list of value patterns to include. + // Values are evaluated to match as follows: + // * If the value exactly matches. + // * If the value matches the wildcard pattern, where '?' matches any single + // character and '*' matches any number of characters including none. + // If omitted, all values are included. + // + Included []string `json:"included,omitempty" yaml:"included,omitempty" mapstructure:"included,omitempty"` + + // The attribute key to match against. + // Property is required and must be non-null. + // + Key string `json:"key" yaml:"key" mapstructure:"key"` +} + +type ExperimentalComposableRuleBasedSamplerRuleAttributeValues struct { + // The attribute key to match against. + // Property is required and must be non-null. + // + Key string `json:"key" yaml:"key" mapstructure:"key"` + + // The attribute values to match against. If the attribute's value matches any of + // these, it matches. + // Property is required and must be non-null. + // + Values []string `json:"values" yaml:"values" mapstructure:"values"` +} + +// The rules for the sampler, matched in order. If no rules match, the span is not +// sampled. +// If omitted or null, no span is sampled. +type ExperimentalComposableRuleBasedSamplerRules []ExperimentalComposableRuleBasedSamplerRule + +type ExperimentalComposableSampler struct { + // Configure sampler to be always_off. + // If omitted, ignore. + // + AlwaysOff ExperimentalComposableAlwaysOffSampler `json:"always_off,omitempty" yaml:"always_off,omitempty" mapstructure:"always_off,omitempty"` + + // Configure sampler to be always_on. + // If omitted, ignore. + // + AlwaysOn ExperimentalComposableAlwaysOnSampler `json:"always_on,omitempty" yaml:"always_on,omitempty" mapstructure:"always_on,omitempty"` + + // Configure sampler to be parent_threshold. + // If omitted, ignore. + // + ParentThreshold *ExperimentalComposableParentThresholdSampler `json:"parent_threshold,omitempty" yaml:"parent_threshold,omitempty" mapstructure:"parent_threshold,omitempty"` + + // Configure sampler to be probability. + // If omitted, ignore. + // + Probability *ExperimentalComposableProbabilitySampler `json:"probability,omitempty" yaml:"probability,omitempty" mapstructure:"probability,omitempty"` + + // Configure sampler to be rule_based. + // If omitted, ignore. + // + RuleBased *ExperimentalComposableRuleBasedSampler `json:"rule_based,omitempty" yaml:"rule_based,omitempty" mapstructure:"rule_based,omitempty"` + + AdditionalProperties interface{} `mapstructure:",remain"` +} + type ExperimentalContainerResourceDetector map[string]interface{} type ExperimentalGeneralInstrumentation struct { - // Http corresponds to the JSON schema field "http". + // Configure instrumentations following the http semantic conventions. + // See http semantic conventions: + // https://opentelemetry.io/docs/specs/semconv/http/ + // If omitted, defaults as described in ExperimentalHttpInstrumentation are used. + // Http *ExperimentalHttpInstrumentation `json:"http,omitempty" yaml:"http,omitempty" mapstructure:"http,omitempty"` - // Peer corresponds to the JSON schema field "peer". + // Configure instrumentations following the peer semantic conventions. + // See peer semantic conventions: + // https://opentelemetry.io/docs/specs/semconv/attributes-registry/peer/ + // If omitted, defaults as described in ExperimentalPeerInstrumentation are used. + // Peer *ExperimentalPeerInstrumentation `json:"peer,omitempty" yaml:"peer,omitempty" mapstructure:"peer,omitempty"` } type ExperimentalHostResourceDetector map[string]interface{} -type ExperimentalHttpInstrumentation struct { - // Client corresponds to the JSON schema field "client". - Client *ExperimentalHttpInstrumentationClient `json:"client,omitempty" yaml:"client,omitempty" mapstructure:"client,omitempty"` +type ExperimentalHttpClientInstrumentation struct { + // Configure headers to capture for outbound http requests. + // If omitted, no outbound request headers are captured. + // + RequestCapturedHeaders []string `json:"request_captured_headers,omitempty" yaml:"request_captured_headers,omitempty" mapstructure:"request_captured_headers,omitempty"` - // Server corresponds to the JSON schema field "server". - Server *ExperimentalHttpInstrumentationServer `json:"server,omitempty" yaml:"server,omitempty" mapstructure:"server,omitempty"` + // Configure headers to capture for inbound http responses. + // If omitted, no inbound response headers are captured. + // + ResponseCapturedHeaders []string `json:"response_captured_headers,omitempty" yaml:"response_captured_headers,omitempty" mapstructure:"response_captured_headers,omitempty"` } -type ExperimentalHttpInstrumentationClient struct { - // RequestCapturedHeaders corresponds to the JSON schema field - // "request_captured_headers". +type ExperimentalHttpInstrumentation struct { + // Configure instrumentations following the http client semantic conventions. + // If omitted, defaults as described in ExperimentalHttpClientInstrumentation are + // used. + // + Client *ExperimentalHttpClientInstrumentation `json:"client,omitempty" yaml:"client,omitempty" mapstructure:"client,omitempty"` + + // Configure instrumentations following the http server semantic conventions. + // If omitted, defaults as described in ExperimentalHttpServerInstrumentation are + // used. + // + Server *ExperimentalHttpServerInstrumentation `json:"server,omitempty" yaml:"server,omitempty" mapstructure:"server,omitempty"` +} + +type ExperimentalHttpServerInstrumentation struct { + // Configure headers to capture for inbound http requests. + // If omitted, no request headers are captured. + // RequestCapturedHeaders []string `json:"request_captured_headers,omitempty" yaml:"request_captured_headers,omitempty" mapstructure:"request_captured_headers,omitempty"` - // ResponseCapturedHeaders corresponds to the JSON schema field - // "response_captured_headers". + // Configure headers to capture for outbound http responses. + // If omitted, no response headers are captures. + // ResponseCapturedHeaders []string `json:"response_captured_headers,omitempty" yaml:"response_captured_headers,omitempty" mapstructure:"response_captured_headers,omitempty"` } -type ExperimentalHttpInstrumentationServer struct { - // RequestCapturedHeaders corresponds to the JSON schema field - // "request_captured_headers". - RequestCapturedHeaders []string `json:"request_captured_headers,omitempty" yaml:"request_captured_headers,omitempty" mapstructure:"request_captured_headers,omitempty"` +type ExperimentalInstrumentation struct { + // Configure C++ language-specific instrumentation libraries. + // If omitted, instrumentation defaults are used. + // + Cpp ExperimentalLanguageSpecificInstrumentation `json:"cpp,omitempty" yaml:"cpp,omitempty" mapstructure:"cpp,omitempty"` - // ResponseCapturedHeaders corresponds to the JSON schema field - // "response_captured_headers". - ResponseCapturedHeaders []string `json:"response_captured_headers,omitempty" yaml:"response_captured_headers,omitempty" mapstructure:"response_captured_headers,omitempty"` + // Configure .NET language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Dotnet ExperimentalLanguageSpecificInstrumentation `json:"dotnet,omitempty" yaml:"dotnet,omitempty" mapstructure:"dotnet,omitempty"` + + // Configure Erlang language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Erlang ExperimentalLanguageSpecificInstrumentation `json:"erlang,omitempty" yaml:"erlang,omitempty" mapstructure:"erlang,omitempty"` + + // Configure general SemConv options that may apply to multiple languages and + // instrumentations. + // Instrumenation may merge general config options with the language specific + // configuration at .instrumentation.. + // If omitted, default values as described in ExperimentalGeneralInstrumentation + // are used. + // + General *ExperimentalGeneralInstrumentation `json:"general,omitempty" yaml:"general,omitempty" mapstructure:"general,omitempty"` + + // Configure Go language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Go ExperimentalLanguageSpecificInstrumentation `json:"go,omitempty" yaml:"go,omitempty" mapstructure:"go,omitempty"` + + // Configure Java language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Java ExperimentalLanguageSpecificInstrumentation `json:"java,omitempty" yaml:"java,omitempty" mapstructure:"java,omitempty"` + + // Configure JavaScript language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Js ExperimentalLanguageSpecificInstrumentation `json:"js,omitempty" yaml:"js,omitempty" mapstructure:"js,omitempty"` + + // Configure PHP language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Php ExperimentalLanguageSpecificInstrumentation `json:"php,omitempty" yaml:"php,omitempty" mapstructure:"php,omitempty"` + + // Configure Python language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Python ExperimentalLanguageSpecificInstrumentation `json:"python,omitempty" yaml:"python,omitempty" mapstructure:"python,omitempty"` + + // Configure Ruby language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Ruby ExperimentalLanguageSpecificInstrumentation `json:"ruby,omitempty" yaml:"ruby,omitempty" mapstructure:"ruby,omitempty"` + + // Configure Rust language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Rust ExperimentalLanguageSpecificInstrumentation `json:"rust,omitempty" yaml:"rust,omitempty" mapstructure:"rust,omitempty"` + + // Configure Swift language-specific instrumentation libraries. + // Each entry's key identifies a particular instrumentation library. The + // corresponding value configures it. + // If omitted, instrumentation defaults are used. + // + Swift ExperimentalLanguageSpecificInstrumentation `json:"swift,omitempty" yaml:"swift,omitempty" mapstructure:"swift,omitempty"` } -type ExperimentalLanguageSpecificInstrumentation map[string]interface{} +type ExperimentalJaegerRemoteSampler struct { + // Configure the endpoint of the jaeger remote sampling service. + // Property is required and must be non-null. + // + Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"` -type ExperimentalLoggerConfig struct { - // Disabled corresponds to the JSON schema field "disabled". - Disabled *bool `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"` + // Configure the initial sampler used before first configuration is fetched. + // Property is required and must be non-null. + // + InitialSampler Sampler `json:"initial_sampler" yaml:"initial_sampler" mapstructure:"initial_sampler"` + + // Configure the polling interval (in milliseconds) to fetch from the remote + // sampling service. + // If omitted or null, 60000 is used. + // + Interval ExperimentalJaegerRemoteSamplerInterval `json:"interval,omitempty" yaml:"interval,omitempty" mapstructure:"interval,omitempty"` } +// Configure the polling interval (in milliseconds) to fetch from the remote +// sampling service. +// If omitted or null, 60000 is used. +type ExperimentalJaegerRemoteSamplerInterval *int + +type ExperimentalLanguageSpecificInstrumentation map[string]map[string]interface{} + +type ExperimentalLoggerConfig struct { + // Configure if the logger is enabled or not. + // If omitted or null, false is used. + // + Disabled ExperimentalLoggerConfigDisabled `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"` + + // Configure severity filtering. + // Log records with an non-zero (i.e. unspecified) severity number which is less + // than minimum_severity are not processed. + // Values include: + // * debug: debug, severity number 5. + // * debug2: debug2, severity number 6. + // * debug3: debug3, severity number 7. + // * debug4: debug4, severity number 8. + // * error: error, severity number 17. + // * error2: error2, severity number 18. + // * error3: error3, severity number 19. + // * error4: error4, severity number 20. + // * fatal: fatal, severity number 21. + // * fatal2: fatal2, severity number 22. + // * fatal3: fatal3, severity number 23. + // * fatal4: fatal4, severity number 24. + // * info: info, severity number 9. + // * info2: info2, severity number 10. + // * info3: info3, severity number 11. + // * info4: info4, severity number 12. + // * trace: trace, severity number 1. + // * trace2: trace2, severity number 2. + // * trace3: trace3, severity number 3. + // * trace4: trace4, severity number 4. + // * warn: warn, severity number 13. + // * warn2: warn2, severity number 14. + // * warn3: warn3, severity number 15. + // * warn4: warn4, severity number 16. + // If omitted, severity filtering is not applied. + // + MinimumSeverity *SeverityNumber `json:"minimum_severity,omitempty" yaml:"minimum_severity,omitempty" mapstructure:"minimum_severity,omitempty"` + + // Configure trace based filtering. + // If true, log records associated with unsampled trace contexts traces are not + // processed. If false, or if a log record is not associated with a trace context, + // trace based filtering is not applied. + // If omitted or null, trace based filtering is not applied. + // + TraceBased ExperimentalLoggerConfigTraceBased `json:"trace_based,omitempty" yaml:"trace_based,omitempty" mapstructure:"trace_based,omitempty"` +} + +// Configure if the logger is enabled or not. +// If omitted or null, false is used. +type ExperimentalLoggerConfigDisabled *bool + +// Configure trace based filtering. +// If true, log records associated with unsampled trace contexts traces are not +// processed. If false, or if a log record is not associated with a trace context, +// trace based filtering is not applied. +// If omitted or null, trace based filtering is not applied. +type ExperimentalLoggerConfigTraceBased *bool + type ExperimentalLoggerConfigurator struct { - // DefaultConfig corresponds to the JSON schema field "default_config". + // Configure the default logger config used there is no matching entry in + // .logger_configurator/development.loggers. + // If omitted, unmatched .loggers use default values as described in + // ExperimentalLoggerConfig. + // DefaultConfig *ExperimentalLoggerConfig `json:"default_config,omitempty" yaml:"default_config,omitempty" mapstructure:"default_config,omitempty"` - // Loggers corresponds to the JSON schema field "loggers". + // Configure loggers. + // If omitted, all loggers use .default_config. + // Loggers []ExperimentalLoggerMatcherAndConfig `json:"loggers,omitempty" yaml:"loggers,omitempty" mapstructure:"loggers,omitempty"` } type ExperimentalLoggerMatcherAndConfig struct { - // Config corresponds to the JSON schema field "config". - Config *ExperimentalLoggerConfig `json:"config,omitempty" yaml:"config,omitempty" mapstructure:"config,omitempty"` - - // Name corresponds to the JSON schema field "name". - Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` + // The logger config. + // Property is required and must be non-null. + // + Config ExperimentalLoggerConfig `json:"config" yaml:"config" mapstructure:"config"` + + // Configure logger names to match, evaluated as follows: + // + // * If the logger name exactly matches. + // * If the logger name matches the wildcard pattern, where '?' matches any + // single character and '*' matches any number of characters including none. + // Property is required and must be non-null. + // + Name string `json:"name" yaml:"name" mapstructure:"name"` } type ExperimentalMeterConfig struct { - // Disabled corresponds to the JSON schema field "disabled". + // Configure if the meter is enabled or not. + // If omitted, false is used. + // Disabled *bool `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"` } type ExperimentalMeterConfigurator struct { - // DefaultConfig corresponds to the JSON schema field "default_config". + // Configure the default meter config used there is no matching entry in + // .meter_configurator/development.meters. + // If omitted, unmatched .meters use default values as described in + // ExperimentalMeterConfig. + // DefaultConfig *ExperimentalMeterConfig `json:"default_config,omitempty" yaml:"default_config,omitempty" mapstructure:"default_config,omitempty"` - // Meters corresponds to the JSON schema field "meters". + // Configure meters. + // If omitted, all meters used .default_config. + // Meters []ExperimentalMeterMatcherAndConfig `json:"meters,omitempty" yaml:"meters,omitempty" mapstructure:"meters,omitempty"` } type ExperimentalMeterMatcherAndConfig struct { - // Config corresponds to the JSON schema field "config". - Config *ExperimentalMeterConfig `json:"config,omitempty" yaml:"config,omitempty" mapstructure:"config,omitempty"` - - // Name corresponds to the JSON schema field "name". - Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` + // The meter config. + // Property is required and must be non-null. + // + Config ExperimentalMeterConfig `json:"config" yaml:"config" mapstructure:"config"` + + // Configure meter names to match, evaluated as follows: + // + // * If the meter name exactly matches. + // * If the meter name matches the wildcard pattern, where '?' matches any single + // character and '*' matches any number of characters including none. + // Property is required and must be non-null. + // + Name string `json:"name" yaml:"name" mapstructure:"name"` } type ExperimentalOTLPFileExporter struct { - // OutputStream corresponds to the JSON schema field "output_stream". + // Configure output stream. + // Values include stdout, or scheme+destination. For example: + // file:///path/to/file.jsonl. + // If omitted or null, stdout is used. + // OutputStream ExperimentalOTLPFileExporterOutputStream `json:"output_stream,omitempty" yaml:"output_stream,omitempty" mapstructure:"output_stream,omitempty"` } +// Configure output stream. +// Values include stdout, or scheme+destination. For example: +// file:///path/to/file.jsonl. +// If omitted or null, stdout is used. type ExperimentalOTLPFileExporterOutputStream *string type ExperimentalOTLPFileMetricExporter struct { - // DefaultHistogramAggregation corresponds to the JSON schema field - // "default_histogram_aggregation". + // Configure default histogram aggregation. + // Values include: + // * base2_exponential_bucket_histogram: Use base2 exponential histogram as the + // default aggregation for histogram instruments. + // * explicit_bucket_histogram: Use explicit bucket histogram as the default + // aggregation for histogram instruments. + // If omitted, explicit_bucket_histogram is used. + // DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `json:"default_histogram_aggregation,omitempty" yaml:"default_histogram_aggregation,omitempty" mapstructure:"default_histogram_aggregation,omitempty"` - // OutputStream corresponds to the JSON schema field "output_stream". + // Configure output stream. + // Values include stdout, or scheme+destination. For example: + // file:///path/to/file.jsonl. + // If omitted or null, stdout is used. + // OutputStream ExperimentalOTLPFileMetricExporterOutputStream `json:"output_stream,omitempty" yaml:"output_stream,omitempty" mapstructure:"output_stream,omitempty"` - // TemporalityPreference corresponds to the JSON schema field - // "temporality_preference". + // Configure temporality preference. + // Values include: + // * cumulative: Use cumulative aggregation temporality for all instrument types. + // * delta: Use delta aggregation for all instrument types except up down counter + // and asynchronous up down counter. + // * low_memory: Use delta aggregation temporality for counter and histogram + // instrument types. Use cumulative aggregation temporality for all other + // instrument types. + // If omitted, cumulative is used. + // TemporalityPreference *ExporterTemporalityPreference `json:"temporality_preference,omitempty" yaml:"temporality_preference,omitempty" mapstructure:"temporality_preference,omitempty"` } +// Configure output stream. +// Values include stdout, or scheme+destination. For example: +// file:///path/to/file.jsonl. +// If omitted or null, stdout is used. type ExperimentalOTLPFileMetricExporterOutputStream *string type ExperimentalPeerInstrumentation struct { - // ServiceMapping corresponds to the JSON schema field "service_mapping". - ServiceMapping []ExperimentalPeerInstrumentationServiceMappingElem `json:"service_mapping,omitempty" yaml:"service_mapping,omitempty" mapstructure:"service_mapping,omitempty"` -} - -type ExperimentalPeerInstrumentationServiceMappingElem struct { - // Peer corresponds to the JSON schema field "peer". + // Configure the service mapping for instrumentations following peer.service + // semantic conventions. + // See peer.service semantic conventions: + // https://opentelemetry.io/docs/specs/semconv/general/attributes/#general-remote-service-attributes + // If omitted, no peer service mappings are used. + // + ServiceMapping []ExperimentalPeerServiceMapping `json:"service_mapping,omitempty" yaml:"service_mapping,omitempty" mapstructure:"service_mapping,omitempty"` +} + +type ExperimentalPeerServiceMapping struct { + // The IP address to map. + // Property is required and must be non-null. + // Peer string `json:"peer" yaml:"peer" mapstructure:"peer"` - // Service corresponds to the JSON schema field "service". + // The logical name corresponding to the IP address of .peer. + // Property is required and must be non-null. + // Service string `json:"service" yaml:"service" mapstructure:"service"` } +type ExperimentalProbabilitySampler struct { + // Configure ratio. + // If omitted or null, 1.0 is used. + // + Ratio ExperimentalProbabilitySamplerRatio `json:"ratio,omitempty" yaml:"ratio,omitempty" mapstructure:"ratio,omitempty"` +} + +// Configure ratio. +// If omitted or null, 1.0 is used. +type ExperimentalProbabilitySamplerRatio *float64 + type ExperimentalProcessResourceDetector map[string]interface{} type ExperimentalPrometheusMetricExporter struct { - // Host corresponds to the JSON schema field "host". + // Configure host. + // If omitted or null, localhost is used. + // Host ExperimentalPrometheusMetricExporterHost `json:"host,omitempty" yaml:"host,omitempty" mapstructure:"host,omitempty"` - // Port corresponds to the JSON schema field "port". + // Configure port. + // If omitted or null, 9464 is used. + // Port ExperimentalPrometheusMetricExporterPort `json:"port,omitempty" yaml:"port,omitempty" mapstructure:"port,omitempty"` - // TranslationStrategy corresponds to the JSON schema field - // "translation_strategy". - TranslationStrategy *ExperimentalPrometheusMetricExporterTranslationStrategy `json:"translation_strategy,omitempty" yaml:"translation_strategy,omitempty" mapstructure:"translation_strategy,omitempty"` - - // WithResourceConstantLabels corresponds to the JSON schema field - // "with_resource_constant_labels". + // Configure how metric names are translated to Prometheus metric names. + // Values include: + // * no_translation: Special character escaping is disabled. Type and unit + // suffixes are disabled. Metric names are unaltered. + // * no_utf8_escaping_with_suffixes: Special character escaping is disabled. Type + // and unit suffixes are enabled. + // * underscore_escaping_with_suffixes: Special character escaping is enabled. + // Type and unit suffixes are enabled. + // * underscore_escaping_without_suffixes: Special character escaping is enabled. + // Type and unit suffixes are disabled. This represents classic Prometheus metric + // name compatibility. + // If omitted, underscore_escaping_with_suffixes is used. + // + TranslationStrategy *ExperimentalPrometheusTranslationStrategy `json:"translation_strategy,omitempty" yaml:"translation_strategy,omitempty" mapstructure:"translation_strategy,omitempty"` + + // Configure Prometheus Exporter to add resource attributes as metrics attributes, + // where the resource attribute keys match the patterns. + // If omitted, no resource attributes are added. + // WithResourceConstantLabels *IncludeExclude `json:"with_resource_constant_labels,omitempty" yaml:"with_resource_constant_labels,omitempty" mapstructure:"with_resource_constant_labels,omitempty"` - // WithoutScopeInfo corresponds to the JSON schema field "without_scope_info". + // Configure Prometheus Exporter to produce metrics without a scope info metric. + // If omitted or null, false is used. + // WithoutScopeInfo ExperimentalPrometheusMetricExporterWithoutScopeInfo `json:"without_scope_info,omitempty" yaml:"without_scope_info,omitempty" mapstructure:"without_scope_info,omitempty"` + + // Configure Prometheus Exporter to produce metrics without a target info metric + // for the resource. + // If omitted or null, false is used. + // + WithoutTargetInfo ExperimentalPrometheusMetricExporterWithoutTargetInfo `json:"without_target_info,omitempty" yaml:"without_target_info,omitempty" mapstructure:"without_target_info,omitempty"` } +// Configure host. +// If omitted or null, localhost is used. type ExperimentalPrometheusMetricExporterHost *string +// Configure port. +// If omitted or null, 9464 is used. type ExperimentalPrometheusMetricExporterPort *int -type ExperimentalPrometheusMetricExporterTranslationStrategy string +// Configure Prometheus Exporter to produce metrics without a scope info metric. +// If omitted or null, false is used. +type ExperimentalPrometheusMetricExporterWithoutScopeInfo *bool -const ExperimentalPrometheusMetricExporterTranslationStrategyNoTranslation ExperimentalPrometheusMetricExporterTranslationStrategy = "NoTranslation" -const ExperimentalPrometheusMetricExporterTranslationStrategyNoUTF8EscapingWithSuffixes ExperimentalPrometheusMetricExporterTranslationStrategy = "NoUTF8EscapingWithSuffixes" -const ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithSuffixes ExperimentalPrometheusMetricExporterTranslationStrategy = "UnderscoreEscapingWithSuffixes" -const ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithoutSuffixes ExperimentalPrometheusMetricExporterTranslationStrategy = "UnderscoreEscapingWithoutSuffixes" +// Configure Prometheus Exporter to produce metrics without a target info metric +// for the resource. +// If omitted or null, false is used. +type ExperimentalPrometheusMetricExporterWithoutTargetInfo *bool -type ExperimentalPrometheusMetricExporterWithoutScopeInfo *bool +type ExperimentalPrometheusTranslationStrategy string + +const ExperimentalPrometheusTranslationStrategyNoTranslation ExperimentalPrometheusTranslationStrategy = "no_translation" +const ExperimentalPrometheusTranslationStrategyNoUtf8EscapingWithSuffixes ExperimentalPrometheusTranslationStrategy = "no_utf8_escaping_with_suffixes" +const ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithSuffixes ExperimentalPrometheusTranslationStrategy = "underscore_escaping_with_suffixes" +const ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithoutSuffixes ExperimentalPrometheusTranslationStrategy = "underscore_escaping_without_suffixes" type ExperimentalResourceDetection struct { - // Attributes corresponds to the JSON schema field "attributes". + // Configure attributes provided by resource detectors. + // If omitted, all attributes from resource detectors are added. + // Attributes *IncludeExclude `json:"attributes,omitempty" yaml:"attributes,omitempty" mapstructure:"attributes,omitempty"` - // Detectors corresponds to the JSON schema field "detectors". + // Configure resource detectors. + // Resource detector names are dependent on the SDK language ecosystem. Please + // consult documentation for each respective language. + // If omitted, no resource detectors are enabled. + // Detectors []ExperimentalResourceDetector `json:"detectors,omitempty" yaml:"detectors,omitempty" mapstructure:"detectors,omitempty"` } type ExperimentalResourceDetector struct { - // Container corresponds to the JSON schema field "container". + // Enable the container resource detector, which populates container.* attributes. + // If omitted, ignore. + // Container ExperimentalContainerResourceDetector `json:"container,omitempty" yaml:"container,omitempty" mapstructure:"container,omitempty"` - // Host corresponds to the JSON schema field "host". + // Enable the host resource detector, which populates host.* and os.* attributes. + // If omitted, ignore. + // Host ExperimentalHostResourceDetector `json:"host,omitempty" yaml:"host,omitempty" mapstructure:"host,omitempty"` - // Process corresponds to the JSON schema field "process". + // Enable the process resource detector, which populates process.* attributes. + // If omitted, ignore. + // Process ExperimentalProcessResourceDetector `json:"process,omitempty" yaml:"process,omitempty" mapstructure:"process,omitempty"` - // Service corresponds to the JSON schema field "service". + // Enable the service detector, which populates service.name based on the + // OTEL_SERVICE_NAME environment variable and service.instance.id. + // If omitted, ignore. + // Service ExperimentalServiceResourceDetector `json:"service,omitempty" yaml:"service,omitempty" mapstructure:"service,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` @@ -368,35 +1002,64 @@ type ExperimentalResourceDetector struct { type ExperimentalServiceResourceDetector map[string]interface{} +type ExperimentalSpanParent string + +const ExperimentalSpanParentLocal ExperimentalSpanParent = "local" +const ExperimentalSpanParentNone ExperimentalSpanParent = "none" +const ExperimentalSpanParentRemote ExperimentalSpanParent = "remote" + type ExperimentalTracerConfig struct { - // Disabled corresponds to the JSON schema field "disabled". + // Configure if the tracer is enabled or not. + // If omitted, false is used. + // Disabled *bool `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"` } type ExperimentalTracerConfigurator struct { - // DefaultConfig corresponds to the JSON schema field "default_config". + // Configure the default tracer config used there is no matching entry in + // .tracer_configurator/development.tracers. + // If omitted, unmatched .tracers use default values as described in + // ExperimentalTracerConfig. + // DefaultConfig *ExperimentalTracerConfig `json:"default_config,omitempty" yaml:"default_config,omitempty" mapstructure:"default_config,omitempty"` - // Tracers corresponds to the JSON schema field "tracers". + // Configure tracers. + // If omitted, all tracers use .default_config. + // Tracers []ExperimentalTracerMatcherAndConfig `json:"tracers,omitempty" yaml:"tracers,omitempty" mapstructure:"tracers,omitempty"` } type ExperimentalTracerMatcherAndConfig struct { - // Config corresponds to the JSON schema field "config". - Config *ExperimentalTracerConfig `json:"config,omitempty" yaml:"config,omitempty" mapstructure:"config,omitempty"` - - // Name corresponds to the JSON schema field "name". - Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` + // The tracer config. + // Property is required and must be non-null. + // + Config ExperimentalTracerConfig `json:"config" yaml:"config" mapstructure:"config"` + + // Configure tracer names to match, evaluated as follows: + // + // * If the tracer name exactly matches. + // * If the tracer name matches the wildcard pattern, where '?' matches any + // single character and '*' matches any number of characters including none. + // Property is required and must be non-null. + // + Name string `json:"name" yaml:"name" mapstructure:"name"` } type ExplicitBucketHistogramAggregation struct { - // Boundaries corresponds to the JSON schema field "boundaries". + // Configure bucket boundaries. + // If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, + // 10000] is used. + // Boundaries []float64 `json:"boundaries,omitempty" yaml:"boundaries,omitempty" mapstructure:"boundaries,omitempty"` - // RecordMinMax corresponds to the JSON schema field "record_min_max". + // Configure record min and max. + // If omitted or null, true is used. + // RecordMinMax ExplicitBucketHistogramAggregationRecordMinMax `json:"record_min_max,omitempty" yaml:"record_min_max,omitempty" mapstructure:"record_min_max,omitempty"` } +// Configure record min and max. +// If omitted or null, true is used. type ExplicitBucketHistogramAggregationRecordMinMax *bool type ExporterDefaultHistogramAggregation string @@ -410,11 +1073,119 @@ const ExporterTemporalityPreferenceCumulative ExporterTemporalityPreference = "c const ExporterTemporalityPreferenceDelta ExporterTemporalityPreference = "delta" const ExporterTemporalityPreferenceLowMemory ExporterTemporalityPreference = "low_memory" +type GrpcTls struct { + // Configure certificate used to verify a server's TLS credentials. + // Absolute path to certificate file in PEM format. + // If omitted or null, system default certificate verification is used for secure + // connections. + // + CaFile GrpcTlsCaFile `json:"ca_file,omitempty" yaml:"ca_file,omitempty" mapstructure:"ca_file,omitempty"` + + // Configure mTLS client certificate. + // Absolute path to client certificate file in PEM format. If set, .client_key + // must also be set. + // If omitted or null, mTLS is not used. + // + CertFile GrpcTlsCertFile `json:"cert_file,omitempty" yaml:"cert_file,omitempty" mapstructure:"cert_file,omitempty"` + + // Configure client transport security for the exporter's connection. + // Only applicable when .endpoint is provided without http or https scheme. + // Implementations may choose to ignore .insecure. + // If omitted or null, false is used. + // + Insecure GrpcTlsInsecure `json:"insecure,omitempty" yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"` + + // Configure mTLS private client key. + // Absolute path to client key file in PEM format. If set, .client_certificate + // must also be set. + // If omitted or null, mTLS is not used. + // + KeyFile GrpcTlsKeyFile `json:"key_file,omitempty" yaml:"key_file,omitempty" mapstructure:"key_file,omitempty"` +} + +// Configure certificate used to verify a server's TLS credentials. +// Absolute path to certificate file in PEM format. +// If omitted or null, system default certificate verification is used for secure +// connections. +type GrpcTlsCaFile *string + +// Configure mTLS client certificate. +// Absolute path to client certificate file in PEM format. If set, .client_key must +// also be set. +// If omitted or null, mTLS is not used. +type GrpcTlsCertFile *string + +// Configure client transport security for the exporter's connection. +// Only applicable when .endpoint is provided without http or https scheme. +// Implementations may choose to ignore .insecure. +// If omitted or null, false is used. +type GrpcTlsInsecure *bool + +// Configure mTLS private client key. +// Absolute path to client key file in PEM format. If set, .client_certificate must +// also be set. +// If omitted or null, mTLS is not used. +type GrpcTlsKeyFile *string + +type HttpTls struct { + // Configure certificate used to verify a server's TLS credentials. + // Absolute path to certificate file in PEM format. + // If omitted or null, system default certificate verification is used for secure + // connections. + // + CaFile HttpTlsCaFile `json:"ca_file,omitempty" yaml:"ca_file,omitempty" mapstructure:"ca_file,omitempty"` + + // Configure mTLS client certificate. + // Absolute path to client certificate file in PEM format. If set, .client_key + // must also be set. + // If omitted or null, mTLS is not used. + // + CertFile HttpTlsCertFile `json:"cert_file,omitempty" yaml:"cert_file,omitempty" mapstructure:"cert_file,omitempty"` + + // Configure mTLS private client key. + // Absolute path to client key file in PEM format. If set, .client_certificate + // must also be set. + // If omitted or null, mTLS is not used. + // + KeyFile HttpTlsKeyFile `json:"key_file,omitempty" yaml:"key_file,omitempty" mapstructure:"key_file,omitempty"` +} + +// Configure certificate used to verify a server's TLS credentials. +// Absolute path to certificate file in PEM format. +// If omitted or null, system default certificate verification is used for secure +// connections. +type HttpTlsCaFile *string + +// Configure mTLS client certificate. +// Absolute path to client certificate file in PEM format. If set, .client_key must +// also be set. +// If omitted or null, mTLS is not used. +type HttpTlsCertFile *string + +// Configure mTLS private client key. +// Absolute path to client key file in PEM format. If set, .client_certificate must +// also be set. +// If omitted or null, mTLS is not used. +type HttpTlsKeyFile *string + type IncludeExclude struct { - // Excluded corresponds to the JSON schema field "excluded". + // Configure list of value patterns to exclude. Applies after .included (i.e. + // excluded has higher priority than included). + // Values are evaluated to match as follows: + // * If the value exactly matches. + // * If the value matches the wildcard pattern, where '?' matches any single + // character and '*' matches any number of characters including none. + // If omitted, .included attributes are included. + // Excluded []string `json:"excluded,omitempty" yaml:"excluded,omitempty" mapstructure:"excluded,omitempty"` - // Included corresponds to the JSON schema field "included". + // Configure list of value patterns to include. + // Values are evaluated to match as follows: + // * If the value exactly matches. + // * If the value matches the wildcard pattern, where '?' matches any single + // character and '*' matches any number of characters including none. + // If omitted, all values are included. + // Included []string `json:"included,omitempty" yaml:"included,omitempty" mapstructure:"included,omitempty"` } @@ -428,254 +1199,313 @@ const InstrumentTypeObservableGauge InstrumentType = "observable_gauge" const InstrumentTypeObservableUpDownCounter InstrumentType = "observable_up_down_counter" const InstrumentTypeUpDownCounter InstrumentType = "up_down_counter" -type InstrumentationJson struct { - // Cpp corresponds to the JSON schema field "cpp". - Cpp ExperimentalLanguageSpecificInstrumentation `json:"cpp,omitempty" yaml:"cpp,omitempty" mapstructure:"cpp,omitempty"` - - // Dotnet corresponds to the JSON schema field "dotnet". - Dotnet ExperimentalLanguageSpecificInstrumentation `json:"dotnet,omitempty" yaml:"dotnet,omitempty" mapstructure:"dotnet,omitempty"` - - // Erlang corresponds to the JSON schema field "erlang". - Erlang ExperimentalLanguageSpecificInstrumentation `json:"erlang,omitempty" yaml:"erlang,omitempty" mapstructure:"erlang,omitempty"` - - // General corresponds to the JSON schema field "general". - General *ExperimentalGeneralInstrumentation `json:"general,omitempty" yaml:"general,omitempty" mapstructure:"general,omitempty"` - - // Go corresponds to the JSON schema field "go". - Go ExperimentalLanguageSpecificInstrumentation `json:"go,omitempty" yaml:"go,omitempty" mapstructure:"go,omitempty"` - - // Java corresponds to the JSON schema field "java". - Java ExperimentalLanguageSpecificInstrumentation `json:"java,omitempty" yaml:"java,omitempty" mapstructure:"java,omitempty"` - - // Js corresponds to the JSON schema field "js". - Js ExperimentalLanguageSpecificInstrumentation `json:"js,omitempty" yaml:"js,omitempty" mapstructure:"js,omitempty"` - - // Php corresponds to the JSON schema field "php". - Php ExperimentalLanguageSpecificInstrumentation `json:"php,omitempty" yaml:"php,omitempty" mapstructure:"php,omitempty"` - - // Python corresponds to the JSON schema field "python". - Python ExperimentalLanguageSpecificInstrumentation `json:"python,omitempty" yaml:"python,omitempty" mapstructure:"python,omitempty"` - - // Ruby corresponds to the JSON schema field "ruby". - Ruby ExperimentalLanguageSpecificInstrumentation `json:"ruby,omitempty" yaml:"ruby,omitempty" mapstructure:"ruby,omitempty"` - - // Rust corresponds to the JSON schema field "rust". - Rust ExperimentalLanguageSpecificInstrumentation `json:"rust,omitempty" yaml:"rust,omitempty" mapstructure:"rust,omitempty"` - - // Swift corresponds to the JSON schema field "swift". - Swift ExperimentalLanguageSpecificInstrumentation `json:"swift,omitempty" yaml:"swift,omitempty" mapstructure:"swift,omitempty"` -} - type JaegerPropagator map[string]interface{} -type JaegerRemoteSampler struct { - // Endpoint corresponds to the JSON schema field "endpoint". - Endpoint JaegerRemoteSamplerEndpoint `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` - - // InitialSampler corresponds to the JSON schema field "initial_sampler". - InitialSampler *Sampler `json:"initial_sampler,omitempty" yaml:"initial_sampler,omitempty" mapstructure:"initial_sampler,omitempty"` - - // Interval corresponds to the JSON schema field "interval". - Interval JaegerRemoteSamplerInterval `json:"interval,omitempty" yaml:"interval,omitempty" mapstructure:"interval,omitempty"` -} - -type JaegerRemoteSamplerEndpoint *string - -type JaegerRemoteSamplerInterval *int - type LastValueAggregation map[string]interface{} type LogRecordExporter struct { - // Console corresponds to the JSON schema field "console". + // Configure exporter to be console. + // If omitted, ignore. + // Console ConsoleExporter `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` - // OTLPFileDevelopment corresponds to the JSON schema field - // "otlp_file/development". + // Configure exporter to be OTLP with file transport. + // If omitted, ignore. + // OTLPFileDevelopment *ExperimentalOTLPFileExporter `json:"otlp_file/development,omitempty" yaml:"otlp_file/development,omitempty" mapstructure:"otlp_file/development,omitempty"` - // OTLPGrpc corresponds to the JSON schema field "otlp_grpc". + // Configure exporter to be OTLP with gRPC transport. + // If omitted, ignore. + // OTLPGrpc *OTLPGrpcExporter `json:"otlp_grpc,omitempty" yaml:"otlp_grpc,omitempty" mapstructure:"otlp_grpc,omitempty"` - // OTLPHttp corresponds to the JSON schema field "otlp_http". + // Configure exporter to be OTLP with HTTP transport. + // If omitted, ignore. + // OTLPHttp *OTLPHttpExporter `json:"otlp_http,omitempty" yaml:"otlp_http,omitempty" mapstructure:"otlp_http,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } type LogRecordLimits struct { - // AttributeCountLimit corresponds to the JSON schema field - // "attribute_count_limit". + // Configure max attribute count. Overrides + // .attribute_limits.attribute_count_limit. + // Value must be non-negative. + // If omitted or null, 128 is used. + // AttributeCountLimit LogRecordLimitsAttributeCountLimit `json:"attribute_count_limit,omitempty" yaml:"attribute_count_limit,omitempty" mapstructure:"attribute_count_limit,omitempty"` - // AttributeValueLengthLimit corresponds to the JSON schema field - // "attribute_value_length_limit". + // Configure max attribute value size. Overrides + // .attribute_limits.attribute_value_length_limit. + // Value must be non-negative. + // If omitted or null, there is no limit. + // AttributeValueLengthLimit LogRecordLimitsAttributeValueLengthLimit `json:"attribute_value_length_limit,omitempty" yaml:"attribute_value_length_limit,omitempty" mapstructure:"attribute_value_length_limit,omitempty"` } +// Configure max attribute count. Overrides +// .attribute_limits.attribute_count_limit. +// Value must be non-negative. +// If omitted or null, 128 is used. type LogRecordLimitsAttributeCountLimit *int +// Configure max attribute value size. Overrides +// .attribute_limits.attribute_value_length_limit. +// Value must be non-negative. +// If omitted or null, there is no limit. type LogRecordLimitsAttributeValueLengthLimit *int type LogRecordProcessor struct { - // Batch corresponds to the JSON schema field "batch". + // Configure a batch log record processor. + // If omitted, ignore. + // Batch *BatchLogRecordProcessor `json:"batch,omitempty" yaml:"batch,omitempty" mapstructure:"batch,omitempty"` - // Simple corresponds to the JSON schema field "simple". + // Configure a simple log record processor. + // If omitted, ignore. + // Simple *SimpleLogRecordProcessor `json:"simple,omitempty" yaml:"simple,omitempty" mapstructure:"simple,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } -type LoggerProviderJson struct { - // Limits corresponds to the JSON schema field "limits". +type LoggerProvider struct { + // Configure log record limits. See also attribute_limits. + // If omitted, default values as described in LogRecordLimits are used. + // Limits *LogRecordLimits `json:"limits,omitempty" yaml:"limits,omitempty" mapstructure:"limits,omitempty"` - // LoggerConfiguratorDevelopment corresponds to the JSON schema field - // "logger_configurator/development". + // Configure loggers. + // If omitted, all loggers use default values as described in + // ExperimentalLoggerConfig. + // LoggerConfiguratorDevelopment *ExperimentalLoggerConfigurator `json:"logger_configurator/development,omitempty" yaml:"logger_configurator/development,omitempty" mapstructure:"logger_configurator/development,omitempty"` - // Processors corresponds to the JSON schema field "processors". + // Configure log record processors. + // Property is required and must be non-null. + // Processors []LogRecordProcessor `json:"processors" yaml:"processors" mapstructure:"processors"` } -type MeterProviderJson struct { - // ExemplarFilter corresponds to the JSON schema field "exemplar_filter". +type MeterProvider struct { + // Configure the exemplar filter. + // Values include: + // * always_off: ExemplarFilter which makes no measurements eligible for being an + // Exemplar. + // * always_on: ExemplarFilter which makes all measurements eligible for being an + // Exemplar. + // * trace_based: ExemplarFilter which makes measurements recorded in the context + // of a sampled parent span eligible for being an Exemplar. + // If omitted, trace_based is used. + // ExemplarFilter *ExemplarFilter `json:"exemplar_filter,omitempty" yaml:"exemplar_filter,omitempty" mapstructure:"exemplar_filter,omitempty"` - // MeterConfiguratorDevelopment corresponds to the JSON schema field - // "meter_configurator/development". + // Configure meters. + // If omitted, all meters use default values as described in + // ExperimentalMeterConfig. + // MeterConfiguratorDevelopment *ExperimentalMeterConfigurator `json:"meter_configurator/development,omitempty" yaml:"meter_configurator/development,omitempty" mapstructure:"meter_configurator/development,omitempty"` - // Readers corresponds to the JSON schema field "readers". + // Configure metric readers. + // Property is required and must be non-null. + // Readers []MetricReader `json:"readers" yaml:"readers" mapstructure:"readers"` - // Views corresponds to the JSON schema field "views". + // Configure views. + // Each view has a selector which determines the instrument(s) it applies to, and + // a configuration for the resulting stream(s). + // If omitted, no views are registered. + // Views []View `json:"views,omitempty" yaml:"views,omitempty" mapstructure:"views,omitempty"` } type MetricProducer struct { - // Opencensus corresponds to the JSON schema field "opencensus". + // Configure metric producer to be opencensus. + // If omitted, ignore. + // Opencensus OpenCensusMetricProducer `json:"opencensus,omitempty" yaml:"opencensus,omitempty" mapstructure:"opencensus,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } type MetricReader struct { - // Periodic corresponds to the JSON schema field "periodic". + // Configure a periodic metric reader. + // If omitted, ignore. + // Periodic *PeriodicMetricReader `json:"periodic,omitempty" yaml:"periodic,omitempty" mapstructure:"periodic,omitempty"` - // Pull corresponds to the JSON schema field "pull". + // Configure a pull based metric reader. + // If omitted, ignore. + // Pull *PullMetricReader `json:"pull,omitempty" yaml:"pull,omitempty" mapstructure:"pull,omitempty"` } type NameStringValuePair struct { - // Name corresponds to the JSON schema field "name". + // The name of the pair. + // Property is required and must be non-null. + // Name string `json:"name" yaml:"name" mapstructure:"name"` - // Value corresponds to the JSON schema field "value". + // The value of the pair. + // Property must be present, but if null the behavior is dependent on usage + // context. + // Value NameStringValuePairValue `json:"value" yaml:"value" mapstructure:"value"` } +// The value of the pair. +// Property must be present, but if null the behavior is dependent on usage +// context. type NameStringValuePairValue *string type OTLPGrpcExporter struct { - // CertificateFile corresponds to the JSON schema field "certificate_file". - CertificateFile OTLPGrpcExporterCertificateFile `json:"certificate_file,omitempty" yaml:"certificate_file,omitempty" mapstructure:"certificate_file,omitempty"` - - // ClientCertificateFile corresponds to the JSON schema field - // "client_certificate_file". - ClientCertificateFile OTLPGrpcExporterClientCertificateFile `json:"client_certificate_file,omitempty" yaml:"client_certificate_file,omitempty" mapstructure:"client_certificate_file,omitempty"` - - // ClientKeyFile corresponds to the JSON schema field "client_key_file". - ClientKeyFile OTLPGrpcExporterClientKeyFile `json:"client_key_file,omitempty" yaml:"client_key_file,omitempty" mapstructure:"client_key_file,omitempty"` - - // Compression corresponds to the JSON schema field "compression". + // Configure compression. + // Known values include: gzip, none. Implementations may support other compression + // algorithms. + // If omitted or null, none is used. + // Compression OTLPGrpcExporterCompression `json:"compression,omitempty" yaml:"compression,omitempty" mapstructure:"compression,omitempty"` - // Endpoint corresponds to the JSON schema field "endpoint". + // Configure endpoint. + // If omitted or null, http://localhost:4317 is used. + // Endpoint OTLPGrpcExporterEndpoint `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` - // Headers corresponds to the JSON schema field "headers". + // Configure headers. Entries have higher priority than entries from + // .headers_list. + // If an entry's .value is null, the entry is ignored. + // If omitted, no headers are added. + // Headers []NameStringValuePair `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers,omitempty"` - // HeadersList corresponds to the JSON schema field "headers_list". + // Configure headers. Entries have lower priority than entries from .headers. + // The value is a list of comma separated key-value pairs matching the format of + // OTEL_EXPORTER_OTLP_HEADERS. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options + // for details. + // If omitted or null, no headers are added. + // HeadersList OTLPGrpcExporterHeadersList `json:"headers_list,omitempty" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"` - // Insecure corresponds to the JSON schema field "insecure". - Insecure OTLPGrpcExporterInsecure `json:"insecure,omitempty" yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"` - - // Timeout corresponds to the JSON schema field "timeout". + // Configure max time (in milliseconds) to wait for each export. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 10000 is used. + // Timeout OTLPGrpcExporterTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` -} - -type OTLPGrpcExporterCertificateFile *string -type OTLPGrpcExporterClientCertificateFile *string - -type OTLPGrpcExporterClientKeyFile *string + // Configure TLS settings for the exporter. + // If omitted, system default TLS settings are used. + // + Tls *GrpcTls `json:"tls,omitempty" yaml:"tls,omitempty" mapstructure:"tls,omitempty"` +} +// Configure compression. +// Known values include: gzip, none. Implementations may support other compression +// algorithms. +// If omitted or null, none is used. type OTLPGrpcExporterCompression *string +// Configure endpoint. +// If omitted or null, http://localhost:4317 is used. type OTLPGrpcExporterEndpoint *string +// Configure headers. Entries have lower priority than entries from .headers. +// The value is a list of comma separated key-value pairs matching the format of +// OTEL_EXPORTER_OTLP_HEADERS. See +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options +// for details. +// If omitted or null, no headers are added. type OTLPGrpcExporterHeadersList *string -type OTLPGrpcExporterInsecure *bool - +// Configure max time (in milliseconds) to wait for each export. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 10000 is used. type OTLPGrpcExporterTimeout *int type OTLPGrpcMetricExporter struct { - // CertificateFile corresponds to the JSON schema field "certificate_file". - CertificateFile OTLPGrpcMetricExporterCertificateFile `json:"certificate_file,omitempty" yaml:"certificate_file,omitempty" mapstructure:"certificate_file,omitempty"` - - // ClientCertificateFile corresponds to the JSON schema field - // "client_certificate_file". - ClientCertificateFile OTLPGrpcMetricExporterClientCertificateFile `json:"client_certificate_file,omitempty" yaml:"client_certificate_file,omitempty" mapstructure:"client_certificate_file,omitempty"` - - // ClientKeyFile corresponds to the JSON schema field "client_key_file". - ClientKeyFile OTLPGrpcMetricExporterClientKeyFile `json:"client_key_file,omitempty" yaml:"client_key_file,omitempty" mapstructure:"client_key_file,omitempty"` - - // Compression corresponds to the JSON schema field "compression". + // Configure compression. + // Known values include: gzip, none. Implementations may support other compression + // algorithms. + // If omitted or null, none is used. + // Compression OTLPGrpcMetricExporterCompression `json:"compression,omitempty" yaml:"compression,omitempty" mapstructure:"compression,omitempty"` - // DefaultHistogramAggregation corresponds to the JSON schema field - // "default_histogram_aggregation". + // Configure default histogram aggregation. + // Values include: + // * base2_exponential_bucket_histogram: Use base2 exponential histogram as the + // default aggregation for histogram instruments. + // * explicit_bucket_histogram: Use explicit bucket histogram as the default + // aggregation for histogram instruments. + // If omitted, explicit_bucket_histogram is used. + // DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `json:"default_histogram_aggregation,omitempty" yaml:"default_histogram_aggregation,omitempty" mapstructure:"default_histogram_aggregation,omitempty"` - // Endpoint corresponds to the JSON schema field "endpoint". + // Configure endpoint. + // If omitted or null, http://localhost:4317 is used. + // Endpoint OTLPGrpcMetricExporterEndpoint `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` - // Headers corresponds to the JSON schema field "headers". + // Configure headers. Entries have higher priority than entries from + // .headers_list. + // If an entry's .value is null, the entry is ignored. + // If omitted, no headers are added. + // Headers []NameStringValuePair `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers,omitempty"` - // HeadersList corresponds to the JSON schema field "headers_list". + // Configure headers. Entries have lower priority than entries from .headers. + // The value is a list of comma separated key-value pairs matching the format of + // OTEL_EXPORTER_OTLP_HEADERS. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options + // for details. + // If omitted or null, no headers are added. + // HeadersList OTLPGrpcMetricExporterHeadersList `json:"headers_list,omitempty" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"` - // Insecure corresponds to the JSON schema field "insecure". - Insecure OTLPGrpcMetricExporterInsecure `json:"insecure,omitempty" yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"` - - // TemporalityPreference corresponds to the JSON schema field - // "temporality_preference". + // Configure temporality preference. + // Values include: + // * cumulative: Use cumulative aggregation temporality for all instrument types. + // * delta: Use delta aggregation for all instrument types except up down counter + // and asynchronous up down counter. + // * low_memory: Use delta aggregation temporality for counter and histogram + // instrument types. Use cumulative aggregation temporality for all other + // instrument types. + // If omitted, cumulative is used. + // TemporalityPreference *ExporterTemporalityPreference `json:"temporality_preference,omitempty" yaml:"temporality_preference,omitempty" mapstructure:"temporality_preference,omitempty"` - // Timeout corresponds to the JSON schema field "timeout". + // Configure max time (in milliseconds) to wait for each export. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 10000 is used. + // Timeout OTLPGrpcMetricExporterTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` -} - -type OTLPGrpcMetricExporterCertificateFile *string - -type OTLPGrpcMetricExporterClientCertificateFile *string -type OTLPGrpcMetricExporterClientKeyFile *string + // Configure TLS settings for the exporter. + // If omitted, system default TLS settings are used. + // + Tls *GrpcTls `json:"tls,omitempty" yaml:"tls,omitempty" mapstructure:"tls,omitempty"` +} +// Configure compression. +// Known values include: gzip, none. Implementations may support other compression +// algorithms. +// If omitted or null, none is used. type OTLPGrpcMetricExporterCompression *string +// Configure endpoint. +// If omitted or null, http://localhost:4317 is used. type OTLPGrpcMetricExporterEndpoint *string +// Configure headers. Entries have lower priority than entries from .headers. +// The value is a list of comma separated key-value pairs matching the format of +// OTEL_EXPORTER_OTLP_HEADERS. See +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options +// for details. +// If omitted or null, no headers are added. type OTLPGrpcMetricExporterHeadersList *string -type OTLPGrpcMetricExporterInsecure *bool - +// Configure max time (in milliseconds) to wait for each export. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 10000 is used. type OTLPGrpcMetricExporterTimeout *int type OTLPHttpEncoding string @@ -684,340 +1514,669 @@ const OTLPHttpEncodingJson OTLPHttpEncoding = "json" const OTLPHttpEncodingProtobuf OTLPHttpEncoding = "protobuf" type OTLPHttpExporter struct { - // CertificateFile corresponds to the JSON schema field "certificate_file". - CertificateFile OTLPHttpExporterCertificateFile `json:"certificate_file,omitempty" yaml:"certificate_file,omitempty" mapstructure:"certificate_file,omitempty"` - - // ClientCertificateFile corresponds to the JSON schema field - // "client_certificate_file". - ClientCertificateFile OTLPHttpExporterClientCertificateFile `json:"client_certificate_file,omitempty" yaml:"client_certificate_file,omitempty" mapstructure:"client_certificate_file,omitempty"` - - // ClientKeyFile corresponds to the JSON schema field "client_key_file". - ClientKeyFile OTLPHttpExporterClientKeyFile `json:"client_key_file,omitempty" yaml:"client_key_file,omitempty" mapstructure:"client_key_file,omitempty"` - - // Compression corresponds to the JSON schema field "compression". + // Configure compression. + // Known values include: gzip, none. Implementations may support other compression + // algorithms. + // If omitted or null, none is used. + // Compression OTLPHttpExporterCompression `json:"compression,omitempty" yaml:"compression,omitempty" mapstructure:"compression,omitempty"` - // Encoding corresponds to the JSON schema field "encoding". + // Configure the encoding used for messages. + // Implementations may not support json. + // Values include: + // * json: Protobuf JSON encoding. + // * protobuf: Protobuf binary encoding. + // If omitted, protobuf is used. + // Encoding *OTLPHttpEncoding `json:"encoding,omitempty" yaml:"encoding,omitempty" mapstructure:"encoding,omitempty"` - // Endpoint corresponds to the JSON schema field "endpoint". + // Configure endpoint, including the signal specific path. + // If omitted or null, the http://localhost:4318/v1/{signal} (where signal is + // 'traces', 'logs', or 'metrics') is used. + // Endpoint OTLPHttpExporterEndpoint `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` - // Headers corresponds to the JSON schema field "headers". + // Configure headers. Entries have higher priority than entries from + // .headers_list. + // If an entry's .value is null, the entry is ignored. + // If omitted, no headers are added. + // Headers []NameStringValuePair `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers,omitempty"` - // HeadersList corresponds to the JSON schema field "headers_list". + // Configure headers. Entries have lower priority than entries from .headers. + // The value is a list of comma separated key-value pairs matching the format of + // OTEL_EXPORTER_OTLP_HEADERS. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options + // for details. + // If omitted or null, no headers are added. + // HeadersList OTLPHttpExporterHeadersList `json:"headers_list,omitempty" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"` - // Timeout corresponds to the JSON schema field "timeout". + // Configure max time (in milliseconds) to wait for each export. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 10000 is used. + // Timeout OTLPHttpExporterTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` -} - -type OTLPHttpExporterCertificateFile *string - -type OTLPHttpExporterClientCertificateFile *string -type OTLPHttpExporterClientKeyFile *string + // Configure TLS settings for the exporter. + // If omitted, system default TLS settings are used. + // + Tls *HttpTls `json:"tls,omitempty" yaml:"tls,omitempty" mapstructure:"tls,omitempty"` +} +// Configure compression. +// Known values include: gzip, none. Implementations may support other compression +// algorithms. +// If omitted or null, none is used. type OTLPHttpExporterCompression *string +// Configure endpoint, including the signal specific path. +// If omitted or null, the http://localhost:4318/v1/{signal} (where signal is +// 'traces', 'logs', or 'metrics') is used. type OTLPHttpExporterEndpoint *string +// Configure headers. Entries have lower priority than entries from .headers. +// The value is a list of comma separated key-value pairs matching the format of +// OTEL_EXPORTER_OTLP_HEADERS. See +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options +// for details. +// If omitted or null, no headers are added. type OTLPHttpExporterHeadersList *string +// Configure max time (in milliseconds) to wait for each export. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 10000 is used. type OTLPHttpExporterTimeout *int type OTLPHttpMetricExporter struct { - // CertificateFile corresponds to the JSON schema field "certificate_file". - CertificateFile OTLPHttpMetricExporterCertificateFile `json:"certificate_file,omitempty" yaml:"certificate_file,omitempty" mapstructure:"certificate_file,omitempty"` - - // ClientCertificateFile corresponds to the JSON schema field - // "client_certificate_file". - ClientCertificateFile OTLPHttpMetricExporterClientCertificateFile `json:"client_certificate_file,omitempty" yaml:"client_certificate_file,omitempty" mapstructure:"client_certificate_file,omitempty"` - - // ClientKeyFile corresponds to the JSON schema field "client_key_file". - ClientKeyFile OTLPHttpMetricExporterClientKeyFile `json:"client_key_file,omitempty" yaml:"client_key_file,omitempty" mapstructure:"client_key_file,omitempty"` - - // Compression corresponds to the JSON schema field "compression". + // Configure compression. + // Known values include: gzip, none. Implementations may support other compression + // algorithms. + // If omitted or null, none is used. + // Compression OTLPHttpMetricExporterCompression `json:"compression,omitempty" yaml:"compression,omitempty" mapstructure:"compression,omitempty"` - // DefaultHistogramAggregation corresponds to the JSON schema field - // "default_histogram_aggregation". + // Configure default histogram aggregation. + // Values include: + // * base2_exponential_bucket_histogram: Use base2 exponential histogram as the + // default aggregation for histogram instruments. + // * explicit_bucket_histogram: Use explicit bucket histogram as the default + // aggregation for histogram instruments. + // If omitted, explicit_bucket_histogram is used. + // DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `json:"default_histogram_aggregation,omitempty" yaml:"default_histogram_aggregation,omitempty" mapstructure:"default_histogram_aggregation,omitempty"` - // Encoding corresponds to the JSON schema field "encoding". + // Configure the encoding used for messages. + // Implementations may not support json. + // Values include: + // * json: Protobuf JSON encoding. + // * protobuf: Protobuf binary encoding. + // If omitted, protobuf is used. + // Encoding *OTLPHttpEncoding `json:"encoding,omitempty" yaml:"encoding,omitempty" mapstructure:"encoding,omitempty"` - // Endpoint corresponds to the JSON schema field "endpoint". + // Configure endpoint. + // If omitted or null, http://localhost:4318/v1/metrics is used. + // Endpoint OTLPHttpMetricExporterEndpoint `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` - // Headers corresponds to the JSON schema field "headers". + // Configure headers. Entries have higher priority than entries from + // .headers_list. + // If an entry's .value is null, the entry is ignored. + // If omitted, no headers are added. + // Headers []NameStringValuePair `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers,omitempty"` - // HeadersList corresponds to the JSON schema field "headers_list". + // Configure headers. Entries have lower priority than entries from .headers. + // The value is a list of comma separated key-value pairs matching the format of + // OTEL_EXPORTER_OTLP_HEADERS. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options + // for details. + // If omitted or null, no headers are added. + // HeadersList OTLPHttpMetricExporterHeadersList `json:"headers_list,omitempty" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"` - // TemporalityPreference corresponds to the JSON schema field - // "temporality_preference". + // Configure temporality preference. + // Values include: + // * cumulative: Use cumulative aggregation temporality for all instrument types. + // * delta: Use delta aggregation for all instrument types except up down counter + // and asynchronous up down counter. + // * low_memory: Use delta aggregation temporality for counter and histogram + // instrument types. Use cumulative aggregation temporality for all other + // instrument types. + // If omitted, cumulative is used. + // TemporalityPreference *ExporterTemporalityPreference `json:"temporality_preference,omitempty" yaml:"temporality_preference,omitempty" mapstructure:"temporality_preference,omitempty"` - // Timeout corresponds to the JSON schema field "timeout". + // Configure max time (in milliseconds) to wait for each export. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 10000 is used. + // Timeout OTLPHttpMetricExporterTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` -} -type OTLPHttpMetricExporterCertificateFile *string - -type OTLPHttpMetricExporterClientCertificateFile *string - -type OTLPHttpMetricExporterClientKeyFile *string + // Configure TLS settings for the exporter. + // If omitted, system default TLS settings are used. + // + Tls *HttpTls `json:"tls,omitempty" yaml:"tls,omitempty" mapstructure:"tls,omitempty"` +} +// Configure compression. +// Known values include: gzip, none. Implementations may support other compression +// algorithms. +// If omitted or null, none is used. type OTLPHttpMetricExporterCompression *string +// Configure endpoint. +// If omitted or null, http://localhost:4318/v1/metrics is used. type OTLPHttpMetricExporterEndpoint *string +// Configure headers. Entries have lower priority than entries from .headers. +// The value is a list of comma separated key-value pairs matching the format of +// OTEL_EXPORTER_OTLP_HEADERS. See +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options +// for details. +// If omitted or null, no headers are added. type OTLPHttpMetricExporterHeadersList *string +// Configure max time (in milliseconds) to wait for each export. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 10000 is used. type OTLPHttpMetricExporterTimeout *int type OpenCensusMetricProducer map[string]interface{} type OpenTelemetryConfiguration struct { - // AttributeLimits corresponds to the JSON schema field "attribute_limits". + // Configure general attribute limits. See also tracer_provider.limits, + // logger_provider.limits. + // If omitted, default values as described in AttributeLimits are used. + // AttributeLimits *AttributeLimits `json:"attribute_limits,omitempty" yaml:"attribute_limits,omitempty" mapstructure:"attribute_limits,omitempty"` - // Disabled corresponds to the JSON schema field "disabled". + // Configure if the SDK is disabled or not. + // If omitted or null, false is used. + // Disabled OpenTelemetryConfigurationDisabled `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"` - // FileFormat corresponds to the JSON schema field "file_format". + // Defines configuration parameters specific to a particular OpenTelemetry + // distribution or vendor. + // This section provides a standardized location for distribution-specific + // settings + // that are not part of the OpenTelemetry configuration model. + // It allows vendors to expose their own extensions and general configuration + // options. + // If omitted, distribution defaults are used. + // + Distribution Distribution `json:"distribution,omitempty" yaml:"distribution,omitempty" mapstructure:"distribution,omitempty"` + + // The file format version. + // Represented as a string including the semver major, minor version numbers (and + // optionally the meta tag). For example: "0.4", "1.0-rc.2", "1.0" (after stable + // release). + // See + // https://github.com/open-telemetry/opentelemetry-configuration/blob/main/VERSIONING.md + // for more details. + // The yaml format is documented at + // https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema + // Property is required and must be non-null. + // FileFormat string `json:"file_format" yaml:"file_format" mapstructure:"file_format"` - // InstrumentationDevelopment corresponds to the JSON schema field - // "instrumentation/development". - InstrumentationDevelopment *InstrumentationJson `json:"instrumentation/development,omitempty" yaml:"instrumentation/development,omitempty" mapstructure:"instrumentation/development,omitempty"` - - // LogLevel corresponds to the JSON schema field "log_level". - LogLevel OpenTelemetryConfigurationLogLevel `json:"log_level,omitempty" yaml:"log_level,omitempty" mapstructure:"log_level,omitempty"` - - // LoggerProvider corresponds to the JSON schema field "logger_provider". - LoggerProvider *LoggerProviderJson `json:"logger_provider,omitempty" yaml:"logger_provider,omitempty" mapstructure:"logger_provider,omitempty"` - - // MeterProvider corresponds to the JSON schema field "meter_provider". - MeterProvider *MeterProviderJson `json:"meter_provider,omitempty" yaml:"meter_provider,omitempty" mapstructure:"meter_provider,omitempty"` - - // Propagator corresponds to the JSON schema field "propagator". - Propagator *PropagatorJson `json:"propagator,omitempty" yaml:"propagator,omitempty" mapstructure:"propagator,omitempty"` - - // Resource corresponds to the JSON schema field "resource". - Resource *ResourceJson `json:"resource,omitempty" yaml:"resource,omitempty" mapstructure:"resource,omitempty"` - - // TracerProvider corresponds to the JSON schema field "tracer_provider". - TracerProvider *TracerProviderJson `json:"tracer_provider,omitempty" yaml:"tracer_provider,omitempty" mapstructure:"tracer_provider,omitempty"` + // Configure instrumentation. + // If omitted, instrumentation defaults are used. + // + InstrumentationDevelopment *ExperimentalInstrumentation `json:"instrumentation/development,omitempty" yaml:"instrumentation/development,omitempty" mapstructure:"instrumentation/development,omitempty"` + + // Configure the log level of the internal logger used by the SDK. + // Values include: + // * debug: debug, severity number 5. + // * debug2: debug2, severity number 6. + // * debug3: debug3, severity number 7. + // * debug4: debug4, severity number 8. + // * error: error, severity number 17. + // * error2: error2, severity number 18. + // * error3: error3, severity number 19. + // * error4: error4, severity number 20. + // * fatal: fatal, severity number 21. + // * fatal2: fatal2, severity number 22. + // * fatal3: fatal3, severity number 23. + // * fatal4: fatal4, severity number 24. + // * info: info, severity number 9. + // * info2: info2, severity number 10. + // * info3: info3, severity number 11. + // * info4: info4, severity number 12. + // * trace: trace, severity number 1. + // * trace2: trace2, severity number 2. + // * trace3: trace3, severity number 3. + // * trace4: trace4, severity number 4. + // * warn: warn, severity number 13. + // * warn2: warn2, severity number 14. + // * warn3: warn3, severity number 15. + // * warn4: warn4, severity number 16. + // If omitted, INFO is used. + // + LogLevel *SeverityNumber `json:"log_level,omitempty" yaml:"log_level,omitempty" mapstructure:"log_level,omitempty"` + + // Configure logger provider. + // If omitted, a noop logger provider is used. + // + LoggerProvider *LoggerProvider `json:"logger_provider,omitempty" yaml:"logger_provider,omitempty" mapstructure:"logger_provider,omitempty"` + + // Configure meter provider. + // If omitted, a noop meter provider is used. + // + MeterProvider *MeterProvider `json:"meter_provider,omitempty" yaml:"meter_provider,omitempty" mapstructure:"meter_provider,omitempty"` + + // Configure text map context propagators. + // If omitted, a noop propagator is used. + // + Propagator *Propagator `json:"propagator,omitempty" yaml:"propagator,omitempty" mapstructure:"propagator,omitempty"` + + // Configure resource for all signals. + // If omitted, the default resource is used. + // + Resource *Resource `json:"resource,omitempty" yaml:"resource,omitempty" mapstructure:"resource,omitempty"` + + // Configure tracer provider. + // If omitted, a noop tracer provider is used. + // + TracerProvider *TracerProvider `json:"tracer_provider,omitempty" yaml:"tracer_provider,omitempty" mapstructure:"tracer_provider,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } +// Configure if the SDK is disabled or not. +// If omitted or null, false is used. type OpenTelemetryConfigurationDisabled *bool -type OpenTelemetryConfigurationLogLevel *string - type OpenTracingPropagator map[string]interface{} type ParentBasedSampler struct { - // LocalParentNotSampled corresponds to the JSON schema field - // "local_parent_not_sampled". + // Configure local_parent_not_sampled sampler. + // If omitted, always_off is used. + // LocalParentNotSampled *Sampler `json:"local_parent_not_sampled,omitempty" yaml:"local_parent_not_sampled,omitempty" mapstructure:"local_parent_not_sampled,omitempty"` - // LocalParentSampled corresponds to the JSON schema field "local_parent_sampled". + // Configure local_parent_sampled sampler. + // If omitted, always_on is used. + // LocalParentSampled *Sampler `json:"local_parent_sampled,omitempty" yaml:"local_parent_sampled,omitempty" mapstructure:"local_parent_sampled,omitempty"` - // RemoteParentNotSampled corresponds to the JSON schema field - // "remote_parent_not_sampled". + // Configure remote_parent_not_sampled sampler. + // If omitted, always_off is used. + // RemoteParentNotSampled *Sampler `json:"remote_parent_not_sampled,omitempty" yaml:"remote_parent_not_sampled,omitempty" mapstructure:"remote_parent_not_sampled,omitempty"` - // RemoteParentSampled corresponds to the JSON schema field - // "remote_parent_sampled". + // Configure remote_parent_sampled sampler. + // If omitted, always_on is used. + // RemoteParentSampled *Sampler `json:"remote_parent_sampled,omitempty" yaml:"remote_parent_sampled,omitempty" mapstructure:"remote_parent_sampled,omitempty"` - // Root corresponds to the JSON schema field "root". + // Configure root sampler. + // If omitted, always_on is used. + // Root *Sampler `json:"root,omitempty" yaml:"root,omitempty" mapstructure:"root,omitempty"` } type PeriodicMetricReader struct { - // CardinalityLimits corresponds to the JSON schema field "cardinality_limits". + // Configure cardinality limits. + // If omitted, default values as described in CardinalityLimits are used. + // CardinalityLimits *CardinalityLimits `json:"cardinality_limits,omitempty" yaml:"cardinality_limits,omitempty" mapstructure:"cardinality_limits,omitempty"` - // Exporter corresponds to the JSON schema field "exporter". + // Configure exporter. + // Property is required and must be non-null. + // Exporter PushMetricExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` - // Interval corresponds to the JSON schema field "interval". + // Configure delay interval (in milliseconds) between start of two consecutive + // exports. + // Value must be non-negative. + // If omitted or null, 60000 is used. + // Interval PeriodicMetricReaderInterval `json:"interval,omitempty" yaml:"interval,omitempty" mapstructure:"interval,omitempty"` - // Producers corresponds to the JSON schema field "producers". + // Configure metric producers. + // If omitted, no metric producers are added. + // Producers []MetricProducer `json:"producers,omitempty" yaml:"producers,omitempty" mapstructure:"producers,omitempty"` - // Timeout corresponds to the JSON schema field "timeout". + // Configure maximum allowed time (in milliseconds) to export data. + // Value must be non-negative. A value of 0 indicates no limit (infinity). + // If omitted or null, 30000 is used. + // Timeout PeriodicMetricReaderTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` } +// Configure delay interval (in milliseconds) between start of two consecutive +// exports. +// Value must be non-negative. +// If omitted or null, 60000 is used. type PeriodicMetricReaderInterval *int +// Configure maximum allowed time (in milliseconds) to export data. +// Value must be non-negative. A value of 0 indicates no limit (infinity). +// If omitted or null, 30000 is used. type PeriodicMetricReaderTimeout *int -type PropagatorJson struct { - // Composite corresponds to the JSON schema field "composite". +type Propagator struct { + // Configure the propagators in the composite text map propagator. Entries from + // .composite_list are appended to the list here with duplicates filtered out. + // Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, + // ottrace. Known third party keys include: xray. + // If omitted, and .composite_list is omitted or null, a noop propagator is used. + // Composite []TextMapPropagator `json:"composite,omitempty" yaml:"composite,omitempty" mapstructure:"composite,omitempty"` - // CompositeList corresponds to the JSON schema field "composite_list". - CompositeList PropagatorJsonCompositeList `json:"composite_list,omitempty" yaml:"composite_list,omitempty" mapstructure:"composite_list,omitempty"` -} - -type PropagatorJsonCompositeList *string + // Configure the propagators in the composite text map propagator. Entries are + // appended to .composite with duplicates filtered out. + // The value is a comma separated list of propagator identifiers matching the + // format of OTEL_PROPAGATORS. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration + // for details. + // Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, + // jaeger, ottrace. Known third party identifiers include: xray. + // If omitted or null, and .composite is omitted or null, a noop propagator is + // used. + // + CompositeList PropagatorCompositeList `json:"composite_list,omitempty" yaml:"composite_list,omitempty" mapstructure:"composite_list,omitempty"` +} + +// Configure the propagators in the composite text map propagator. Entries are +// appended to .composite with duplicates filtered out. +// The value is a comma separated list of propagator identifiers matching the +// format of OTEL_PROPAGATORS. See +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration +// for details. +// Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, +// jaeger, ottrace. Known third party identifiers include: xray. +// If omitted or null, and .composite is omitted or null, a noop propagator is +// used. +type PropagatorCompositeList *string type PullMetricExporter struct { - // PrometheusDevelopment corresponds to the JSON schema field - // "prometheus/development". + // Configure exporter to be prometheus. + // If omitted, ignore. + // PrometheusDevelopment *ExperimentalPrometheusMetricExporter `json:"prometheus/development,omitempty" yaml:"prometheus/development,omitempty" mapstructure:"prometheus/development,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } type PullMetricReader struct { - // CardinalityLimits corresponds to the JSON schema field "cardinality_limits". + // Configure cardinality limits. + // If omitted, default values as described in CardinalityLimits are used. + // CardinalityLimits *CardinalityLimits `json:"cardinality_limits,omitempty" yaml:"cardinality_limits,omitempty" mapstructure:"cardinality_limits,omitempty"` - // Exporter corresponds to the JSON schema field "exporter". + // Configure exporter. + // Property is required and must be non-null. + // Exporter PullMetricExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` - // Producers corresponds to the JSON schema field "producers". + // Configure metric producers. + // If omitted, no metric producers are added. + // Producers []MetricProducer `json:"producers,omitempty" yaml:"producers,omitempty" mapstructure:"producers,omitempty"` } type PushMetricExporter struct { - // Console corresponds to the JSON schema field "console". - Console ConsoleExporter `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` - - // OTLPFileDevelopment corresponds to the JSON schema field - // "otlp_file/development". + // Configure exporter to be console. + // If omitted, ignore. + // + Console *ConsoleMetricExporter `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` + + // Configure exporter to be OTLP with file transport. + // If omitted, ignore. + // OTLPFileDevelopment *ExperimentalOTLPFileMetricExporter `json:"otlp_file/development,omitempty" yaml:"otlp_file/development,omitempty" mapstructure:"otlp_file/development,omitempty"` - // OTLPGrpc corresponds to the JSON schema field "otlp_grpc". + // Configure exporter to be OTLP with gRPC transport. + // If omitted, ignore. + // OTLPGrpc *OTLPGrpcMetricExporter `json:"otlp_grpc,omitempty" yaml:"otlp_grpc,omitempty" mapstructure:"otlp_grpc,omitempty"` - // OTLPHttp corresponds to the JSON schema field "otlp_http". + // Configure exporter to be OTLP with HTTP transport. + // If omitted, ignore. + // OTLPHttp *OTLPHttpMetricExporter `json:"otlp_http,omitempty" yaml:"otlp_http,omitempty" mapstructure:"otlp_http,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } -type ResourceJson struct { - // Attributes corresponds to the JSON schema field "attributes". +type Resource struct { + // Configure resource attributes. Entries have higher priority than entries from + // .resource.attributes_list. + // If omitted, no resource attributes are added. + // Attributes []AttributeNameValue `json:"attributes,omitempty" yaml:"attributes,omitempty" mapstructure:"attributes,omitempty"` - // AttributesList corresponds to the JSON schema field "attributes_list". - AttributesList ResourceJsonAttributesList `json:"attributes_list,omitempty" yaml:"attributes_list,omitempty" mapstructure:"attributes_list,omitempty"` - - // DetectionDevelopment corresponds to the JSON schema field - // "detection/development". + // Configure resource attributes. Entries have lower priority than entries from + // .resource.attributes. + // The value is a list of comma separated key-value pairs matching the format of + // OTEL_RESOURCE_ATTRIBUTES. See + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration + // for details. + // If omitted or null, no resource attributes are added. + // + AttributesList ResourceAttributesList `json:"attributes_list,omitempty" yaml:"attributes_list,omitempty" mapstructure:"attributes_list,omitempty"` + + // Configure resource detection. + // If omitted, resource detection is disabled. + // DetectionDevelopment *ExperimentalResourceDetection `json:"detection/development,omitempty" yaml:"detection/development,omitempty" mapstructure:"detection/development,omitempty"` - // SchemaUrl corresponds to the JSON schema field "schema_url". - SchemaUrl ResourceJsonSchemaUrl `json:"schema_url,omitempty" yaml:"schema_url,omitempty" mapstructure:"schema_url,omitempty"` + // Configure resource schema URL. + // If omitted or null, no schema URL is used. + // + SchemaUrl ResourceSchemaUrl `json:"schema_url,omitempty" yaml:"schema_url,omitempty" mapstructure:"schema_url,omitempty"` } -type ResourceJsonAttributesList *string +// Configure resource attributes. Entries have lower priority than entries from +// .resource.attributes. +// The value is a list of comma separated key-value pairs matching the format of +// OTEL_RESOURCE_ATTRIBUTES. See +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration +// for details. +// If omitted or null, no resource attributes are added. +type ResourceAttributesList *string -type ResourceJsonSchemaUrl *string +// Configure resource schema URL. +// If omitted or null, no schema URL is used. +type ResourceSchemaUrl *string type Sampler struct { - // AlwaysOff corresponds to the JSON schema field "always_off". + // Configure sampler to be always_off. + // If omitted, ignore. + // AlwaysOff AlwaysOffSampler `json:"always_off,omitempty" yaml:"always_off,omitempty" mapstructure:"always_off,omitempty"` - // AlwaysOn corresponds to the JSON schema field "always_on". + // Configure sampler to be always_on. + // If omitted, ignore. + // AlwaysOn AlwaysOnSampler `json:"always_on,omitempty" yaml:"always_on,omitempty" mapstructure:"always_on,omitempty"` - // JaegerRemote corresponds to the JSON schema field "jaeger_remote". - JaegerRemote *JaegerRemoteSampler `json:"jaeger_remote,omitempty" yaml:"jaeger_remote,omitempty" mapstructure:"jaeger_remote,omitempty"` + // Configure sampler to be composite. + // If omitted, ignore. + // + CompositeDevelopment *ExperimentalComposableSampler `json:"composite/development,omitempty" yaml:"composite/development,omitempty" mapstructure:"composite/development,omitempty"` + + // Configure sampler to be jaeger_remote. + // If omitted, ignore. + // + JaegerRemoteDevelopment *ExperimentalJaegerRemoteSampler `json:"jaeger_remote/development,omitempty" yaml:"jaeger_remote/development,omitempty" mapstructure:"jaeger_remote/development,omitempty"` - // ParentBased corresponds to the JSON schema field "parent_based". + // Configure sampler to be parent_based. + // If omitted, ignore. + // ParentBased *ParentBasedSampler `json:"parent_based,omitempty" yaml:"parent_based,omitempty" mapstructure:"parent_based,omitempty"` - // TraceIDRatioBased corresponds to the JSON schema field "trace_id_ratio_based". + // Configure sampler to be probability. + // If omitted, ignore. + // + ProbabilityDevelopment *ExperimentalProbabilitySampler `json:"probability/development,omitempty" yaml:"probability/development,omitempty" mapstructure:"probability/development,omitempty"` + + // Configure sampler to be trace_id_ratio_based. + // If omitted, ignore. + // TraceIDRatioBased *TraceIDRatioBasedSampler `json:"trace_id_ratio_based,omitempty" yaml:"trace_id_ratio_based,omitempty" mapstructure:"trace_id_ratio_based,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` } +type SeverityNumber string + +const SeverityNumberDebug SeverityNumber = "debug" +const SeverityNumberDebug2 SeverityNumber = "debug2" +const SeverityNumberDebug3 SeverityNumber = "debug3" +const SeverityNumberDebug4 SeverityNumber = "debug4" +const SeverityNumberError SeverityNumber = "error" +const SeverityNumberError2 SeverityNumber = "error2" +const SeverityNumberError3 SeverityNumber = "error3" +const SeverityNumberError4 SeverityNumber = "error4" +const SeverityNumberFatal SeverityNumber = "fatal" +const SeverityNumberFatal2 SeverityNumber = "fatal2" +const SeverityNumberFatal3 SeverityNumber = "fatal3" +const SeverityNumberFatal4 SeverityNumber = "fatal4" +const SeverityNumberInfo SeverityNumber = "info" +const SeverityNumberInfo2 SeverityNumber = "info2" +const SeverityNumberInfo3 SeverityNumber = "info3" +const SeverityNumberInfo4 SeverityNumber = "info4" +const SeverityNumberTrace SeverityNumber = "trace" +const SeverityNumberTrace2 SeverityNumber = "trace2" +const SeverityNumberTrace3 SeverityNumber = "trace3" +const SeverityNumberTrace4 SeverityNumber = "trace4" +const SeverityNumberWarn SeverityNumber = "warn" +const SeverityNumberWarn2 SeverityNumber = "warn2" +const SeverityNumberWarn3 SeverityNumber = "warn3" +const SeverityNumberWarn4 SeverityNumber = "warn4" + type SimpleLogRecordProcessor struct { - // Exporter corresponds to the JSON schema field "exporter". + // Configure exporter. + // Property is required and must be non-null. + // Exporter LogRecordExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` } type SimpleSpanProcessor struct { - // Exporter corresponds to the JSON schema field "exporter". + // Configure exporter. + // Property is required and must be non-null. + // Exporter SpanExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` } type SpanExporter struct { - // Console corresponds to the JSON schema field "console". + // Configure exporter to be console. + // If omitted, ignore. + // Console ConsoleExporter `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` - // OTLPFileDevelopment corresponds to the JSON schema field - // "otlp_file/development". + // Configure exporter to be OTLP with file transport. + // If omitted, ignore. + // OTLPFileDevelopment *ExperimentalOTLPFileExporter `json:"otlp_file/development,omitempty" yaml:"otlp_file/development,omitempty" mapstructure:"otlp_file/development,omitempty"` - // OTLPGrpc corresponds to the JSON schema field "otlp_grpc". + // Configure exporter to be OTLP with gRPC transport. + // If omitted, ignore. + // OTLPGrpc *OTLPGrpcExporter `json:"otlp_grpc,omitempty" yaml:"otlp_grpc,omitempty" mapstructure:"otlp_grpc,omitempty"` - // OTLPHttp corresponds to the JSON schema field "otlp_http". + // Configure exporter to be OTLP with HTTP transport. + // If omitted, ignore. + // OTLPHttp *OTLPHttpExporter `json:"otlp_http,omitempty" yaml:"otlp_http,omitempty" mapstructure:"otlp_http,omitempty"` - // Zipkin corresponds to the JSON schema field "zipkin". - Zipkin *ZipkinSpanExporter `json:"zipkin,omitempty" yaml:"zipkin,omitempty" mapstructure:"zipkin,omitempty"` - AdditionalProperties interface{} `mapstructure:",remain"` } +type SpanKind string + +const SpanKindClient SpanKind = "client" +const SpanKindConsumer SpanKind = "consumer" +const SpanKindInternal SpanKind = "internal" +const SpanKindProducer SpanKind = "producer" +const SpanKindServer SpanKind = "server" + type SpanLimits struct { - // AttributeCountLimit corresponds to the JSON schema field - // "attribute_count_limit". + // Configure max attribute count. Overrides + // .attribute_limits.attribute_count_limit. + // Value must be non-negative. + // If omitted or null, 128 is used. + // AttributeCountLimit SpanLimitsAttributeCountLimit `json:"attribute_count_limit,omitempty" yaml:"attribute_count_limit,omitempty" mapstructure:"attribute_count_limit,omitempty"` - // AttributeValueLengthLimit corresponds to the JSON schema field - // "attribute_value_length_limit". + // Configure max attribute value size. Overrides + // .attribute_limits.attribute_value_length_limit. + // Value must be non-negative. + // If omitted or null, there is no limit. + // AttributeValueLengthLimit SpanLimitsAttributeValueLengthLimit `json:"attribute_value_length_limit,omitempty" yaml:"attribute_value_length_limit,omitempty" mapstructure:"attribute_value_length_limit,omitempty"` - // EventAttributeCountLimit corresponds to the JSON schema field - // "event_attribute_count_limit". + // Configure max attributes per span event. + // Value must be non-negative. + // If omitted or null, 128 is used. + // EventAttributeCountLimit SpanLimitsEventAttributeCountLimit `json:"event_attribute_count_limit,omitempty" yaml:"event_attribute_count_limit,omitempty" mapstructure:"event_attribute_count_limit,omitempty"` - // EventCountLimit corresponds to the JSON schema field "event_count_limit". + // Configure max span event count. + // Value must be non-negative. + // If omitted or null, 128 is used. + // EventCountLimit SpanLimitsEventCountLimit `json:"event_count_limit,omitempty" yaml:"event_count_limit,omitempty" mapstructure:"event_count_limit,omitempty"` - // LinkAttributeCountLimit corresponds to the JSON schema field - // "link_attribute_count_limit". + // Configure max attributes per span link. + // Value must be non-negative. + // If omitted or null, 128 is used. + // LinkAttributeCountLimit SpanLimitsLinkAttributeCountLimit `json:"link_attribute_count_limit,omitempty" yaml:"link_attribute_count_limit,omitempty" mapstructure:"link_attribute_count_limit,omitempty"` - // LinkCountLimit corresponds to the JSON schema field "link_count_limit". + // Configure max span link count. + // Value must be non-negative. + // If omitted or null, 128 is used. + // LinkCountLimit SpanLimitsLinkCountLimit `json:"link_count_limit,omitempty" yaml:"link_count_limit,omitempty" mapstructure:"link_count_limit,omitempty"` } +// Configure max attribute count. Overrides +// .attribute_limits.attribute_count_limit. +// Value must be non-negative. +// If omitted or null, 128 is used. type SpanLimitsAttributeCountLimit *int +// Configure max attribute value size. Overrides +// .attribute_limits.attribute_value_length_limit. +// Value must be non-negative. +// If omitted or null, there is no limit. type SpanLimitsAttributeValueLengthLimit *int +// Configure max attributes per span event. +// Value must be non-negative. +// If omitted or null, 128 is used. type SpanLimitsEventAttributeCountLimit *int +// Configure max span event count. +// Value must be non-negative. +// If omitted or null, 128 is used. type SpanLimitsEventCountLimit *int +// Configure max attributes per span link. +// Value must be non-negative. +// If omitted or null, 128 is used. type SpanLimitsLinkAttributeCountLimit *int +// Configure max span link count. +// Value must be non-negative. +// If omitted or null, 128 is used. type SpanLimitsLinkCountLimit *int type SpanProcessor struct { - // Batch corresponds to the JSON schema field "batch". + // Configure a batch span processor. + // If omitted, ignore. + // Batch *BatchSpanProcessor `json:"batch,omitempty" yaml:"batch,omitempty" mapstructure:"batch,omitempty"` - // Simple corresponds to the JSON schema field "simple". + // Configure a simple span processor. + // If omitted, ignore. + // Simple *SimpleSpanProcessor `json:"simple,omitempty" yaml:"simple,omitempty" mapstructure:"simple,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` @@ -1026,22 +2185,34 @@ type SpanProcessor struct { type SumAggregation map[string]interface{} type TextMapPropagator struct { - // B3 corresponds to the JSON schema field "b3". + // Include the zipkin b3 propagator. + // If omitted, ignore. + // B3 B3Propagator `json:"b3,omitempty" yaml:"b3,omitempty" mapstructure:"b3,omitempty"` - // B3Multi corresponds to the JSON schema field "b3multi". + // Include the zipkin b3 multi propagator. + // If omitted, ignore. + // B3Multi B3MultiPropagator `json:"b3multi,omitempty" yaml:"b3multi,omitempty" mapstructure:"b3multi,omitempty"` - // Baggage corresponds to the JSON schema field "baggage". + // Include the w3c baggage propagator. + // If omitted, ignore. + // Baggage BaggagePropagator `json:"baggage,omitempty" yaml:"baggage,omitempty" mapstructure:"baggage,omitempty"` - // Jaeger corresponds to the JSON schema field "jaeger". + // Include the jaeger propagator. + // If omitted, ignore. + // Jaeger JaegerPropagator `json:"jaeger,omitempty" yaml:"jaeger,omitempty" mapstructure:"jaeger,omitempty"` - // Ottrace corresponds to the JSON schema field "ottrace". + // Include the opentracing propagator. + // If omitted, ignore. + // Ottrace OpenTracingPropagator `json:"ottrace,omitempty" yaml:"ottrace,omitempty" mapstructure:"ottrace,omitempty"` - // Tracecontext corresponds to the JSON schema field "tracecontext". + // Include the w3c trace context propagator. + // If omitted, ignore. + // Tracecontext TraceContextPropagator `json:"tracecontext,omitempty" yaml:"tracecontext,omitempty" mapstructure:"tracecontext,omitempty"` AdditionalProperties interface{} `mapstructure:",remain"` @@ -1050,97 +2221,148 @@ type TextMapPropagator struct { type TraceContextPropagator map[string]interface{} type TraceIDRatioBasedSampler struct { - // Ratio corresponds to the JSON schema field "ratio". + // Configure trace_id_ratio. + // If omitted or null, 1.0 is used. + // Ratio TraceIDRatioBasedSamplerRatio `json:"ratio,omitempty" yaml:"ratio,omitempty" mapstructure:"ratio,omitempty"` } +// Configure trace_id_ratio. +// If omitted or null, 1.0 is used. type TraceIDRatioBasedSamplerRatio *float64 -type TracerProviderJson struct { - // Limits corresponds to the JSON schema field "limits". +type TracerProvider struct { + // Configure span limits. See also attribute_limits. + // If omitted, default values as described in SpanLimits are used. + // Limits *SpanLimits `json:"limits,omitempty" yaml:"limits,omitempty" mapstructure:"limits,omitempty"` - // Processors corresponds to the JSON schema field "processors". + // Configure span processors. + // Property is required and must be non-null. + // Processors []SpanProcessor `json:"processors" yaml:"processors" mapstructure:"processors"` - // Sampler corresponds to the JSON schema field "sampler". + // Configure the sampler. + // If omitted, parent based sampler with a root of always_on is used. + // Sampler *Sampler `json:"sampler,omitempty" yaml:"sampler,omitempty" mapstructure:"sampler,omitempty"` - // TracerConfiguratorDevelopment corresponds to the JSON schema field - // "tracer_configurator/development". + // Configure tracers. + // If omitted, all tracers use default values as described in + // ExperimentalTracerConfig. + // TracerConfiguratorDevelopment *ExperimentalTracerConfigurator `json:"tracer_configurator/development,omitempty" yaml:"tracer_configurator/development,omitempty" mapstructure:"tracer_configurator/development,omitempty"` } type View struct { - // Selector corresponds to the JSON schema field "selector". - Selector *ViewSelector `json:"selector,omitempty" yaml:"selector,omitempty" mapstructure:"selector,omitempty"` + // Configure view selector. + // Selection criteria is additive as described in + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria. + // Property is required and must be non-null. + // + Selector ViewSelector `json:"selector" yaml:"selector" mapstructure:"selector"` - // Stream corresponds to the JSON schema field "stream". - Stream *ViewStream `json:"stream,omitempty" yaml:"stream,omitempty" mapstructure:"stream,omitempty"` + // Configure view stream. + // Property is required and must be non-null. + // + Stream ViewStream `json:"stream" yaml:"stream" mapstructure:"stream"` } type ViewSelector struct { - // InstrumentName corresponds to the JSON schema field "instrument_name". + // Configure instrument name selection criteria. + // If omitted or null, all instrument names match. + // InstrumentName ViewSelectorInstrumentName `json:"instrument_name,omitempty" yaml:"instrument_name,omitempty" mapstructure:"instrument_name,omitempty"` - // InstrumentType corresponds to the JSON schema field "instrument_type". + // Configure instrument type selection criteria. + // Values include: + // * counter: Synchronous counter instruments. + // * gauge: Synchronous gauge instruments. + // * histogram: Synchronous histogram instruments. + // * observable_counter: Asynchronous counter instruments. + // * observable_gauge: Asynchronous gauge instruments. + // * observable_up_down_counter: Asynchronous up down counter instruments. + // * up_down_counter: Synchronous up down counter instruments. + // If omitted, all instrument types match. + // InstrumentType *InstrumentType `json:"instrument_type,omitempty" yaml:"instrument_type,omitempty" mapstructure:"instrument_type,omitempty"` - // MeterName corresponds to the JSON schema field "meter_name". + // Configure meter name selection criteria. + // If omitted or null, all meter names match. + // MeterName ViewSelectorMeterName `json:"meter_name,omitempty" yaml:"meter_name,omitempty" mapstructure:"meter_name,omitempty"` - // MeterSchemaUrl corresponds to the JSON schema field "meter_schema_url". + // Configure meter schema url selection criteria. + // If omitted or null, all meter schema URLs match. + // MeterSchemaUrl ViewSelectorMeterSchemaUrl `json:"meter_schema_url,omitempty" yaml:"meter_schema_url,omitempty" mapstructure:"meter_schema_url,omitempty"` - // MeterVersion corresponds to the JSON schema field "meter_version". + // Configure meter version selection criteria. + // If omitted or null, all meter versions match. + // MeterVersion ViewSelectorMeterVersion `json:"meter_version,omitempty" yaml:"meter_version,omitempty" mapstructure:"meter_version,omitempty"` - // Unit corresponds to the JSON schema field "unit". + // Configure the instrument unit selection criteria. + // If omitted or null, all instrument units match. + // Unit ViewSelectorUnit `json:"unit,omitempty" yaml:"unit,omitempty" mapstructure:"unit,omitempty"` } +// Configure instrument name selection criteria. +// If omitted or null, all instrument names match. type ViewSelectorInstrumentName *string +// Configure meter name selection criteria. +// If omitted or null, all meter names match. type ViewSelectorMeterName *string +// Configure meter schema url selection criteria. +// If omitted or null, all meter schema URLs match. type ViewSelectorMeterSchemaUrl *string +// Configure meter version selection criteria. +// If omitted or null, all meter versions match. type ViewSelectorMeterVersion *string +// Configure the instrument unit selection criteria. +// If omitted or null, all instrument units match. type ViewSelectorUnit *string type ViewStream struct { - // Aggregation corresponds to the JSON schema field "aggregation". + // Configure aggregation of the resulting stream(s). + // If omitted, default is used. + // Aggregation *Aggregation `json:"aggregation,omitempty" yaml:"aggregation,omitempty" mapstructure:"aggregation,omitempty"` - // AggregationCardinalityLimit corresponds to the JSON schema field - // "aggregation_cardinality_limit". + // Configure the aggregation cardinality limit. + // If omitted or null, the metric reader's default cardinality limit is used. + // AggregationCardinalityLimit ViewStreamAggregationCardinalityLimit `json:"aggregation_cardinality_limit,omitempty" yaml:"aggregation_cardinality_limit,omitempty" mapstructure:"aggregation_cardinality_limit,omitempty"` - // AttributeKeys corresponds to the JSON schema field "attribute_keys". + // Configure attribute keys retained in the resulting stream(s). + // If omitted, all attribute keys are retained. + // AttributeKeys *IncludeExclude `json:"attribute_keys,omitempty" yaml:"attribute_keys,omitempty" mapstructure:"attribute_keys,omitempty"` - // Description corresponds to the JSON schema field "description". + // Configure metric description of the resulting stream(s). + // If omitted or null, the instrument's origin description is used. + // Description ViewStreamDescription `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` - // Name corresponds to the JSON schema field "name". + // Configure metric name of the resulting stream(s). + // If omitted or null, the instrument's original name is used. + // Name ViewStreamName `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` } +// Configure the aggregation cardinality limit. +// If omitted or null, the metric reader's default cardinality limit is used. type ViewStreamAggregationCardinalityLimit *int +// Configure metric description of the resulting stream(s). +// If omitted or null, the instrument's origin description is used. type ViewStreamDescription *string +// Configure metric name of the resulting stream(s). +// If omitted or null, the instrument's original name is used. type ViewStreamName *string - -type ZipkinSpanExporter struct { - // Endpoint corresponds to the JSON schema field "endpoint". - Endpoint ZipkinSpanExporterEndpoint `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` - - // Timeout corresponds to the JSON schema field "timeout". - Timeout ZipkinSpanExporterTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` -} - -type ZipkinSpanExporterEndpoint *string - -type ZipkinSpanExporterTimeout *int diff --git a/otelconf/log.go b/otelconf/log.go index f83a2b4a145..24400a14194 100644 --- a/otelconf/log.go +++ b/otelconf/log.go @@ -168,11 +168,13 @@ func otlpHTTPLogExporter(ctx context.Context, otlpConfig *OTLPHttpExporter) (sdk opts = append(opts, otlploghttp.WithHeaders(headersConfig)) } - tlsConfig, err := tls.CreateConfig(otlpConfig.CertificateFile, otlpConfig.ClientCertificateFile, otlpConfig.ClientKeyFile) - if err != nil { - return nil, errors.Join(newErrInvalid("tls configuration"), err) + if otlpConfig.Tls != nil { + tlsConfig, err := tls.CreateConfig(otlpConfig.Tls.CaFile, otlpConfig.Tls.CertFile, otlpConfig.Tls.KeyFile) + if err != nil { + return nil, errors.Join(newErrInvalid("tls configuration"), err) + } + opts = append(opts, otlploghttp.WithTLSClientConfig(tlsConfig)) } - opts = append(opts, otlploghttp.WithTLSClientConfig(tlsConfig)) return otlploghttp.New(ctx, opts...) } @@ -195,7 +197,7 @@ func otlpGRPCLogExporter(ctx context.Context, otlpConfig *OTLPGrpcExporter) (sdk } else { opts = append(opts, otlploggrpc.WithEndpoint(*otlpConfig.Endpoint)) } - if u.Scheme == "http" || (u.Scheme != "https" && otlpConfig.Insecure != nil && *otlpConfig.Insecure) { + if u.Scheme == "http" || (u.Scheme != "https" && otlpConfig.Tls != nil && otlpConfig.Tls.Insecure != nil && *otlpConfig.Tls.Insecure) { opts = append(opts, otlploggrpc.WithInsecure()) } } @@ -220,8 +222,8 @@ func otlpGRPCLogExporter(ctx context.Context, otlpConfig *OTLPGrpcExporter) (sdk opts = append(opts, otlploggrpc.WithHeaders(headersConfig)) } - if otlpConfig.CertificateFile != nil || otlpConfig.ClientCertificateFile != nil || otlpConfig.ClientKeyFile != nil { - tlsConfig, err := tls.CreateConfig(otlpConfig.CertificateFile, otlpConfig.ClientCertificateFile, otlpConfig.ClientKeyFile) + if otlpConfig.Tls != nil && (otlpConfig.Tls.CaFile != nil || otlpConfig.Tls.CertFile != nil || otlpConfig.Tls.KeyFile != nil) { + tlsConfig, err := tls.CreateConfig(otlpConfig.Tls.CaFile, otlpConfig.Tls.CertFile, otlpConfig.Tls.KeyFile) if err != nil { return nil, errors.Join(newErrInvalid("tls configuration"), err) } diff --git a/otelconf/log_test.go b/otelconf/log_test.go index 68e5a6a6f0c..e7dcd39bac5 100644 --- a/otelconf/log_test.go +++ b/otelconf/log_test.go @@ -50,7 +50,7 @@ func TestLoggerProvider(t *testing.T) { name: "error-in-config", cfg: configOptions{ opentelemetryConfig: OpenTelemetryConfiguration{ - LoggerProvider: &LoggerProviderJson{ + LoggerProvider: &LoggerProvider{ Processors: []LogRecordProcessor{ { Simple: &SimpleLogRecordProcessor{}, @@ -254,10 +254,12 @@ func TestLogProcessor(t *testing.T) { Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPGrpc: &OTLPGrpcExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "ca.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + CaFile: ptr(filepath.Join("testdata", "ca.crt")), + }, }, }, }, @@ -270,10 +272,12 @@ func TestLogProcessor(t *testing.T) { Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPGrpc: &OTLPGrpcExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + CaFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -302,11 +306,13 @@ func TestLogProcessor(t *testing.T) { Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPGrpc: &OTLPGrpcExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - ClientCertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), - ClientKeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + KeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + CertFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -407,10 +413,12 @@ func TestLogProcessor(t *testing.T) { Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPHttp: &OTLPHttpExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "ca.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + CaFile: ptr(filepath.Join("testdata", "ca.crt")), + }, }, }, }, @@ -423,10 +431,12 @@ func TestLogProcessor(t *testing.T) { Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPHttp: &OTLPHttpExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + CaFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -439,11 +449,13 @@ func TestLogProcessor(t *testing.T) { Batch: &BatchLogRecordProcessor{ Exporter: LogRecordExporter{ OTLPHttp: &OTLPHttpExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - ClientCertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), - ClientKeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + KeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + CertFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -683,7 +695,7 @@ func TestLoggerProviderOptions(t *testing.T) { defer srv.Close() cfg := OpenTelemetryConfiguration{ - LoggerProvider: &LoggerProviderJson{ + LoggerProvider: &LoggerProvider{ Processors: []LogRecordProcessor{{ Simple: &SimpleLogRecordProcessor{ Exporter: LogRecordExporter{ @@ -745,7 +757,9 @@ func Test_otlpGRPCLogExporter(t *testing.T) { otlpConfig: &OTLPGrpcExporter{ Compression: ptr("gzip"), Timeout: ptr(5000), - Insecure: ptr(true), + Tls: &GrpcTls{ + Insecure: ptr(true), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, @@ -760,9 +774,11 @@ func Test_otlpGRPCLogExporter(t *testing.T) { args: args{ ctx: t.Context(), otlpConfig: &OTLPGrpcExporter{ - Compression: ptr("gzip"), - Timeout: ptr(5000), - CertificateFile: ptr("testdata/server-certs/server.crt"), + Compression: ptr("gzip"), + Timeout: ptr(5000), + Tls: &GrpcTls{ + CaFile: ptr("testdata/server-certs/server.crt"), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, @@ -783,11 +799,13 @@ func Test_otlpGRPCLogExporter(t *testing.T) { args: args{ ctx: t.Context(), otlpConfig: &OTLPGrpcExporter{ - Compression: ptr("gzip"), - Timeout: ptr(5000), - CertificateFile: ptr("testdata/server-certs/server.crt"), - ClientKeyFile: ptr("testdata/client-certs/client.key"), - ClientCertificateFile: ptr("testdata/client-certs/client.crt"), + Compression: ptr("gzip"), + Timeout: ptr(5000), + Tls: &GrpcTls{ + CaFile: ptr("testdata/server-certs/server.crt"), + KeyFile: ptr("testdata/client-certs/client.key"), + CertFile: ptr("testdata/client-certs/client.crt"), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, diff --git a/otelconf/metric.go b/otelconf/metric.go index 57a1136d755..b02c519385f 100644 --- a/otelconf/metric.go +++ b/otelconf/metric.go @@ -206,12 +206,13 @@ func otlpHTTPMetricExporter(ctx context.Context, otlpConfig *OTLPHttpMetricExpor return nil, newErrInvalid(fmt.Sprintf("unsupported temporality preference %q", *otlpConfig.TemporalityPreference)) } } - - tlsConfig, err := tls.CreateConfig(otlpConfig.CertificateFile, otlpConfig.ClientCertificateFile, otlpConfig.ClientKeyFile) - if err != nil { - return nil, errors.Join(newErrInvalid("tls configuration"), err) + if otlpConfig.Tls != nil { + tlsConfig, err := tls.CreateConfig(otlpConfig.Tls.CaFile, otlpConfig.Tls.CertFile, otlpConfig.Tls.KeyFile) + if err != nil { + return nil, errors.Join(newErrInvalid("tls configuration"), err) + } + opts = append(opts, otlpmetrichttp.WithTLSClientConfig(tlsConfig)) } - opts = append(opts, otlpmetrichttp.WithTLSClientConfig(tlsConfig)) return otlpmetrichttp.New(ctx, opts...) } @@ -234,7 +235,7 @@ func otlpGRPCMetricExporter(ctx context.Context, otlpConfig *OTLPGrpcMetricExpor } else { opts = append(opts, otlpmetricgrpc.WithEndpoint(*otlpConfig.Endpoint)) } - if u.Scheme == "http" || (u.Scheme != "https" && otlpConfig.Insecure != nil && *otlpConfig.Insecure) { + if u.Scheme == "http" || (u.Scheme != "https" && otlpConfig.Tls != nil && otlpConfig.Tls.Insecure != nil && *otlpConfig.Tls.Insecure) { opts = append(opts, otlpmetricgrpc.WithInsecure()) } } @@ -272,8 +273,8 @@ func otlpGRPCMetricExporter(ctx context.Context, otlpConfig *OTLPGrpcMetricExpor } } - if otlpConfig.CertificateFile != nil || otlpConfig.ClientCertificateFile != nil || otlpConfig.ClientKeyFile != nil { - tlsConfig, err := tls.CreateConfig(otlpConfig.CertificateFile, otlpConfig.ClientCertificateFile, otlpConfig.ClientKeyFile) + if otlpConfig.Tls != nil && (otlpConfig.Tls.CaFile != nil || otlpConfig.Tls.CertFile != nil || otlpConfig.Tls.KeyFile != nil) { + tlsConfig, err := tls.CreateConfig(otlpConfig.Tls.CaFile, otlpConfig.Tls.CertFile, otlpConfig.Tls.KeyFile) if err != nil { return nil, errors.Join(newErrInvalid("tls configuration"), err) } @@ -400,11 +401,11 @@ func prometheusReader(ctx context.Context, prometheusConfig *ExperimentalPrometh return readerWithServer{reader, &server}, nil } -func validTranslationStrategy(strategy ExperimentalPrometheusMetricExporterTranslationStrategy) bool { - return strategy == ExperimentalPrometheusMetricExporterTranslationStrategyNoTranslation || - strategy == ExperimentalPrometheusMetricExporterTranslationStrategyNoUTF8EscapingWithSuffixes || - strategy == ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithSuffixes || - strategy == ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithoutSuffixes +func validTranslationStrategy(strategy ExperimentalPrometheusTranslationStrategy) bool { + return strategy == ExperimentalPrometheusTranslationStrategyNoTranslation || + strategy == ExperimentalPrometheusTranslationStrategyNoUtf8EscapingWithSuffixes || + strategy == ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithSuffixes || + strategy == ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithoutSuffixes } func prometheusReaderOpts(prometheusConfig *ExperimentalPrometheusMetricExporter) ([]otelprom.Option, error) { @@ -442,11 +443,7 @@ func (rws readerWithServer) Shutdown(ctx context.Context) error { } func view(v View) (sdkmetric.View, error) { - if v.Selector == nil { - return nil, errors.New("view: no selector provided") - } - - inst, err := instrument(*v.Selector) + inst, err := instrument(v.Selector) if err != nil { return nil, err } @@ -480,11 +477,7 @@ func instrument(vs ViewSelector) (sdkmetric.Instrument, error) { return inst, nil } -func stream(vs *ViewStream) (sdkmetric.Stream, error) { - if vs == nil { - return sdkmetric.Stream{}, nil - } - +func stream(vs ViewStream) (sdkmetric.Stream, error) { f, err := newIncludeExcludeFilter(vs.AttributeKeys) if err != nil { return sdkmetric.Stream{}, err diff --git a/otelconf/metric_test.go b/otelconf/metric_test.go index f3e61754dde..d1ec9ccd0be 100644 --- a/otelconf/metric_test.go +++ b/otelconf/metric_test.go @@ -54,7 +54,7 @@ func TestMeterProvider(t *testing.T) { name: "error-in-config", cfg: configOptions{ opentelemetryConfig: OpenTelemetryConfiguration{ - MeterProvider: &MeterProviderJson{ + MeterProvider: &MeterProvider{ Readers: []MetricReader{ { Periodic: &PeriodicMetricReader{}, @@ -71,7 +71,7 @@ func TestMeterProvider(t *testing.T) { name: "multiple-errors-in-config", cfg: configOptions{ opentelemetryConfig: OpenTelemetryConfiguration{ - MeterProvider: &MeterProviderJson{ + MeterProvider: &MeterProvider{ Readers: []MetricReader{ { Periodic: &PeriodicMetricReader{}, @@ -80,7 +80,7 @@ func TestMeterProvider(t *testing.T) { { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ - Console: ConsoleExporter{}, + Console: &ConsoleMetricExporter{}, OTLPGrpc: &OTLPGrpcMetricExporter{}, }, }, @@ -111,7 +111,7 @@ func TestMeterProviderOptions(t *testing.T) { defer srv.Close() cfg := OpenTelemetryConfiguration{ - MeterProvider: &MeterProviderJson{ + MeterProvider: &MeterProvider{ Readers: []MetricReader{{ Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ @@ -216,7 +216,7 @@ func TestReader(t *testing.T) { Host: ptr("localhost"), Port: ptr(0), WithoutScopeInfo: ptr(true), - TranslationStrategy: ptr(ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithoutSuffixes), + TranslationStrategy: ptr(ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithoutSuffixes), WithResourceConstantLabels: &IncludeExclude{ Included: []string{"include"}, Excluded: []string{"exclude"}, @@ -236,7 +236,7 @@ func TestReader(t *testing.T) { Host: ptr("localhost"), Port: ptr(0), WithoutScopeInfo: ptr(true), - TranslationStrategy: ptr(ExperimentalPrometheusMetricExporterTranslationStrategy("invalid-strategy")), + TranslationStrategy: ptr(ExperimentalPrometheusTranslationStrategy("invalid-strategy")), WithResourceConstantLabels: &IncludeExclude{ Included: []string{"include"}, Excluded: []string{"exclude"}, @@ -289,10 +289,12 @@ func TestReader(t *testing.T) { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPGrpc: &OTLPGrpcMetricExporter{ - Endpoint: ptr("https://localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "ca.crt")), + Endpoint: ptr("https://localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + CaFile: ptr(filepath.Join("testdata", "ca.crt")), + }, }, }, }, @@ -305,10 +307,12 @@ func TestReader(t *testing.T) { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPGrpc: &OTLPGrpcMetricExporter{ - Endpoint: ptr("https://localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("https://localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + CaFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -321,11 +325,13 @@ func TestReader(t *testing.T) { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPGrpc: &OTLPGrpcMetricExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - ClientCertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), - ClientKeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + KeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + CertFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -555,10 +561,12 @@ func TestReader(t *testing.T) { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPHttp: &OTLPHttpMetricExporter{ - Endpoint: ptr("https://localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "ca.crt")), + Endpoint: ptr("https://localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + CaFile: ptr(filepath.Join("testdata", "ca.crt")), + }, }, }, }, @@ -571,10 +579,12 @@ func TestReader(t *testing.T) { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPHttp: &OTLPHttpMetricExporter{ - Endpoint: ptr("https://localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("https://localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + CaFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -587,11 +597,13 @@ func TestReader(t *testing.T) { Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ OTLPHttp: &OTLPHttpMetricExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - ClientCertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), - ClientKeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + KeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + CertFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -811,7 +823,7 @@ func TestReader(t *testing.T) { reader: MetricReader{ Periodic: &PeriodicMetricReader{ Exporter: PushMetricExporter{ - Console: ConsoleExporter{}, + Console: &ConsoleMetricExporter{}, }, }, }, @@ -824,7 +836,7 @@ func TestReader(t *testing.T) { Interval: ptr(30_000), Timeout: ptr(5_000), Exporter: PushMetricExporter{ - Console: ConsoleExporter{}, + Console: &ConsoleMetricExporter{}, }, }, }, @@ -882,14 +894,10 @@ func TestView(t *testing.T) { wantStream sdkmetric.Stream wantResult bool }{ - { - name: "no selector", - wantErr: "view: no selector provided", - }, { name: "selector/invalid_type", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentType: (*InstrumentType)(ptr("invalid_type")), }, }, @@ -898,14 +906,14 @@ func TestView(t *testing.T) { { name: "selector/invalid_type", view: View{ - Selector: &ViewSelector{}, + Selector: ViewSelector{}, }, wantErr: "view_selector: empty selector not supporter", }, { name: "all selectors match", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: ptr(InstrumentTypeCounter), Unit: ptr("test_unit"), @@ -930,7 +938,7 @@ func TestView(t *testing.T) { { name: "all selectors no match name", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: ptr(InstrumentTypeCounter), Unit: ptr("test_unit"), @@ -955,7 +963,7 @@ func TestView(t *testing.T) { { name: "all selectors no match unit", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: ptr(InstrumentTypeCounter), Unit: ptr("test_unit"), @@ -980,7 +988,7 @@ func TestView(t *testing.T) { { name: "all selectors no match kind", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: (*InstrumentType)(ptr("histogram")), Unit: ptr("test_unit"), @@ -1005,7 +1013,7 @@ func TestView(t *testing.T) { { name: "all selectors no match meter name", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: ptr(InstrumentTypeCounter), Unit: ptr("test_unit"), @@ -1030,7 +1038,7 @@ func TestView(t *testing.T) { { name: "all selectors no match meter version", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: ptr(InstrumentTypeCounter), Unit: ptr("test_unit"), @@ -1055,7 +1063,7 @@ func TestView(t *testing.T) { { name: "all selectors no match meter schema url", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), InstrumentType: ptr(InstrumentTypeCounter), Unit: ptr("test_unit"), @@ -1080,11 +1088,11 @@ func TestView(t *testing.T) { { name: "with stream", view: View{ - Selector: &ViewSelector{ + Selector: ViewSelector{ InstrumentName: ptr("test_name"), Unit: ptr("test_unit"), }, - Stream: &ViewStream{ + Stream: ViewStream{ Name: ptr("new_name"), Description: ptr("new_description"), AttributeKeys: ptr(IncludeExclude{Included: []string{"foo", "bar"}}), @@ -1361,7 +1369,7 @@ func TestPrometheusReaderOpts(t *testing.T) { name: "all set", cfg: ExperimentalPrometheusMetricExporter{ WithoutScopeInfo: ptr(true), - TranslationStrategy: ptr(ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithoutSuffixes), + TranslationStrategy: ptr(ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithoutSuffixes), WithResourceConstantLabels: &IncludeExclude{}, }, wantOptions: 3, @@ -1370,7 +1378,7 @@ func TestPrometheusReaderOpts(t *testing.T) { name: "all set false", cfg: ExperimentalPrometheusMetricExporter{ WithoutScopeInfo: ptr(false), - TranslationStrategy: ptr(ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithSuffixes), + TranslationStrategy: ptr(ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithSuffixes), WithResourceConstantLabels: &IncludeExclude{}, }, wantOptions: 2, @@ -1406,7 +1414,7 @@ func TestPrometheusIPv6(t *testing.T) { Host: &tt.host, Port: &port, WithoutScopeInfo: ptr(true), - TranslationStrategy: ptr(ExperimentalPrometheusMetricExporterTranslationStrategyUnderscoreEscapingWithSuffixes), + TranslationStrategy: ptr(ExperimentalPrometheusTranslationStrategyUnderscoreEscapingWithSuffixes), WithResourceConstantLabels: &IncludeExclude{}, } @@ -1451,7 +1459,9 @@ func Test_otlpGRPCMetricExporter(t *testing.T) { otlpConfig: &OTLPGrpcMetricExporter{ Compression: ptr("gzip"), Timeout: ptr(5000), - Insecure: ptr(true), + Tls: &GrpcTls{ + Insecure: ptr(true), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, @@ -1466,9 +1476,11 @@ func Test_otlpGRPCMetricExporter(t *testing.T) { args: args{ ctx: t.Context(), otlpConfig: &OTLPGrpcMetricExporter{ - Compression: ptr("gzip"), - Timeout: ptr(5000), - CertificateFile: ptr("testdata/server-certs/server.crt"), + Compression: ptr("gzip"), + Timeout: ptr(5000), + Tls: &GrpcTls{ + CaFile: ptr("testdata/server-certs/server.crt"), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, @@ -1489,11 +1501,13 @@ func Test_otlpGRPCMetricExporter(t *testing.T) { args: args{ ctx: t.Context(), otlpConfig: &OTLPGrpcMetricExporter{ - Compression: ptr("gzip"), - Timeout: ptr(5000), - CertificateFile: ptr("testdata/server-certs/server.crt"), - ClientKeyFile: ptr("testdata/client-certs/client.key"), - ClientCertificateFile: ptr("testdata/client-certs/client.crt"), + Compression: ptr("gzip"), + Timeout: ptr(5000), + Tls: &GrpcTls{ + CaFile: ptr("testdata/server-certs/server.crt"), + KeyFile: ptr("testdata/client-certs/client.key"), + CertFile: ptr("testdata/client-certs/client.crt"), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, diff --git a/otelconf/propagator.go b/otelconf/propagator.go index 86316473ac4..8980f91a6a5 100644 --- a/otelconf/propagator.go +++ b/otelconf/propagator.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/contrib/propagators/autoprop" ) -func newPropagator(p *PropagatorJson) (propagation.TextMapPropagator, error) { +func newPropagator(p *Propagator) (propagation.TextMapPropagator, error) { if p == nil { return propagation.NewCompositeTextMapPropagator(), nil } diff --git a/otelconf/propagator_test.go b/otelconf/propagator_test.go index f3d8f78af42..c791722521a 100644 --- a/otelconf/propagator_test.go +++ b/otelconf/propagator_test.go @@ -13,7 +13,7 @@ import ( func TestPropagator(t *testing.T) { tests := []struct { name string - cfg *PropagatorJson + cfg *Propagator want []string wantErr bool errMsg string @@ -26,7 +26,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid tracecontext", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { Tracecontext: TraceContextPropagator{}, @@ -38,7 +38,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid baggage", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { Baggage: BaggagePropagator{}, @@ -50,7 +50,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid b3", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { B3: B3Propagator{}, @@ -62,7 +62,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid b3multi", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { B3Multi: B3MultiPropagator{}, @@ -74,7 +74,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid jaeger", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { Jaeger: JaegerPropagator{}, @@ -86,7 +86,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid ottrace", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { Ottrace: OpenTracingPropagator{}, @@ -98,7 +98,7 @@ func TestPropagator(t *testing.T) { }, { name: "multiple propagators", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ { Tracecontext: TraceContextPropagator{}, @@ -116,7 +116,7 @@ func TestPropagator(t *testing.T) { }, { name: "empty composite", - cfg: &PropagatorJson{ + cfg: &Propagator{ Composite: []TextMapPropagator{ {}, }, @@ -126,7 +126,7 @@ func TestPropagator(t *testing.T) { }, { name: "multiple propagators via composite_list", - cfg: &PropagatorJson{ + cfg: &Propagator{ CompositeList: ptr("tracecontext,baggage,b3"), }, want: []string{"tracestate", "baggage", "x-b3-traceid", "x-b3-spanid", "x-b3-sampled", "x-b3-flags", "traceparent"}, @@ -134,7 +134,7 @@ func TestPropagator(t *testing.T) { }, { name: "valid xray", - cfg: &PropagatorJson{ + cfg: &Propagator{ CompositeList: ptr("xray"), }, want: []string{"X-Amzn-Trace-Id"}, @@ -142,7 +142,7 @@ func TestPropagator(t *testing.T) { }, { name: "empty propagator name", - cfg: &PropagatorJson{ + cfg: &Propagator{ CompositeList: ptr(""), }, want: []string{}, @@ -151,7 +151,7 @@ func TestPropagator(t *testing.T) { }, { name: "unsupported propagator", - cfg: &PropagatorJson{ + cfg: &Propagator{ CompositeList: ptr("random-garbage,baggage,b3"), }, want: []string{}, diff --git a/otelconf/resource.go b/otelconf/resource.go index 9c965951ef4..cab0aeb9aaf 100644 --- a/otelconf/resource.go +++ b/otelconf/resource.go @@ -30,7 +30,7 @@ func resourceOpts(detectors []ExperimentalResourceDetector) []resource.Option { return opts } -func newResource(r *ResourceJson) (*resource.Resource, error) { +func newResource(r *Resource) (*resource.Resource, error) { if r == nil { return resource.Default(), nil } diff --git a/otelconf/resource_test.go b/otelconf/resource_test.go index 025e6398b91..1fa49dac647 100644 --- a/otelconf/resource_test.go +++ b/otelconf/resource_test.go @@ -16,7 +16,7 @@ import ( func TestNewResource(t *testing.T) { tests := []struct { name string - config *ResourceJson + config *Resource wantResource *resource.Resource wantErrT error }{ @@ -26,19 +26,19 @@ func TestNewResource(t *testing.T) { }, { name: "resource-no-attributes", - config: &ResourceJson{}, + config: &Resource{}, wantResource: resource.NewSchemaless(), }, { name: "resource-with-schema", - config: &ResourceJson{ + config: &Resource{ SchemaUrl: ptr(semconv.SchemaURL), }, wantResource: resource.NewWithAttributes(semconv.SchemaURL), }, { name: "resource-with-attributes", - config: &ResourceJson{ + config: &Resource{ Attributes: []AttributeNameValue{ {Name: string(semconv.ServiceNameKey), Value: "service-a"}, }, @@ -49,7 +49,7 @@ func TestNewResource(t *testing.T) { }, { name: "resource-with-attributes-and-schema", - config: &ResourceJson{ + config: &Resource{ Attributes: []AttributeNameValue{ {Name: string(semconv.ServiceNameKey), Value: "service-a"}, }, @@ -61,7 +61,7 @@ func TestNewResource(t *testing.T) { }, { name: "resource-with-additional-attributes-and-schema", - config: &ResourceJson{ + config: &Resource{ Attributes: []AttributeNameValue{ {Name: string(semconv.ServiceNameKey), Value: "service-a"}, {Name: "attr-bool", Value: true}, diff --git a/otelconf/testdata/v1.0.0.json b/otelconf/testdata/v1.0.0.json index ef936596658..9a66e243917 100644 --- a/otelconf/testdata/v1.0.0.json +++ b/otelconf/testdata/v1.0.0.json @@ -17,9 +17,11 @@ "exporter": { "otlp_http": { "endpoint": "http://localhost:4318/v1/logs", - "certificate_file": "testdata/ca.crt", - "client_key_file": "testdata/client.key", - "client_certificate_file": "testdata/client.crt", + "tls": { + "ca_file": "testdata/ca.crt", + "key_file": "testdata/client.key", + "cert_file": "testdata/client.crt" + }, "headers": [ { "name": "api-key", @@ -39,9 +41,12 @@ "exporter": { "otlp_grpc": { "endpoint": "http://localhost:4317", - "certificate_file": "testdata/ca.crt", - "client_key_file": "testdata/client.key", - "client_certificate_file": "testdata/client.crt", + "tls": { + "ca_file": "testdata/ca.crt", + "key_file": "testdata/client.key", + "cert_file": "testdata/client.crt", + "insecure": false + }, "headers": [ { "name": "api-key", @@ -50,8 +55,7 @@ ], "headers_list": "api-key=1234", "compression": "gzip", - "timeout": 10000, - "insecure": false + "timeout": 10000 } } } @@ -117,7 +121,7 @@ "service.attr1" ] }, - "translation_strategy": "UnderscoreEscapingWithSuffixes" + "translation_strategy": "underscore_escaping_with_suffixes" } }, "producers": [ @@ -144,9 +148,11 @@ "exporter": { "otlp_http": { "endpoint": "http://localhost:4318/v1/metrics", - "certificate_file": "testdata/ca.crt", - "client_key_file": "testdata/client.key", - "client_certificate_file": "testdata/client.crt", + "tls": { + "ca_file": "testdata/ca.crt", + "key_file": "testdata/client.key", + "cert_file": "testdata/client.crt" + }, "headers": [ { "name": "api-key", @@ -183,9 +189,12 @@ "exporter": { "otlp_grpc": { "endpoint": "http://localhost:4317", - "certificate_file": "testdata/ca.crt", - "client_key_file": "testdata/client.key", - "client_certificate_file": "testdata/client.crt", + "tls": { + "ca_file": "testdata/ca.crt", + "key_file": "testdata/client.key", + "cert_file": "testdata/client.crt", + "insecure": false + }, "headers": [ { "name": "api-key", @@ -195,7 +204,6 @@ "headers_list": "api-key=1234", "compression": "gzip", "timeout": 10000, - "insecure": false, "temporality_preference": "delta", "default_histogram_aggregation": "base2_exponential_bucket_histogram" } @@ -329,9 +337,11 @@ "exporter": { "otlp_http": { "endpoint": "http://localhost:4318/v1/traces", - "certificate_file": "testdata/ca.crt", - "client_key_file": "testdata/client.key", - "client_certificate_file": "testdata/client.crt", + "tls": { + "ca_file": "testdata/ca.crt", + "key_file": "testdata/client.key", + "cert_file": "testdata/client.crt" + }, "headers": [ { "name": "api-key", @@ -351,9 +361,12 @@ "exporter": { "otlp_grpc": { "endpoint": "http://localhost:4317", - "certificate_file": "testdata/ca.crt", - "client_key_file": "testdata/client.key", - "client_certificate_file": "testdata/client.crt", + "tls": { + "ca_file": "testdata/ca.crt", + "key_file": "testdata/client.key", + "cert_file": "testdata/client.crt", + "insecure": false + }, "headers": [ { "name": "api-key", @@ -362,8 +375,7 @@ ], "headers_list": "api-key=1234", "compression": "gzip", - "timeout": 10000, - "insecure": false + "timeout": 10000 } } } @@ -386,16 +398,6 @@ } } }, - { - "batch": { - "exporter": { - "zipkin": { - "endpoint": "http://localhost:9411/api/v2/spans", - "timeout": 10000 - } - } - } - }, { "simple": { "exporter": { diff --git a/otelconf/testdata/v1.0.0.yaml b/otelconf/testdata/v1.0.0.yaml index cad6d14798f..09d5fa3afa7 100644 --- a/otelconf/testdata/v1.0.0.yaml +++ b/otelconf/testdata/v1.0.0.yaml @@ -51,18 +51,19 @@ logger_provider: # Configure exporter to be OTLP with HTTP transport. otlp_http: endpoint: http://localhost:4318/v1/logs - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: testdata/ca.crt - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: testdata/client.key - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: testdata/client.crt + tls: + # Configure certificate used to verify a server's TLS credentials. + # Absolute path to certificate file in PEM format. + # If omitted or null, system default certificate verification is used for secure connections. + ca_file: testdata/ca.crt + # Configure mTLS private client key. + # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + # If omitted or null, mTLS is not used. + key_file: testdata/client.key + # Configure mTLS client certificate. + # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + # If omitted or null, mTLS is not used. + cert_file: testdata/client.crt # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: @@ -93,18 +94,23 @@ logger_provider: # Configure endpoint. # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: testdata/ca.crt - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: testdata/client.key - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: testdata/client.crt + tls: + # Configure certificate used to verify a server's TLS credentials. + # Absolute path to certificate file in PEM format. + # If omitted or null, system default certificate verification is used for secure connections. + ca_file: testdata/ca.crt + # Configure mTLS private client key. + # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + # If omitted or null, mTLS is not used. + key_file: testdata/client.key + # Configure mTLS client certificate. + # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + # If omitted or null, mTLS is not used. + cert_file: testdata/client.crt + # Configure client transport security for the exporter's connection. + # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + # If omitted or null, false is used. + insecure: false # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: @@ -122,10 +128,6 @@ logger_provider: # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. - # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - # If omitted or null, false is used. - insecure: false - # Configure a batch log record processor. batch: # Configure exporter. @@ -221,13 +223,13 @@ meter_provider: - "service.attr1" # Configure how Prometheus metrics are exposed. Values include: # - # * UnderscoreEscapingWithSuffixes, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes. - # * UnderscoreEscapingWithoutSuffixes, metric names will continue to escape special characters to _, but suffixes won't be attached. - # * NoUTF8EscapingWithSuffixes will disable changing special characters to _. Special suffixes like units and _total for counters will be attached. - # * NoTranslation. This strategy bypasses all metric and label name translation, passing them through unaltered. + # * underscore_escaping_with_suffixes, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes. + # * underscore_escaping_without_suffixes, metric names will continue to escape special characters to _, but suffixes won't be attached. + # * no_utf8_escaping_with_suffixes will disable changing special characters to _. Special suffixes like units and _total for counters will be attached. + # * no_translation. This strategy bypasses all metric and label name translation, passing them through unaltered. # - # If omitted or null, UnderscoreEscapingWithSuffixes is used. - translation_strategy: UnderscoreEscapingWithSuffixes + # If omitted or null, underscore_escaping_with_suffixes is used. + translation_strategy: underscore_escaping_with_suffixes # Configure metric producers. producers: - # Configure metric producer to be opencensus. @@ -276,18 +278,19 @@ meter_provider: # Configure endpoint, including the metric specific path. # If omitted or null, http://localhost:4318/v1/metrics is used. endpoint: http://localhost:4318/v1/metrics - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: testdata/ca.crt - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: testdata/client.key - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: testdata/client.crt + tls: + # Configure certificate used to verify a server's TLS credentials. + # Absolute path to certificate file in PEM format. + # If omitted or null, system default certificate verification is used for secure connections. + ca_file: testdata/ca.crt + # Configure mTLS private client key. + # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + # If omitted or null, mTLS is not used. + key_file: testdata/client.key + # Configure mTLS client certificate. + # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + # If omitted or null, mTLS is not used. + cert_file: testdata/client.crt # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: @@ -357,18 +360,23 @@ meter_provider: # Configure endpoint. # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: testdata/ca.crt - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: testdata/client.key - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: testdata/client.crt + tls: + # Configure certificate used to verify a server's TLS credentials. + # Absolute path to certificate file in PEM format. + # If omitted or null, system default certificate verification is used for secure connections. + ca_file: testdata/ca.crt + # Configure mTLS private client key. + # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + # If omitted or null, mTLS is not used. + key_file: testdata/client.key + # Configure mTLS client certificate. + # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + # If omitted or null, mTLS is not used. + cert_file: testdata/client.crt + # Configure client transport security for the exporter's connection. + # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + # If omitted or null, false is used. + insecure: false # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: @@ -386,10 +394,6 @@ meter_provider: # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. - # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - # If omitted or null, false is used. - insecure: false # Configure temporality preference. # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. # If omitted or null, cumulative is used. @@ -588,18 +592,19 @@ tracer_provider: # Configure endpoint, including the trace specific path. # If omitted or null, http://localhost:4318/v1/traces is used. endpoint: http://localhost:4318/v1/traces - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: testdata/ca.crt - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: testdata/client.key - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: testdata/client.crt + tls: + # Configure certificate used to verify a server's TLS credentials. + # Absolute path to certificate file in PEM format. + # If omitted or null, system default certificate verification is used for secure connections. + ca_file: testdata/ca.crt + # Configure mTLS private client key. + # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + # If omitted or null, mTLS is not used. + key_file: testdata/client.key + # Configure mTLS client certificate. + # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + # If omitted or null, mTLS is not used. + cert_file: testdata/client.crt # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: @@ -630,18 +635,23 @@ tracer_provider: # Configure endpoint. # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: testdata/ca.crt - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: testdata/client.key - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: testdata/client.crt + tls: + # Configure certificate used to verify a server's TLS credentials. + # Absolute path to certificate file in PEM format. + # If omitted or null, system default certificate verification is used for secure connections. + ca_file: testdata/ca.crt + # Configure mTLS private client key. + # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + # If omitted or null, mTLS is not used. + key_file: testdata/client.key + # Configure mTLS client certificate. + # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + # If omitted or null, mTLS is not used. + cert_file: testdata/client.crt + # Configure client transport security for the exporter's connection. + # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. + # If omitted or null, false is used. + insecure: false # Configure headers. Entries have higher priority than entries from .headers_list. # If an entry's .value is null, the entry is ignored. headers: @@ -659,10 +669,6 @@ tracer_provider: # Value must be non-negative. A value of 0 indicates no limit (infinity). # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. - # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - # If omitted or null, false is used. - insecure: false - # Configure a batch span processor. batch: # Configure exporter. @@ -685,19 +691,6 @@ tracer_provider: # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. # If omitted or null, stdout is used. output_stream: stdout - - # Configure a batch span processor. - batch: - # Configure exporter. - exporter: - # Configure exporter to be zipkin. - zipkin: - # Configure endpoint. - # If omitted or null, http://localhost:9411/api/v2/spans is used. - endpoint: http://localhost:9411/api/v2/spans - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates indefinite. - # If omitted or null, 10000 is used. - timeout: 10000 - # Configure a simple span processor. simple: # Configure exporter. diff --git a/otelconf/trace.go b/otelconf/trace.go index 4efa68b673e..f0de96bd192 100644 --- a/otelconf/trace.go +++ b/otelconf/trace.go @@ -155,10 +155,6 @@ func spanExporter(ctx context.Context, exporter SpanExporter) (sdktrace.SpanExpo // TODO: implement file exporter https://github.com/open-telemetry/opentelemetry-go/issues/5408 return nil, newErrInvalid("otlp_file/development") } - if exporter.Zipkin != nil { - // TODO: implement zipkin exporter - return nil, newErrInvalid("zipkin") - } if exportersConfigured > 1 { return nil, newErrInvalid("must not specify multiple exporters") @@ -210,7 +206,7 @@ func otlpGRPCSpanExporter(ctx context.Context, otlpConfig *OTLPGrpcExporter) (sd opts = append(opts, otlptracegrpc.WithEndpoint(*otlpConfig.Endpoint)) } - if u.Scheme == "http" || (u.Scheme != "https" && otlpConfig.Insecure != nil && *otlpConfig.Insecure) { + if u.Scheme == "http" || (u.Scheme != "https" && otlpConfig.Tls != nil && otlpConfig.Tls.Insecure != nil && *otlpConfig.Tls.Insecure) { opts = append(opts, otlptracegrpc.WithInsecure()) } } @@ -236,8 +232,8 @@ func otlpGRPCSpanExporter(ctx context.Context, otlpConfig *OTLPGrpcExporter) (sd opts = append(opts, otlptracegrpc.WithHeaders(headersConfig)) } - if otlpConfig.CertificateFile != nil || otlpConfig.ClientCertificateFile != nil || otlpConfig.ClientKeyFile != nil { - tlsConfig, err := tls.CreateConfig(otlpConfig.CertificateFile, otlpConfig.ClientCertificateFile, otlpConfig.ClientKeyFile) + if otlpConfig.Tls != nil && (otlpConfig.Tls.CaFile != nil || otlpConfig.Tls.CertFile != nil || otlpConfig.Tls.KeyFile != nil) { + tlsConfig, err := tls.CreateConfig(otlpConfig.Tls.CaFile, otlpConfig.Tls.CertFile, otlpConfig.Tls.KeyFile) if err != nil { return nil, errors.Join(newErrInvalid("tls configuration"), err) } @@ -285,11 +281,13 @@ func otlpHTTPSpanExporter(ctx context.Context, otlpConfig *OTLPHttpExporter) (sd opts = append(opts, otlptracehttp.WithHeaders(headersConfig)) } - tlsConfig, err := tls.CreateConfig(otlpConfig.CertificateFile, otlpConfig.ClientCertificateFile, otlpConfig.ClientKeyFile) - if err != nil { - return nil, errors.Join(newErrInvalid("tls configuration"), err) + if otlpConfig.Tls != nil { + tlsConfig, err := tls.CreateConfig(otlpConfig.Tls.CaFile, otlpConfig.Tls.CertFile, otlpConfig.Tls.KeyFile) + if err != nil { + return nil, errors.Join(newErrInvalid("tls configuration"), err) + } + opts = append(opts, otlptracehttp.WithTLSClientConfig(tlsConfig)) } - opts = append(opts, otlptracehttp.WithTLSClientConfig(tlsConfig)) return otlptracehttp.New(ctx, opts...) } diff --git a/otelconf/trace_test.go b/otelconf/trace_test.go index 2b32c2d6b07..c7dc2270a44 100644 --- a/otelconf/trace_test.go +++ b/otelconf/trace_test.go @@ -49,7 +49,7 @@ func TestTracerProvider(t *testing.T) { name: "error-in-config", cfg: configOptions{ opentelemetryConfig: OpenTelemetryConfiguration{ - TracerProvider: &TracerProviderJson{ + TracerProvider: &TracerProvider{ Processors: []SpanProcessor{ { Batch: &BatchSpanProcessor{}, @@ -66,7 +66,7 @@ func TestTracerProvider(t *testing.T) { name: "multiple-errors-in-config", cfg: configOptions{ opentelemetryConfig: OpenTelemetryConfiguration{ - TracerProvider: &TracerProviderJson{ + TracerProvider: &TracerProvider{ Processors: []SpanProcessor{ { Batch: &BatchSpanProcessor{}, @@ -91,7 +91,7 @@ func TestTracerProvider(t *testing.T) { name: "invalid-sampler-config", cfg: configOptions{ opentelemetryConfig: OpenTelemetryConfiguration{ - TracerProvider: &TracerProviderJson{ + TracerProvider: &TracerProvider{ Processors: []SpanProcessor{ { Simple: &SimpleSpanProcessor{ @@ -127,7 +127,7 @@ func TestTracerProviderOptions(t *testing.T) { defer srv.Close() cfg := OpenTelemetryConfiguration{ - TracerProvider: &TracerProviderJson{ + TracerProvider: &TracerProvider{ Processors: []SpanProcessor{{ Simple: &SimpleSpanProcessor{ Exporter: SpanExporter{ @@ -355,10 +355,12 @@ func TestSpanProcessor(t *testing.T) { Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPGrpc: &OTLPGrpcExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "ca.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + CaFile: ptr(filepath.Join("testdata", "ca.crt")), + }, }, }, }, @@ -371,10 +373,12 @@ func TestSpanProcessor(t *testing.T) { Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPGrpc: &OTLPGrpcExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + CaFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -387,11 +391,13 @@ func TestSpanProcessor(t *testing.T) { Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPGrpc: &OTLPGrpcExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - ClientCertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), - ClientKeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &GrpcTls{ + KeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + CertFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -508,10 +514,12 @@ func TestSpanProcessor(t *testing.T) { Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPHttp: &OTLPHttpExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "ca.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + CaFile: ptr(filepath.Join("testdata", "ca.crt")), + }, }, }, }, @@ -524,10 +532,12 @@ func TestSpanProcessor(t *testing.T) { Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPHttp: &OTLPHttpExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - CertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + CaFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -540,11 +550,13 @@ func TestSpanProcessor(t *testing.T) { Batch: &BatchSpanProcessor{ Exporter: SpanExporter{ OTLPHttp: &OTLPHttpExporter{ - Endpoint: ptr("localhost:4317"), - Compression: ptr("gzip"), - Timeout: ptr(1000), - ClientCertificateFile: ptr(filepath.Join("testdata", "bad_cert.crt")), - ClientKeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + Endpoint: ptr("localhost:4317"), + Compression: ptr("gzip"), + Timeout: ptr(1000), + Tls: &HttpTls{ + KeyFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + CertFile: ptr(filepath.Join("testdata", "bad_cert.crt")), + }, }, }, }, @@ -729,17 +741,6 @@ func TestSpanProcessor(t *testing.T) { }, wantErrT: newErrInvalid("otlp_file/development"), }, - { - name: "simple/zipkin", - processor: SpanProcessor{ - Simple: &SimpleSpanProcessor{ - Exporter: SpanExporter{ - Zipkin: &ZipkinSpanExporter{}, - }, - }, - }, - wantErrT: newErrInvalid("zipkin"), - }, { name: "simple/multiple", processor: SpanProcessor{ @@ -915,7 +916,9 @@ func Test_otlpGRPCTraceExporter(t *testing.T) { otlpConfig: &OTLPGrpcExporter{ Compression: ptr("gzip"), Timeout: ptr(5000), - Insecure: ptr(true), + Tls: &GrpcTls{ + Insecure: ptr(true), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, @@ -930,9 +933,11 @@ func Test_otlpGRPCTraceExporter(t *testing.T) { args: args{ ctx: t.Context(), otlpConfig: &OTLPGrpcExporter{ - Compression: ptr("gzip"), - Timeout: ptr(5000), - CertificateFile: ptr("testdata/server-certs/server.crt"), + Compression: ptr("gzip"), + Timeout: ptr(5000), + Tls: &GrpcTls{ + CaFile: ptr("testdata/server-certs/server.crt"), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, @@ -953,11 +958,13 @@ func Test_otlpGRPCTraceExporter(t *testing.T) { args: args{ ctx: t.Context(), otlpConfig: &OTLPGrpcExporter{ - Compression: ptr("gzip"), - Timeout: ptr(5000), - CertificateFile: ptr("testdata/server-certs/server.crt"), - ClientKeyFile: ptr("testdata/client-certs/client.key"), - ClientCertificateFile: ptr("testdata/client-certs/client.crt"), + Compression: ptr("gzip"), + Timeout: ptr(5000), + Tls: &GrpcTls{ + CaFile: ptr("testdata/server-certs/server.crt"), + KeyFile: ptr("testdata/client-certs/client.key"), + CertFile: ptr("testdata/client-certs/client.crt"), + }, Headers: []NameStringValuePair{ {Name: "test", Value: ptr("test1")}, }, From d93441b4257402dd3fc5828494cba390edce8c53 Mon Sep 17 00:00:00 2001 From: alex boten <223565+codeboten@users.noreply.github.com> Date: Thu, 5 Feb 2026 12:44:02 -0800 Subject: [PATCH 2/4] add changelog Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com> --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3430988ccf9..1866756e704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Enforce that `client_certificate_file` and `client_key_file` are provided together in `go.opentelemetry.io/contrib/otelconf`. (#8450) +### Changed + +- Updated the configuration schema used in `go.opentelemetry.io/contrib/otelconf` to [rc.3](https://github.com/open-telemetry/opentelemetry-configuration/releases/tag/v1.0.0-rc.3). (#8505) + From fcd65a90ba57f1b556dfb6a87c730ddab43b438a Mon Sep 17 00:00:00 2001 From: alex boten <223565+codeboten@users.noreply.github.com> Date: Thu, 5 Feb 2026 16:16:43 -0800 Subject: [PATCH 3/4] add links to ignore Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com> --- .lycheeignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.lycheeignore b/.lycheeignore index c42593ea9d7..5799b1b379b 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -6,4 +6,6 @@ localhost:14250 file:///var/log/logs.jsonl file:///var/log/metrics.jsonl file:///var/log/traces.jsonl -file:///path/to/file.jsonl \ No newline at end of file +file:///path/to/file.jsonl +https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/registry +https://api.github.com/repos/open-telemetry/opentelemetry-configuration/tarball/$%7BOPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION%7D \ No newline at end of file From fddc48f9e93ab41e6307372ebdcfbb634224c738 Mon Sep 17 00:00:00 2001 From: alex boten <223565+codeboten@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:09:01 -0800 Subject: [PATCH 4/4] variable was used only in one place, removing Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com> --- .lycheeignore | 3 +-- Makefile | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.lycheeignore b/.lycheeignore index 5799b1b379b..3e1190540f0 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -7,5 +7,4 @@ file:///var/log/logs.jsonl file:///var/log/metrics.jsonl file:///var/log/traces.jsonl file:///path/to/file.jsonl -https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/registry -https://api.github.com/repos/open-telemetry/opentelemetry-configuration/tarball/$%7BOPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION%7D \ No newline at end of file +https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/registry \ No newline at end of file diff --git a/Makefile b/Makefile index c9b2f9b8111..3bd1fbd3463 100644 --- a/Makefile +++ b/Makefile @@ -322,9 +322,6 @@ update-all-otel-deps: # The source directory for opentelemetry-configuration schema. OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR=tmp/opentelemetry-configuration -# The SHA matching the current version of the opentelemetry-configuration schema to use -OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION=v1.0.0-rc.3 - # Cleanup temporary directory genjsonschema-cleanup: rm -Rf ${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR} @@ -334,7 +331,7 @@ GENERATED_CONFIG=./otelconf/generated_config.go # Generate structs for configuration from opentelemetry-configuration schema genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA) mkdir -p ${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR} - curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-configuration/tarball/${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR} + curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-configuration/tarball/v1.0.0-rc.3 | tar xz --strip 1 -C ${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR} $(GOJSONSCHEMA) \ --capitalization ID \ --capitalization OTLP \