diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go index e3e8df2ad14..7f86f1d8fc1 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("sample") + Type = component.MustNewType("sample") + ScopeName = "go.opentelemetry.io/collector/internal/receiver/samplereceiver" ) const ( diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go index 8ae0086c0a9..0626d810b93 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_telemetry.go @@ -14,14 +14,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/internal/receiver/samplereceiver" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/internal/receiver/samplereceiver") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/internal/receiver/samplereceiver") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go index d0df9f483d8..62c2159fe63 100644 --- a/cmd/mdatagen/main_test.go +++ b/cmd/mdatagen/main_test.go @@ -462,7 +462,8 @@ import ( ) var ( - Type = component.MustNewType("foo") + Type = component.MustNewType("foo") + ScopeName = "" ) const ( @@ -491,7 +492,8 @@ import ( ) var ( - Type = component.MustNewType("foo") + Type = component.MustNewType("foo") + ScopeName = "" ) const ( @@ -546,14 +548,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("") } `, }, @@ -582,14 +582,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("") } `, }, diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/templates/status.go.tmpl index b90047f7dd0..789605ee01f 100644 --- a/cmd/mdatagen/templates/status.go.tmpl +++ b/cmd/mdatagen/templates/status.go.tmpl @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("{{ .Type }}") + Type = component.MustNewType("{{ .Type }}") + ScopeName = "{{ .ScopeName }}" ) const ( diff --git a/cmd/mdatagen/templates/telemetry.go.tmpl b/cmd/mdatagen/templates/telemetry.go.tmpl index 1b9f604bd24..7610f04a55f 100644 --- a/cmd/mdatagen/templates/telemetry.go.tmpl +++ b/cmd/mdatagen/templates/telemetry.go.tmpl @@ -16,14 +16,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "{{ .ScopeName }}" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("{{ .ScopeName }}") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("{{ .ScopeName }}") } {{- if .Telemetry.Metrics }} diff --git a/connector/forwardconnector/internal/metadata/generated_status.go b/connector/forwardconnector/internal/metadata/generated_status.go index 25007e42e02..87699068c03 100644 --- a/connector/forwardconnector/internal/metadata/generated_status.go +++ b/connector/forwardconnector/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("forward") + Type = component.MustNewType("forward") + ScopeName = "go.opentelemetry.io/collector/connector/forwardconnector" ) const ( diff --git a/exporter/debugexporter/internal/metadata/generated_status.go b/exporter/debugexporter/internal/metadata/generated_status.go index 608b23c1536..b4588f75200 100644 --- a/exporter/debugexporter/internal/metadata/generated_status.go +++ b/exporter/debugexporter/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("debug") + Type = component.MustNewType("debug") + ScopeName = "go.opentelemetry.io/collector/exporter/debugexporter" ) const ( diff --git a/exporter/exporterhelper/internal/metadata/generated_telemetry.go b/exporter/exporterhelper/internal/metadata/generated_telemetry.go index f52d0d1082b..d0b27bf441b 100644 --- a/exporter/exporterhelper/internal/metadata/generated_telemetry.go +++ b/exporter/exporterhelper/internal/metadata/generated_telemetry.go @@ -14,14 +14,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/exporter/exporterhelper" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/exporter/exporterhelper") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/exporter/exporterhelper") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/exporter/loggingexporter/internal/metadata/generated_status.go b/exporter/loggingexporter/internal/metadata/generated_status.go index ce3f313e8e0..7c415b23aae 100644 --- a/exporter/loggingexporter/internal/metadata/generated_status.go +++ b/exporter/loggingexporter/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("logging") + Type = component.MustNewType("logging") + ScopeName = "go.opentelemetry.io/collector/exporter/loggingexporter" ) const ( diff --git a/exporter/nopexporter/internal/metadata/generated_status.go b/exporter/nopexporter/internal/metadata/generated_status.go index 1901cab9ee6..d7336115c61 100644 --- a/exporter/nopexporter/internal/metadata/generated_status.go +++ b/exporter/nopexporter/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("nop") + Type = component.MustNewType("nop") + ScopeName = "go.opentelemetry.io/collector/exporter/nopexporter" ) const ( diff --git a/exporter/otlpexporter/internal/metadata/generated_status.go b/exporter/otlpexporter/internal/metadata/generated_status.go index c9cff844fa2..6003002a1a3 100644 --- a/exporter/otlpexporter/internal/metadata/generated_status.go +++ b/exporter/otlpexporter/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("otlp") + Type = component.MustNewType("otlp") + ScopeName = "go.opentelemetry.io/collector/exporter/otlpexporter" ) const ( diff --git a/exporter/otlphttpexporter/internal/metadata/generated_status.go b/exporter/otlphttpexporter/internal/metadata/generated_status.go index 8af2905a456..c38e6de2550 100644 --- a/exporter/otlphttpexporter/internal/metadata/generated_status.go +++ b/exporter/otlphttpexporter/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("otlphttp") + Type = component.MustNewType("otlphttp") + ScopeName = "go.opentelemetry.io/collector/exporter/otlphttpexporter" ) const ( diff --git a/extension/ballastextension/internal/metadata/generated_status.go b/extension/ballastextension/internal/metadata/generated_status.go index 54e3d38805d..2acd5fd7570 100644 --- a/extension/ballastextension/internal/metadata/generated_status.go +++ b/extension/ballastextension/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("memory_ballast") + Type = component.MustNewType("memory_ballast") + ScopeName = "go.opentelemetry.io/collector/extension/ballastextension" ) const ( diff --git a/extension/memorylimiterextension/internal/metadata/generated_status.go b/extension/memorylimiterextension/internal/metadata/generated_status.go index 21472c5d5aa..d8e99a2bebc 100644 --- a/extension/memorylimiterextension/internal/metadata/generated_status.go +++ b/extension/memorylimiterextension/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("memory_limiter") + Type = component.MustNewType("memory_limiter") + ScopeName = "go.opentelemetry.io/collector/extension/memorylimiterextension" ) const ( diff --git a/extension/zpagesextension/internal/metadata/generated_status.go b/extension/zpagesextension/internal/metadata/generated_status.go index ee7c714b77a..cff3d7b0b2c 100644 --- a/extension/zpagesextension/internal/metadata/generated_status.go +++ b/extension/zpagesextension/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("zpages") + Type = component.MustNewType("zpages") + ScopeName = "go.opentelemetry.io/collector/extension/zpagesextension" ) const ( diff --git a/processor/batchprocessor/internal/metadata/generated_status.go b/processor/batchprocessor/internal/metadata/generated_status.go index c77d7c0a539..8f1fa8cfe60 100644 --- a/processor/batchprocessor/internal/metadata/generated_status.go +++ b/processor/batchprocessor/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("batch") + Type = component.MustNewType("batch") + ScopeName = "go.opentelemetry.io/collector/processor/batchprocessor" ) const ( diff --git a/processor/batchprocessor/internal/metadata/generated_telemetry.go b/processor/batchprocessor/internal/metadata/generated_telemetry.go index 9b64048ac68..554da0686db 100644 --- a/processor/batchprocessor/internal/metadata/generated_telemetry.go +++ b/processor/batchprocessor/internal/metadata/generated_telemetry.go @@ -14,14 +14,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/processor/batchprocessor" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/processor/batchprocessor") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/processor/batchprocessor") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/processor/memorylimiterprocessor/internal/metadata/generated_status.go b/processor/memorylimiterprocessor/internal/metadata/generated_status.go index bd77272f645..0e841608278 100644 --- a/processor/memorylimiterprocessor/internal/metadata/generated_status.go +++ b/processor/memorylimiterprocessor/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("memory_limiter") + Type = component.MustNewType("memory_limiter") + ScopeName = "go.opentelemetry.io/collector/processor/memorylimiterprocessor" ) const ( diff --git a/processor/processorhelper/internal/metadata/generated_telemetry.go b/processor/processorhelper/internal/metadata/generated_telemetry.go index a103da30750..6c145bb65cd 100644 --- a/processor/processorhelper/internal/metadata/generated_telemetry.go +++ b/processor/processorhelper/internal/metadata/generated_telemetry.go @@ -13,14 +13,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/processor/processorhelper" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/processor/processorhelper") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/processor/processorhelper") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/receiver/nopreceiver/internal/metadata/generated_status.go b/receiver/nopreceiver/internal/metadata/generated_status.go index 1901cab9ee6..a8716db919c 100644 --- a/receiver/nopreceiver/internal/metadata/generated_status.go +++ b/receiver/nopreceiver/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("nop") + Type = component.MustNewType("nop") + ScopeName = "go.opentelemetry.io/collector/receiver/nopreceiver" ) const ( diff --git a/receiver/otlpreceiver/internal/metadata/generated_status.go b/receiver/otlpreceiver/internal/metadata/generated_status.go index c9cff844fa2..02715c16850 100644 --- a/receiver/otlpreceiver/internal/metadata/generated_status.go +++ b/receiver/otlpreceiver/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("otlp") + Type = component.MustNewType("otlp") + ScopeName = "go.opentelemetry.io/collector/receiver/otlpreceiver" ) const ( diff --git a/receiver/receiverhelper/internal/metadata/generated_telemetry.go b/receiver/receiverhelper/internal/metadata/generated_telemetry.go index 88ea56e46f7..8e0b5a8455a 100644 --- a/receiver/receiverhelper/internal/metadata/generated_telemetry.go +++ b/receiver/receiverhelper/internal/metadata/generated_telemetry.go @@ -13,14 +13,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/receiver/receiverhelper" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/receiver/receiverhelper") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/receiver/receiverhelper") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/receiver/scraperhelper/internal/metadata/generated_telemetry.go b/receiver/scraperhelper/internal/metadata/generated_telemetry.go index 42e96d62d1b..98cf15f4123 100644 --- a/receiver/scraperhelper/internal/metadata/generated_telemetry.go +++ b/receiver/scraperhelper/internal/metadata/generated_telemetry.go @@ -13,14 +13,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/receiver/scraperhelper" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/receiver/scraperhelper") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/receiver/scraperhelper") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/service/internal/metadata/generated_telemetry.go b/service/internal/metadata/generated_telemetry.go index 6a159adb818..edefccd1a54 100644 --- a/service/internal/metadata/generated_telemetry.go +++ b/service/internal/metadata/generated_telemetry.go @@ -14,14 +14,12 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" ) -const ScopeName = "go.opentelemetry.io/collector/service" - func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter(ScopeName) + return settings.MeterProvider.Meter("go.opentelemetry.io/collector/service") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer(ScopeName) + return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/service") } // TelemetryBuilder provides an interface for components to report telemetry