From 8ae1539c84a55140075063d27e62eb561f9b5dab Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 6 Feb 2024 09:18:47 +0000 Subject: [PATCH] [chore][mdatagen] Use MustNewType for metadata.Type (#31038) **Description:** Follow up to open-telemetry/opentelemetry-collector/pull/9414, adds the same changes in `mdatagen` regarding validation of `component.Type`s. On this PR the validation logic and templating is a bit more complex because of subcomponents. I will add these changes back on core once this PR is merged. **Link to tracking Issue:** open-telemetry/opentelemetry-collector/issues/9208 --- .../internal/metadata/generated_status.go | 5 ++++- cmd/mdatagen/main_test.go | 10 ++++++++-- cmd/mdatagen/templates/status.go.tmpl | 9 +++++++-- cmd/mdatagen/validate.go | 17 ++++++++++++++++ .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- connector/servicegraphconnector/connector.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../awscloudwatchlogsexporter/exporter.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- exporter/awsemfexporter/emf_exporter.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- exporter/f5cloudexporter/factory_test.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../googlecloudpubsubexporter/factory_test.go | 3 +-- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- exporter/mezmoexporter/factory_test.go | 3 +-- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- exporter/sentryexporter/factory_test.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- extension/basicauthextension/factory_test.go | 3 +-- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- processor/attributesprocessor/factory_test.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- processor/filterprocessor/telemetry.go | 8 ++++---- .../internal/metadata/generated_status.go | 5 ++++- processor/groupbyattrsprocessor/metrics.go | 18 ++++++++--------- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../probabilisticsamplerprocessor/metrics.go | 4 ++-- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 4 +--- .../internal/metadata/generated_status.go | 4 +--- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 4 +--- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- processor/routingprocessor/logs.go | 2 +- processor/routingprocessor/metrics.go | 2 +- processor/routingprocessor/traces.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- processor/spanprocessor/factory_test.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- processor/tailsamplingprocessor/metrics.go | 20 +++++++++---------- processor/transformprocessor/factory_test.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../factory_windows.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/aerospikereceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/apachereceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/apachesparkreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/awsxrayreceiver/factory_test.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/udppoller/poller.go | 10 +++++----- .../internal/udppoller/poller_test.go | 2 +- receiver/awsxrayreceiver/receiver.go | 6 +++--- .../internal/metadata/generated_status.go | 5 ++++- receiver/azureblobreceiver/receiver.go | 4 ++-- .../eventhubhandler_test.go | 2 +- receiver/azureeventhubreceiver/factory.go | 4 ++-- .../internal/metadata/generated_status.go | 5 ++++- receiver/azureeventhubreceiver/receiver.go | 4 ++-- receiver/azuremonitorreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/bigipreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/chronyreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/cloudflarereceiver/logs.go | 3 ++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/collectdreceiver/receiver.go | 14 ++++++------- receiver/couchdbreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/dockerstatsreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/elasticsearchreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/expvarreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/filestatsreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/flinkmetricsreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../googlecloudpubsubreceiver/factory_test.go | 3 +-- .../internal/metadata/generated_status.go | 5 ++++- .../googlecloudspannerreceiver/factory.go | 2 +- .../factory_test.go | 3 +-- .../internal/metadata/generated_status.go | 5 ++++- receiver/haproxyreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/httpcheckreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/iisreceiver/factory_windows.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/k8sclusterreceiver/receiver.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/k8seventsreceiver/receiver.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/k8sobjectsreceiver/receiver.go | 4 ++-- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/kubeletstatsreceiver/scraper.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/memcachedreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/mongodbatlasreceiver/receiver.go | 2 +- receiver/mongodbreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/mysqlreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/nginxreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/nsxtreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/otlpjsonfilereceiver/file.go | 12 +++++------ .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/podmanreceiver/receiver.go | 2 +- receiver/postgresqlreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/rabbitmqreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/redisreceiver/redis_scraper.go | 2 +- receiver/riakreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/saphanareceiver/scraper.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/signalfxreceiver/receiver.go | 10 +++++----- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/snmpreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/snowflakereceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/splunkenterprisereceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/splunkhecreceiver/receiver.go | 12 +++++------ .../internal/metadata/generated_status.go | 5 ++++- receiver/sqlqueryreceiver/logs_receiver.go | 2 +- receiver/sqlserverreceiver/factory_windows.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/sshcheckreceiver/config.go | 2 +- receiver/sshcheckreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/vcenterreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/webhookeventreceiver/factory.go | 3 ++- .../internal/metadata/generated_status.go | 5 ++++- receiver/webhookeventreceiver/receiver.go | 6 +++--- receiver/webhookeventreceiver/req_to_log.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- .../internal/metadata/generated_status.go | 5 ++++- receiver/zookeeperreceiver/factory.go | 2 +- .../internal/metadata/generated_status.go | 5 ++++- receiver/zookeeperreceiver/scraper.go | 2 +- 284 files changed, 965 insertions(+), 349 deletions(-) diff --git a/cmd/mdatagen/internal/metadata/generated_status.go b/cmd/mdatagen/internal/metadata/generated_status.go index 5fbfbc838263..429ff354c01b 100644 --- a/cmd/mdatagen/internal/metadata/generated_status.go +++ b/cmd/mdatagen/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("file") +) + const ( - Type = "file" TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelDevelopment MetricsStability = component.StabilityLevelStable diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go index c968fba5e79f..b671aacf2181 100644 --- a/cmd/mdatagen/main_test.go +++ b/cmd/mdatagen/main_test.go @@ -328,8 +328,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("foo") +) + const ( - Type = "foo" MetricsStability = component.StabilityLevelBeta ) @@ -362,8 +365,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("foo") +) + const ( - Type = "foo" MetricsStability = component.StabilityLevelAlpha ) diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/templates/status.go.tmpl index 654e6b1518a3..e90f678853b0 100644 --- a/cmd/mdatagen/templates/status.go.tmpl +++ b/cmd/mdatagen/templates/status.go.tmpl @@ -8,8 +8,13 @@ import ( "go.opentelemetry.io/otel/trace" ) +{{ if eq .Parent "" }} +var ( + Type = component.MustNewType("{{ .Type }}") +) +{{- end }} + const ( - Type = "{{ .Type }}" {{- range $stability, $signals := .Status.Stability }} {{- range $signal := $signals }} {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ casesTitle $stability }} @@ -23,4 +28,4 @@ func Meter(settings component.TelemetrySettings) metric.Meter { func Tracer(settings component.TelemetrySettings) trace.Tracer { return settings.TracerProvider.Tracer("{{ .ScopeName }}") -} \ No newline at end of file +} diff --git a/cmd/mdatagen/validate.go b/cmd/mdatagen/validate.go index 75c61f730406..ae3990f97a6d 100644 --- a/cmd/mdatagen/validate.go +++ b/cmd/mdatagen/validate.go @@ -6,6 +6,7 @@ package main import ( "errors" "fmt" + "regexp" "go.opentelemetry.io/collector/pdata/pcommon" "go.uber.org/multierr" @@ -28,10 +29,26 @@ func (md *metadata) Validate() error { return errs } +// typeRegexp is used to validate the type of a component. +// A type must start with an ASCII alphabetic character and +// can only contain ASCII alphanumeric characters and '_'. +// We allow '/' for subcomponents. +// This must be kept in sync with the regex in component/config.go. +var typeRegexp = regexp.MustCompile(`^[a-zA-Z][0-9a-zA-Z_]*$`) + func (md *metadata) validateType() error { if md.Type == "" { return errors.New("missing type") } + + if md.Parent != "" { + // subcomponents are allowed to have a '/' in their type. + return nil + } + + if !typeRegexp.MatchString(md.Type) { + return fmt.Errorf("invalid character(s) in type %q", md.Type) + } return nil } diff --git a/connector/countconnector/internal/metadata/generated_status.go b/connector/countconnector/internal/metadata/generated_status.go index e624f25be5d4..270c29f7769b 100644 --- a/connector/countconnector/internal/metadata/generated_status.go +++ b/connector/countconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("count") +) + const ( - Type = "count" TracesToMetricsStability = component.StabilityLevelDevelopment MetricsToMetricsStability = component.StabilityLevelDevelopment LogsToMetricsStability = component.StabilityLevelDevelopment diff --git a/connector/datadogconnector/internal/metadata/generated_status.go b/connector/datadogconnector/internal/metadata/generated_status.go index 9c9f28a16830..2c540857fc70 100644 --- a/connector/datadogconnector/internal/metadata/generated_status.go +++ b/connector/datadogconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("datadog") +) + const ( - Type = "datadog" TracesToMetricsStability = component.StabilityLevelBeta TracesToTracesStability = component.StabilityLevelBeta ) diff --git a/connector/exceptionsconnector/internal/metadata/generated_status.go b/connector/exceptionsconnector/internal/metadata/generated_status.go index 0e7fc8ea336a..056505694ad3 100644 --- a/connector/exceptionsconnector/internal/metadata/generated_status.go +++ b/connector/exceptionsconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("exceptions") +) + const ( - Type = "exceptions" TracesToMetricsStability = component.StabilityLevelDevelopment TracesToLogsStability = component.StabilityLevelDevelopment ) diff --git a/connector/failoverconnector/internal/metadata/generated_status.go b/connector/failoverconnector/internal/metadata/generated_status.go index c215cb121ec4..10fdcbe7b9fb 100644 --- a/connector/failoverconnector/internal/metadata/generated_status.go +++ b/connector/failoverconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("failover") +) + const ( - Type = "failover" MetricsToMetricsStability = component.StabilityLevelDevelopment TracesToTracesStability = component.StabilityLevelDevelopment LogsToLogsStability = component.StabilityLevelDevelopment diff --git a/connector/routingconnector/internal/metadata/generated_status.go b/connector/routingconnector/internal/metadata/generated_status.go index 16465d9cc597..ddf7e9c1c51d 100644 --- a/connector/routingconnector/internal/metadata/generated_status.go +++ b/connector/routingconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("routing") +) + const ( - Type = "routing" TracesToTracesStability = component.StabilityLevelAlpha MetricsToMetricsStability = component.StabilityLevelAlpha LogsToLogsStability = component.StabilityLevelAlpha diff --git a/connector/servicegraphconnector/connector.go b/connector/servicegraphconnector/connector.go index 96a3c1db9969..7b48ae1b5cc9 100644 --- a/connector/servicegraphconnector/connector.go +++ b/connector/servicegraphconnector/connector.go @@ -84,7 +84,7 @@ type serviceGraphConnector struct { } func customMetricName(name string) string { - return "connector/" + metadata.Type + "/" + name + return "connector/" + metadata.Type.String() + "/" + name } func newConnector(set component.TelemetrySettings, config component.Config) *serviceGraphConnector { diff --git a/connector/servicegraphconnector/internal/metadata/generated_status.go b/connector/servicegraphconnector/internal/metadata/generated_status.go index d2197167296b..3a35891d36ff 100644 --- a/connector/servicegraphconnector/internal/metadata/generated_status.go +++ b/connector/servicegraphconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("servicegraph") +) + const ( - Type = "servicegraph" TracesToMetricsStability = component.StabilityLevelAlpha ) diff --git a/connector/spanmetricsconnector/internal/metadata/generated_status.go b/connector/spanmetricsconnector/internal/metadata/generated_status.go index 5672e2c0604f..c0da10adabc6 100644 --- a/connector/spanmetricsconnector/internal/metadata/generated_status.go +++ b/connector/spanmetricsconnector/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("spanmetrics") +) + const ( - Type = "spanmetrics" TracesToMetricsStability = component.StabilityLevelAlpha ) diff --git a/exporter/alertmanagerexporter/internal/metadata/generated_status.go b/exporter/alertmanagerexporter/internal/metadata/generated_status.go index 7e33d6317133..2f14617c3498 100644 --- a/exporter/alertmanagerexporter/internal/metadata/generated_status.go +++ b/exporter/alertmanagerexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("alertmanager") +) + const ( - Type = "alertmanager" TracesStability = component.StabilityLevelDevelopment ) diff --git a/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go b/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go index b7d837dd70bc..ea83a3144b88 100644 --- a/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go +++ b/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("alibabacloud_logservice") +) + const ( - Type = "alibabacloud_logservice" TracesStability = component.StabilityLevelUnmaintained MetricsStability = component.StabilityLevelUnmaintained LogsStability = component.StabilityLevelUnmaintained diff --git a/exporter/awscloudwatchlogsexporter/exporter.go b/exporter/awscloudwatchlogsexporter/exporter.go index 51c78ca59fc8..b382f24014cb 100644 --- a/exporter/awscloudwatchlogsexporter/exporter.go +++ b/exporter/awscloudwatchlogsexporter/exporter.go @@ -61,7 +61,7 @@ func newCwLogsPusher(expConfig *Config, params exp.CreateSettings) (*cwlExporter } // create CWLogs client with aws session config - svcStructuredLog := cwlogs.NewClient(params.Logger, awsConfig, params.BuildInfo, expConfig.LogGroupName, expConfig.LogRetention, expConfig.Tags, session, metadata.Type) + svcStructuredLog := cwlogs.NewClient(params.Logger, awsConfig, params.BuildInfo, expConfig.LogGroupName, expConfig.LogRetention, expConfig.Tags, session, metadata.Type.String()) collectorIdentifier, err := uuid.NewRandom() if err != nil { diff --git a/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go b/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go index 7ca2f73ce53f..2b54cdf29629 100644 --- a/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go +++ b/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awscloudwatchlogs") +) + const ( - Type = "awscloudwatchlogs" LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/awsemfexporter/emf_exporter.go b/exporter/awsemfexporter/emf_exporter.go index bd4719977e0c..adeaa48b6354 100644 --- a/exporter/awsemfexporter/emf_exporter.go +++ b/exporter/awsemfexporter/emf_exporter.go @@ -56,7 +56,7 @@ func newEmfExporter(config *Config, set exporter.CreateSettings) (*emfExporter, } // create CWLogs client with aws session config - svcStructuredLog := cwlogs.NewClient(set.Logger, awsConfig, set.BuildInfo, config.LogGroupName, config.LogRetention, config.Tags, session, metadata.Type) + svcStructuredLog := cwlogs.NewClient(set.Logger, awsConfig, set.BuildInfo, config.LogGroupName, config.LogRetention, config.Tags, session, metadata.Type.String()) collectorIdentifier, err := uuid.NewRandom() if err != nil { diff --git a/exporter/awsemfexporter/internal/metadata/generated_status.go b/exporter/awsemfexporter/internal/metadata/generated_status.go index 352cba3cdf7b..5d050d27619a 100644 --- a/exporter/awsemfexporter/internal/metadata/generated_status.go +++ b/exporter/awsemfexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awsemf") +) + const ( - Type = "awsemf" MetricsStability = component.StabilityLevelBeta ) diff --git a/exporter/awskinesisexporter/internal/metadata/generated_status.go b/exporter/awskinesisexporter/internal/metadata/generated_status.go index 3a15b19c63d4..72c8f97afd97 100644 --- a/exporter/awskinesisexporter/internal/metadata/generated_status.go +++ b/exporter/awskinesisexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awskinesis") +) + const ( - Type = "awskinesis" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/awss3exporter/internal/metadata/generated_status.go b/exporter/awss3exporter/internal/metadata/generated_status.go index d2f6bc690f89..d8c6a2dacd2c 100644 --- a/exporter/awss3exporter/internal/metadata/generated_status.go +++ b/exporter/awss3exporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awss3") +) + const ( - Type = "awss3" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/exporter/awsxrayexporter/internal/metadata/generated_status.go b/exporter/awsxrayexporter/internal/metadata/generated_status.go index f60df3ca9ac5..63420257a6a6 100644 --- a/exporter/awsxrayexporter/internal/metadata/generated_status.go +++ b/exporter/awsxrayexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awsxray") +) + const ( - Type = "awsxray" TracesStability = component.StabilityLevelBeta ) diff --git a/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go b/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go index 22d1cf329f27..7bc6416a120b 100644 --- a/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go +++ b/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("azuredataexplorer") +) + const ( - Type = "azuredataexplorer" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/azuremonitorexporter/internal/metadata/generated_status.go b/exporter/azuremonitorexporter/internal/metadata/generated_status.go index d8c79c8ea560..f11bc387284c 100644 --- a/exporter/azuremonitorexporter/internal/metadata/generated_status.go +++ b/exporter/azuremonitorexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("azuremonitor") +) + const ( - Type = "azuremonitor" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/carbonexporter/internal/metadata/generated_status.go b/exporter/carbonexporter/internal/metadata/generated_status.go index ce6617d16408..179008e092b6 100644 --- a/exporter/carbonexporter/internal/metadata/generated_status.go +++ b/exporter/carbonexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("carbon") +) + const ( - Type = "carbon" MetricsStability = component.StabilityLevelBeta ) diff --git a/exporter/cassandraexporter/internal/metadata/generated_status.go b/exporter/cassandraexporter/internal/metadata/generated_status.go index a6831fe3a93e..d3e3e5d3b505 100644 --- a/exporter/cassandraexporter/internal/metadata/generated_status.go +++ b/exporter/cassandraexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("cassandra") +) + const ( - Type = "cassandra" TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) diff --git a/exporter/clickhouseexporter/internal/metadata/generated_status.go b/exporter/clickhouseexporter/internal/metadata/generated_status.go index 3f3c0c7cd032..75291bdd50e0 100644 --- a/exporter/clickhouseexporter/internal/metadata/generated_status.go +++ b/exporter/clickhouseexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("clickhouse") +) + const ( - Type = "clickhouse" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/exporter/coralogixexporter/internal/metadata/generated_status.go b/exporter/coralogixexporter/internal/metadata/generated_status.go index cb2981f1b68a..0bd2c6c880ae 100644 --- a/exporter/coralogixexporter/internal/metadata/generated_status.go +++ b/exporter/coralogixexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("coralogix") +) + const ( - Type = "coralogix" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/datadogexporter/internal/metadata/generated_status.go b/exporter/datadogexporter/internal/metadata/generated_status.go index 2b54718b6486..0aaf59990097 100644 --- a/exporter/datadogexporter/internal/metadata/generated_status.go +++ b/exporter/datadogexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("datadog") +) + const ( - Type = "datadog" LogsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta diff --git a/exporter/datasetexporter/internal/metadata/generated_status.go b/exporter/datasetexporter/internal/metadata/generated_status.go index f1fb14c3c227..749593d9f20b 100644 --- a/exporter/datasetexporter/internal/metadata/generated_status.go +++ b/exporter/datasetexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("dataset") +) + const ( - Type = "dataset" LogsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelAlpha ) diff --git a/exporter/dynatraceexporter/internal/metadata/generated_status.go b/exporter/dynatraceexporter/internal/metadata/generated_status.go index 74b946fecc17..b1e9fa13d455 100644 --- a/exporter/dynatraceexporter/internal/metadata/generated_status.go +++ b/exporter/dynatraceexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("dynatrace") +) + const ( - Type = "dynatrace" MetricsStability = component.StabilityLevelDeprecated ) diff --git a/exporter/elasticsearchexporter/internal/metadata/generated_status.go b/exporter/elasticsearchexporter/internal/metadata/generated_status.go index a583a1963043..dae9c61cf4e9 100644 --- a/exporter/elasticsearchexporter/internal/metadata/generated_status.go +++ b/exporter/elasticsearchexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("elasticsearch") +) + const ( - Type = "elasticsearch" TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/f5cloudexporter/factory_test.go b/exporter/f5cloudexporter/factory_test.go index 6b0203f15633..859313bc1186 100644 --- a/exporter/f5cloudexporter/factory_test.go +++ b/exporter/f5cloudexporter/factory_test.go @@ -22,7 +22,7 @@ import ( func TestFactory_TestType(t *testing.T) { f := NewFactory() - assert.Equal(t, f.Type(), component.Type(metadata.Type)) + assert.Equal(t, f.Type(), metadata.Type) } func TestFactory_CreateDefaultConfig(t *testing.T) { diff --git a/exporter/f5cloudexporter/internal/metadata/generated_status.go b/exporter/f5cloudexporter/internal/metadata/generated_status.go index 79d17e465073..a7dc09b3ad15 100644 --- a/exporter/f5cloudexporter/internal/metadata/generated_status.go +++ b/exporter/f5cloudexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("f5cloud") +) + const ( - Type = "f5cloud" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/fileexporter/internal/metadata/generated_status.go b/exporter/fileexporter/internal/metadata/generated_status.go index ee908154b9df..aa9a33eaeb7a 100644 --- a/exporter/fileexporter/internal/metadata/generated_status.go +++ b/exporter/fileexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("file") +) + const ( - Type = "file" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/exporter/googlecloudexporter/internal/metadata/generated_status.go b/exporter/googlecloudexporter/internal/metadata/generated_status.go index c3d96226894c..846a6056ec42 100644 --- a/exporter/googlecloudexporter/internal/metadata/generated_status.go +++ b/exporter/googlecloudexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("googlecloud") +) + const ( - Type = "googlecloud" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/googlecloudpubsubexporter/factory_test.go b/exporter/googlecloudpubsubexporter/factory_test.go index fffea47b722d..399e17291606 100644 --- a/exporter/googlecloudpubsubexporter/factory_test.go +++ b/exporter/googlecloudpubsubexporter/factory_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/exporter/exportertest" @@ -24,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) { func TestType(t *testing.T) { factory := NewFactory() - assert.Equal(t, component.Type(metadata.Type), factory.Type()) + assert.Equal(t, metadata.Type, factory.Type()) } func TestCreateTracesExporter(t *testing.T) { diff --git a/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go b/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go index 74600824e34b..952059865005 100644 --- a/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go +++ b/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("googlecloudpubsub") +) + const ( - Type = "googlecloudpubsub" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go b/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go index 5eb21959873f..a496aa57d873 100644 --- a/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go +++ b/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("googlemanagedprometheus") +) + const ( - Type = "googlemanagedprometheus" MetricsStability = component.StabilityLevelBeta ) diff --git a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go index d8c0b3122036..b4384d4b2340 100644 --- a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go +++ b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("honeycombmarker") +) + const ( - Type = "honeycombmarker" LogsStability = component.StabilityLevelAlpha ) diff --git a/exporter/influxdbexporter/internal/metadata/generated_status.go b/exporter/influxdbexporter/internal/metadata/generated_status.go index 978e4fcacc45..a445c22df30c 100644 --- a/exporter/influxdbexporter/internal/metadata/generated_status.go +++ b/exporter/influxdbexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("influxdb") +) + const ( - Type = "influxdb" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/instanaexporter/internal/metadata/generated_status.go b/exporter/instanaexporter/internal/metadata/generated_status.go index 5d6a5bb5cfc9..7a429a2b81d8 100644 --- a/exporter/instanaexporter/internal/metadata/generated_status.go +++ b/exporter/instanaexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("instana") +) + const ( - Type = "instana" TracesStability = component.StabilityLevelAlpha ) diff --git a/exporter/kafkaexporter/internal/metadata/generated_status.go b/exporter/kafkaexporter/internal/metadata/generated_status.go index 25c68a3f1504..b8d45d135f4e 100644 --- a/exporter/kafkaexporter/internal/metadata/generated_status.go +++ b/exporter/kafkaexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("kafka") +) + const ( - Type = "kafka" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/kineticaexporter/internal/metadata/generated_status.go b/exporter/kineticaexporter/internal/metadata/generated_status.go index f6e80b70a532..f0c0f4c69e8b 100644 --- a/exporter/kineticaexporter/internal/metadata/generated_status.go +++ b/exporter/kineticaexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("kinetica") +) + const ( - Type = "kinetica" MetricsStability = component.StabilityLevelDevelopment TracesStability = component.StabilityLevelDevelopment LogsStability = component.StabilityLevelDevelopment diff --git a/exporter/loadbalancingexporter/internal/metadata/generated_status.go b/exporter/loadbalancingexporter/internal/metadata/generated_status.go index bef8141df0b6..cb1a1a701098 100644 --- a/exporter/loadbalancingexporter/internal/metadata/generated_status.go +++ b/exporter/loadbalancingexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("loadbalancing") +) + const ( - Type = "loadbalancing" TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelDevelopment diff --git a/exporter/logicmonitorexporter/internal/metadata/generated_status.go b/exporter/logicmonitorexporter/internal/metadata/generated_status.go index 500274c984d5..08e3f10aaabf 100644 --- a/exporter/logicmonitorexporter/internal/metadata/generated_status.go +++ b/exporter/logicmonitorexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("logicmonitor") +) + const ( - Type = "logicmonitor" TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) diff --git a/exporter/logzioexporter/internal/metadata/generated_status.go b/exporter/logzioexporter/internal/metadata/generated_status.go index a2f113c7e66f..0a0ec9b10118 100644 --- a/exporter/logzioexporter/internal/metadata/generated_status.go +++ b/exporter/logzioexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("logzio") +) + const ( - Type = "logzio" TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/lokiexporter/internal/metadata/generated_status.go b/exporter/lokiexporter/internal/metadata/generated_status.go index 9b18cf1bd294..49aedda31bcf 100644 --- a/exporter/lokiexporter/internal/metadata/generated_status.go +++ b/exporter/lokiexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("loki") +) + const ( - Type = "loki" LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/mezmoexporter/factory_test.go b/exporter/mezmoexporter/factory_test.go index e2eda355ae90..d68d4b7df8b4 100644 --- a/exporter/mezmoexporter/factory_test.go +++ b/exporter/mezmoexporter/factory_test.go @@ -9,7 +9,6 @@ import ( "time" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/configretry" @@ -22,7 +21,7 @@ import ( func TestType(t *testing.T) { factory := NewFactory() pType := factory.Type() - assert.Equal(t, pType, component.Type(metadata.Type)) + assert.Equal(t, pType, metadata.Type) } func TestCreateDefaultConfig(t *testing.T) { diff --git a/exporter/mezmoexporter/internal/metadata/generated_status.go b/exporter/mezmoexporter/internal/metadata/generated_status.go index 21d69fb2ea3c..85638edd4136 100644 --- a/exporter/mezmoexporter/internal/metadata/generated_status.go +++ b/exporter/mezmoexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("mezmo") +) + const ( - Type = "mezmo" LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/opencensusexporter/internal/metadata/generated_status.go b/exporter/opencensusexporter/internal/metadata/generated_status.go index 115becf76053..4b095c2f69fa 100644 --- a/exporter/opencensusexporter/internal/metadata/generated_status.go +++ b/exporter/opencensusexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("opencensus") +) + const ( - Type = "opencensus" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta ) diff --git a/exporter/opensearchexporter/internal/metadata/generated_status.go b/exporter/opensearchexporter/internal/metadata/generated_status.go index c53afddec134..7f93ca86db40 100644 --- a/exporter/opensearchexporter/internal/metadata/generated_status.go +++ b/exporter/opensearchexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("opensearch") +) + const ( - Type = "opensearch" TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelDevelopment ) diff --git a/exporter/otelarrowexporter/internal/metadata/generated_status.go b/exporter/otelarrowexporter/internal/metadata/generated_status.go index 2b73da58f12a..23f908751c9c 100644 --- a/exporter/otelarrowexporter/internal/metadata/generated_status.go +++ b/exporter/otelarrowexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("otelarrow") +) + const ( - Type = "otelarrow" TracesStability = component.StabilityLevelDevelopment MetricsStability = component.StabilityLevelDevelopment LogsStability = component.StabilityLevelDevelopment diff --git a/exporter/prometheusexporter/internal/metadata/generated_status.go b/exporter/prometheusexporter/internal/metadata/generated_status.go index 10a5927c12fc..53a6268cd725 100644 --- a/exporter/prometheusexporter/internal/metadata/generated_status.go +++ b/exporter/prometheusexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("prometheus") +) + const ( - Type = "prometheus" MetricsStability = component.StabilityLevelBeta ) diff --git a/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go b/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go index c39a01b314d5..1ad10c8ecf32 100644 --- a/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go +++ b/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("prometheusremotewrite") +) + const ( - Type = "prometheusremotewrite" MetricsStability = component.StabilityLevelBeta ) diff --git a/exporter/pulsarexporter/internal/metadata/generated_status.go b/exporter/pulsarexporter/internal/metadata/generated_status.go index 8bf9ab55567d..7397a8a4e89c 100644 --- a/exporter/pulsarexporter/internal/metadata/generated_status.go +++ b/exporter/pulsarexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("pulsar") +) + const ( - Type = "pulsar" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/exporter/sapmexporter/internal/metadata/generated_status.go b/exporter/sapmexporter/internal/metadata/generated_status.go index f71a1a39589e..17fa827679d7 100644 --- a/exporter/sapmexporter/internal/metadata/generated_status.go +++ b/exporter/sapmexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sapm") +) + const ( - Type = "sapm" TracesStability = component.StabilityLevelBeta ) diff --git a/exporter/sentryexporter/factory_test.go b/exporter/sentryexporter/factory_test.go index fc9b019ac865..1827e3ad9750 100644 --- a/exporter/sentryexporter/factory_test.go +++ b/exporter/sentryexporter/factory_test.go @@ -23,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) { func TestCreateExporter(t *testing.T) { factory := NewFactory() - assert.Equal(t, metadata.Type, string(factory.Type())) + assert.Equal(t, metadata.Type, factory.Type()) cfg := factory.CreateDefaultConfig() eCfg := cfg.(*Config) diff --git a/exporter/sentryexporter/internal/metadata/generated_status.go b/exporter/sentryexporter/internal/metadata/generated_status.go index 0c9c75ed831c..3928cb23fcb9 100644 --- a/exporter/sentryexporter/internal/metadata/generated_status.go +++ b/exporter/sentryexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sentry") +) + const ( - Type = "sentry" TracesStability = component.StabilityLevelBeta ) diff --git a/exporter/signalfxexporter/internal/metadata/generated_status.go b/exporter/signalfxexporter/internal/metadata/generated_status.go index a794bb5c1a07..574ac42ee36d 100644 --- a/exporter/signalfxexporter/internal/metadata/generated_status.go +++ b/exporter/signalfxexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("signalfx") +) + const ( - Type = "signalfx" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/skywalkingexporter/internal/metadata/generated_status.go b/exporter/skywalkingexporter/internal/metadata/generated_status.go index 472c1c74781c..5edad7ceb341 100644 --- a/exporter/skywalkingexporter/internal/metadata/generated_status.go +++ b/exporter/skywalkingexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("skywalking") +) + const ( - Type = "skywalking" MetricsStability = component.StabilityLevelUnmaintained LogsStability = component.StabilityLevelUnmaintained ) diff --git a/exporter/splunkhecexporter/internal/metadata/generated_status.go b/exporter/splunkhecexporter/internal/metadata/generated_status.go index 0e76454b0b83..def1a7fcd1c4 100644 --- a/exporter/splunkhecexporter/internal/metadata/generated_status.go +++ b/exporter/splunkhecexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("splunk_hec") +) + const ( - Type = "splunk_hec" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/exporter/sumologicexporter/internal/metadata/generated_status.go b/exporter/sumologicexporter/internal/metadata/generated_status.go index 93028fb0fa89..68e1ef803a9f 100644 --- a/exporter/sumologicexporter/internal/metadata/generated_status.go +++ b/exporter/sumologicexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sumologic") +) + const ( - Type = "sumologic" MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/syslogexporter/internal/metadata/generated_status.go b/exporter/syslogexporter/internal/metadata/generated_status.go index eedc10a8c608..4d8055eb7c1f 100644 --- a/exporter/syslogexporter/internal/metadata/generated_status.go +++ b/exporter/syslogexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("syslog") +) + const ( - Type = "syslog" LogsStability = component.StabilityLevelAlpha ) diff --git a/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go b/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go index caf09d25481d..13b3321afeeb 100644 --- a/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go +++ b/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("tencentcloud_logservice") +) + const ( - Type = "tencentcloud_logservice" LogsStability = component.StabilityLevelBeta ) diff --git a/exporter/zipkinexporter/internal/metadata/generated_status.go b/exporter/zipkinexporter/internal/metadata/generated_status.go index 5b0e3c11bcd4..359f387990bc 100644 --- a/exporter/zipkinexporter/internal/metadata/generated_status.go +++ b/exporter/zipkinexporter/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("zipkin") +) + const ( - Type = "zipkin" TracesStability = component.StabilityLevelBeta ) diff --git a/extension/asapauthextension/internal/metadata/generated_status.go b/extension/asapauthextension/internal/metadata/generated_status.go index e08bdeb8f9c4..35b0278f952e 100644 --- a/extension/asapauthextension/internal/metadata/generated_status.go +++ b/extension/asapauthextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("asapclient") +) + const ( - Type = "asapclient" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/awsproxy/internal/metadata/generated_status.go b/extension/awsproxy/internal/metadata/generated_status.go index 6433c1a6ae78..ce8c1311aa47 100644 --- a/extension/awsproxy/internal/metadata/generated_status.go +++ b/extension/awsproxy/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awsproxy") +) + const ( - Type = "awsproxy" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/basicauthextension/factory_test.go b/extension/basicauthextension/factory_test.go index ec59b7c91556..29511d05e31d 100644 --- a/extension/basicauthextension/factory_test.go +++ b/extension/basicauthextension/factory_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/extension/extensiontest" @@ -37,5 +36,5 @@ func TestCreateExtension_ValidConfig(t *testing.T) { func TestNewFactory(t *testing.T) { f := NewFactory() assert.NotNil(t, f) - assert.Equal(t, f.Type(), component.Type(metadata.Type)) + assert.Equal(t, f.Type(), metadata.Type) } diff --git a/extension/basicauthextension/internal/metadata/generated_status.go b/extension/basicauthextension/internal/metadata/generated_status.go index 18ba36c75092..cbbc289b72ca 100644 --- a/extension/basicauthextension/internal/metadata/generated_status.go +++ b/extension/basicauthextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("basicauth") +) + const ( - Type = "basicauth" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/bearertokenauthextension/internal/metadata/generated_status.go b/extension/bearertokenauthextension/internal/metadata/generated_status.go index 66d374e7df67..82f27d3b29f7 100644 --- a/extension/bearertokenauthextension/internal/metadata/generated_status.go +++ b/extension/bearertokenauthextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("bearertokenauth") +) + const ( - Type = "bearertokenauth" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go b/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go index 37d988f4f22f..e042a149fe8a 100644 --- a/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("jaeger_encoding") +) + const ( - Type = "jaeger_encoding" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/encoding/jsonlogencodingextension/internal/metadata/generated_status.go b/extension/encoding/jsonlogencodingextension/internal/metadata/generated_status.go index 5346803de057..6583bd83ea1c 100644 --- a/extension/encoding/jsonlogencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/jsonlogencodingextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("json_log_encoding") +) + const ( - Type = "json_log_encoding" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go b/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go index dcc396955595..7dd0e1680578 100644 --- a/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("otlp_encoding") +) + const ( - Type = "otlp_encoding" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/encoding/textencodingextension/internal/metadata/generated_status.go b/extension/encoding/textencodingextension/internal/metadata/generated_status.go index 5f6d4fa6ad26..5a410cb93134 100644 --- a/extension/encoding/textencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/textencodingextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("text_encoding") +) + const ( - Type = "text_encoding" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go b/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go index 66313c4e7459..b3f2c89d6b4a 100644 --- a/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("zipkin_encoding") +) + const ( - Type = "zipkin_encoding" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/headerssetterextension/internal/metadata/generated_status.go b/extension/headerssetterextension/internal/metadata/generated_status.go index 735e095cc297..cb5364d41852 100644 --- a/extension/headerssetterextension/internal/metadata/generated_status.go +++ b/extension/headerssetterextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("headers_setter") +) + const ( - Type = "headers_setter" ExtensionStability = component.StabilityLevelAlpha ) diff --git a/extension/healthcheckextension/internal/metadata/generated_status.go b/extension/healthcheckextension/internal/metadata/generated_status.go index 6c3782ef60fd..64a946c0e4fe 100644 --- a/extension/healthcheckextension/internal/metadata/generated_status.go +++ b/extension/healthcheckextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("health_check") +) + const ( - Type = "health_check" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/httpforwarder/internal/metadata/generated_status.go b/extension/httpforwarder/internal/metadata/generated_status.go index 3432bfd95132..21c69ce627d3 100644 --- a/extension/httpforwarder/internal/metadata/generated_status.go +++ b/extension/httpforwarder/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("http_forwarder") +) + const ( - Type = "http_forwarder" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/jaegerremotesampling/internal/metadata/generated_status.go b/extension/jaegerremotesampling/internal/metadata/generated_status.go index 0d7d1103a074..fed185a1e5cf 100644 --- a/extension/jaegerremotesampling/internal/metadata/generated_status.go +++ b/extension/jaegerremotesampling/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("jaegerremotesampling") +) + const ( - Type = "jaegerremotesampling" ExtensionStability = component.StabilityLevelAlpha ) diff --git a/extension/oauth2clientauthextension/internal/metadata/generated_status.go b/extension/oauth2clientauthextension/internal/metadata/generated_status.go index 131f64f8b661..942359512b13 100644 --- a/extension/oauth2clientauthextension/internal/metadata/generated_status.go +++ b/extension/oauth2clientauthextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("oauth2client") +) + const ( - Type = "oauth2client" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/observer/dockerobserver/internal/metadata/generated_status.go b/extension/observer/dockerobserver/internal/metadata/generated_status.go index cae5dd01f61d..8c9fcf941ab0 100644 --- a/extension/observer/dockerobserver/internal/metadata/generated_status.go +++ b/extension/observer/dockerobserver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("docker_observer") +) + const ( - Type = "docker_observer" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/observer/ecsobserver/internal/metadata/generated_status.go b/extension/observer/ecsobserver/internal/metadata/generated_status.go index 1b625e1518d8..9d8f24a41944 100644 --- a/extension/observer/ecsobserver/internal/metadata/generated_status.go +++ b/extension/observer/ecsobserver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("ecs_observer") +) + const ( - Type = "ecs_observer" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/observer/ecstaskobserver/internal/metadata/generated_status.go b/extension/observer/ecstaskobserver/internal/metadata/generated_status.go index f974af534ae0..4449765ade3e 100644 --- a/extension/observer/ecstaskobserver/internal/metadata/generated_status.go +++ b/extension/observer/ecstaskobserver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("ecs_task_observer") +) + const ( - Type = "ecs_task_observer" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/observer/hostobserver/internal/metadata/generated_status.go b/extension/observer/hostobserver/internal/metadata/generated_status.go index 3ee2f0a00785..fa853dad4060 100644 --- a/extension/observer/hostobserver/internal/metadata/generated_status.go +++ b/extension/observer/hostobserver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("host_observer") +) + const ( - Type = "host_observer" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/observer/k8sobserver/internal/metadata/generated_status.go b/extension/observer/k8sobserver/internal/metadata/generated_status.go index 16bedcf3b84d..e46b02d9bf45 100644 --- a/extension/observer/k8sobserver/internal/metadata/generated_status.go +++ b/extension/observer/k8sobserver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("k8s_observer") +) + const ( - Type = "k8s_observer" ExtensionStability = component.StabilityLevelAlpha ) diff --git a/extension/oidcauthextension/internal/metadata/generated_status.go b/extension/oidcauthextension/internal/metadata/generated_status.go index 1de474710847..e7df447ddfdd 100644 --- a/extension/oidcauthextension/internal/metadata/generated_status.go +++ b/extension/oidcauthextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("oidc") +) + const ( - Type = "oidc" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/opampextension/internal/metadata/generated_status.go b/extension/opampextension/internal/metadata/generated_status.go index e77772cbb7cf..5f34828ebf6a 100644 --- a/extension/opampextension/internal/metadata/generated_status.go +++ b/extension/opampextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("opamp") +) + const ( - Type = "opamp" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/pprofextension/internal/metadata/generated_status.go b/extension/pprofextension/internal/metadata/generated_status.go index e46176baca68..7d8649738038 100644 --- a/extension/pprofextension/internal/metadata/generated_status.go +++ b/extension/pprofextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("pprof") +) + const ( - Type = "pprof" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/remotetapextension/internal/metadata/generated_status.go b/extension/remotetapextension/internal/metadata/generated_status.go index b1c23d73c7d3..8fc93acf6805 100644 --- a/extension/remotetapextension/internal/metadata/generated_status.go +++ b/extension/remotetapextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("remotetap") +) + const ( - Type = "remotetap" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/sigv4authextension/internal/metadata/generated_status.go b/extension/sigv4authextension/internal/metadata/generated_status.go index 7c9413ae0959..b05c500dcba1 100644 --- a/extension/sigv4authextension/internal/metadata/generated_status.go +++ b/extension/sigv4authextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sigv4auth") +) + const ( - Type = "sigv4auth" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go b/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go index a0fdc34ad919..15bc618e72b2 100644 --- a/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go +++ b/extension/solarwindsapmsettingsextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("solarwindsapmsettings") +) + const ( - Type = "solarwindsapmsettings" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/extension/storage/dbstorage/internal/metadata/generated_status.go b/extension/storage/dbstorage/internal/metadata/generated_status.go index 0aa21eec2fb2..3f4cf5e39eca 100644 --- a/extension/storage/dbstorage/internal/metadata/generated_status.go +++ b/extension/storage/dbstorage/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("db_storage") +) + const ( - Type = "db_storage" ExtensionStability = component.StabilityLevelAlpha ) diff --git a/extension/storage/filestorage/internal/metadata/generated_status.go b/extension/storage/filestorage/internal/metadata/generated_status.go index 2d1aafeea932..7667ba332bb3 100644 --- a/extension/storage/filestorage/internal/metadata/generated_status.go +++ b/extension/storage/filestorage/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("file_storage") +) + const ( - Type = "file_storage" ExtensionStability = component.StabilityLevelBeta ) diff --git a/extension/sumologicextension/internal/metadata/generated_status.go b/extension/sumologicextension/internal/metadata/generated_status.go index cb9f107e4ad9..6a5f54d7cff1 100644 --- a/extension/sumologicextension/internal/metadata/generated_status.go +++ b/extension/sumologicextension/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sumologic") +) + const ( - Type = "sumologic" ExtensionStability = component.StabilityLevelDevelopment ) diff --git a/processor/attributesprocessor/factory_test.go b/processor/attributesprocessor/factory_test.go index 5bb5d0327490..368d4500aed4 100644 --- a/processor/attributesprocessor/factory_test.go +++ b/processor/attributesprocessor/factory_test.go @@ -20,7 +20,7 @@ import ( func TestFactory_Type(t *testing.T) { factory := NewFactory() - assert.Equal(t, factory.Type(), component.Type(metadata.Type)) + assert.Equal(t, factory.Type(), metadata.Type) } func TestFactory_CreateDefaultConfig(t *testing.T) { diff --git a/processor/attributesprocessor/internal/metadata/generated_status.go b/processor/attributesprocessor/internal/metadata/generated_status.go index 7f25676321bb..902bf6d3ff64 100644 --- a/processor/attributesprocessor/internal/metadata/generated_status.go +++ b/processor/attributesprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("attributes") +) + const ( - Type = "attributes" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go b/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go index 55f2ef61b3a1..dc6c993c40e2 100644 --- a/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go +++ b/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("cumulativetodelta") +) + const ( - Type = "cumulativetodelta" MetricsStability = component.StabilityLevelBeta ) diff --git a/processor/deltatocumulativeprocessor/internal/metadata/generated_status.go b/processor/deltatocumulativeprocessor/internal/metadata/generated_status.go index 5af9ca17c7e2..0d5c529a7fab 100644 --- a/processor/deltatocumulativeprocessor/internal/metadata/generated_status.go +++ b/processor/deltatocumulativeprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("deltatocumulative") +) + const ( - Type = "deltatocumulative" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/processor/deltatorateprocessor/internal/metadata/generated_status.go b/processor/deltatorateprocessor/internal/metadata/generated_status.go index 769ec74571a3..e26491a4d2c9 100644 --- a/processor/deltatorateprocessor/internal/metadata/generated_status.go +++ b/processor/deltatorateprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("deltatorate") +) + const ( - Type = "deltatorate" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/processor/filterprocessor/internal/metadata/generated_status.go b/processor/filterprocessor/internal/metadata/generated_status.go index bcaeadcc46d2..93587e1c6d07 100644 --- a/processor/filterprocessor/internal/metadata/generated_status.go +++ b/processor/filterprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("filter") +) + const ( - Type = "filter" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/processor/filterprocessor/telemetry.go b/processor/filterprocessor/telemetry.go index 0ef2fb15121f..9267a142475f 100644 --- a/processor/filterprocessor/telemetry.go +++ b/processor/filterprocessor/telemetry.go @@ -36,12 +36,12 @@ func newfilterProcessorTelemetry(set processor.CreateSettings) (*filterProcessor processorID := set.ID.String() fpt := &filterProcessorTelemetry{ - processorAttr: []attribute.KeyValue{attribute.String(metadata.Type, processorID)}, + processorAttr: []attribute.KeyValue{attribute.String(metadata.Type.String(), processorID)}, exportCtx: context.Background(), } counter, err := metadata.Meter(set.TelemetrySettings).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "datapoints.filtered"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "datapoints.filtered"), metric.WithDescription("Number of metric data points dropped by the filter processor"), metric.WithUnit("1"), ) @@ -51,7 +51,7 @@ func newfilterProcessorTelemetry(set processor.CreateSettings) (*filterProcessor fpt.datapointsFiltered = counter counter, err = metadata.Meter(set.TelemetrySettings).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "logs.filtered"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "logs.filtered"), metric.WithDescription("Number of logs dropped by the filter processor"), metric.WithUnit("1"), ) @@ -61,7 +61,7 @@ func newfilterProcessorTelemetry(set processor.CreateSettings) (*filterProcessor fpt.logsFiltered = counter counter, err = metadata.Meter(set.TelemetrySettings).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "spans.filtered"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "spans.filtered"), metric.WithDescription("Number of spans dropped by the filter processor"), metric.WithUnit("1"), ) diff --git a/processor/groupbyattrsprocessor/internal/metadata/generated_status.go b/processor/groupbyattrsprocessor/internal/metadata/generated_status.go index 9dfa03f6433c..4c6c5c85b40f 100644 --- a/processor/groupbyattrsprocessor/internal/metadata/generated_status.go +++ b/processor/groupbyattrsprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("groupbyattrs") +) + const ( - Type = "groupbyattrs" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/processor/groupbyattrsprocessor/metrics.go b/processor/groupbyattrsprocessor/metrics.go index 2f0237500dab..0dad050d76f4 100644 --- a/processor/groupbyattrsprocessor/metrics.go +++ b/processor/groupbyattrsprocessor/metrics.go @@ -29,7 +29,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it := internalTelemetry{} counter, err := metadata.Meter(set).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "num_grouped_spans"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "num_grouped_spans"), metric.WithDescription("Number of spans that had attributes grouped"), metric.WithUnit("1"), ) @@ -39,7 +39,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mNumGroupedSpans = counter counter, err = metadata.Meter(set).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "num_non_grouped_spans"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "num_non_grouped_spans"), metric.WithDescription("Number of spans that did not have attributes grouped"), metric.WithUnit("1"), ) @@ -50,7 +50,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mNumNonGroupedSpans = counter histo, err := metadata.Meter(set).Int64Histogram( - processorhelper.BuildCustomMetricName(metadata.Type, "span_groups"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "span_groups"), metric.WithDescription("Distribution of groups extracted for spans"), metric.WithUnit("1"), ) @@ -61,7 +61,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mDistSpanGroups = histo counter, err = metadata.Meter(set).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "num_grouped_logs"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "num_grouped_logs"), metric.WithDescription("Number of logs that had attributes grouped"), metric.WithUnit("1"), ) @@ -71,7 +71,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mNumGroupedLogs = counter counter, err = metadata.Meter(set).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "num_non_grouped_logs"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "num_non_grouped_logs"), metric.WithDescription("Number of logs that did not have attributes grouped"), metric.WithUnit("1"), ) @@ -82,7 +82,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mNumNonGroupedLogs = counter histo, err = metadata.Meter(set).Int64Histogram( - processorhelper.BuildCustomMetricName(metadata.Type, "log_groups"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "log_groups"), metric.WithDescription("Distribution of groups extracted for logs"), metric.WithUnit("1"), ) @@ -93,7 +93,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mDistLogGroups = histo counter, err = metadata.Meter(set).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "num_grouped_metrics"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "num_grouped_metrics"), metric.WithDescription("Number of metrics that had attributes grouped"), metric.WithUnit("1"), ) @@ -103,7 +103,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mNumGroupedMetrics = counter counter, err = metadata.Meter(set).Int64Counter( - processorhelper.BuildCustomMetricName(metadata.Type, "num_non_grouped_metrics"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "num_non_grouped_metrics"), metric.WithDescription("Number of metrics that did not have attributes grouped"), metric.WithUnit("1"), ) @@ -113,7 +113,7 @@ func newProcessorTelemetry(set component.TelemetrySettings) (*internalTelemetry, it.mNumNonGroupedMetrics = counter histo, err = metadata.Meter(set).Int64Histogram( - processorhelper.BuildCustomMetricName(metadata.Type, "metric_groups"), + processorhelper.BuildCustomMetricName(metadata.Type.String(), "metric_groups"), metric.WithDescription("Distribution of groups extracted for metrics"), metric.WithUnit("1"), ) diff --git a/processor/groupbytraceprocessor/internal/metadata/generated_status.go b/processor/groupbytraceprocessor/internal/metadata/generated_status.go index 86d36b72c8b5..0de5f7e75d05 100644 --- a/processor/groupbytraceprocessor/internal/metadata/generated_status.go +++ b/processor/groupbytraceprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("groupbytrace") +) + const ( - Type = "groupbytrace" TracesStability = component.StabilityLevelBeta ) diff --git a/processor/intervalprocessor/internal/metadata/generated_status.go b/processor/intervalprocessor/internal/metadata/generated_status.go index cc5c6d1c1f9f..79216aea6a79 100644 --- a/processor/intervalprocessor/internal/metadata/generated_status.go +++ b/processor/intervalprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("interval") +) + const ( - Type = "interval" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/processor/k8sattributesprocessor/internal/metadata/generated_status.go b/processor/k8sattributesprocessor/internal/metadata/generated_status.go index 9abe8c044b66..6a776c598679 100644 --- a/processor/k8sattributesprocessor/internal/metadata/generated_status.go +++ b/processor/k8sattributesprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("k8sattributes") +) + const ( - Type = "k8sattributes" LogsStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta TracesStability = component.StabilityLevelBeta diff --git a/processor/logstransformprocessor/internal/metadata/generated_status.go b/processor/logstransformprocessor/internal/metadata/generated_status.go index 70eae1b85e34..f28a44376d66 100644 --- a/processor/logstransformprocessor/internal/metadata/generated_status.go +++ b/processor/logstransformprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("logstransform") +) + const ( - Type = "logstransform" LogsStability = component.StabilityLevelDevelopment ) diff --git a/processor/metricsgenerationprocessor/internal/metadata/generated_status.go b/processor/metricsgenerationprocessor/internal/metadata/generated_status.go index 253bfb8bd2e4..2bea557c4292 100644 --- a/processor/metricsgenerationprocessor/internal/metadata/generated_status.go +++ b/processor/metricsgenerationprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("experimental_metricsgeneration") +) + const ( - Type = "experimental_metricsgeneration" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/processor/metricstransformprocessor/internal/metadata/generated_status.go b/processor/metricstransformprocessor/internal/metadata/generated_status.go index 167c38cf3ed5..0efbaba1be85 100644 --- a/processor/metricstransformprocessor/internal/metadata/generated_status.go +++ b/processor/metricstransformprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("metricstransform") +) + const ( - Type = "metricstransform" MetricsStability = component.StabilityLevelBeta ) diff --git a/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go b/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go index 72871b302449..db01bb3121ec 100644 --- a/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go +++ b/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("probabilistic_sampler") +) + const ( - Type = "probabilistic_sampler" LogsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelBeta ) diff --git a/processor/probabilisticsamplerprocessor/metrics.go b/processor/probabilisticsamplerprocessor/metrics.go index ef11e05e441f..b1c5ec32a2b2 100644 --- a/processor/probabilisticsamplerprocessor/metrics.go +++ b/processor/probabilisticsamplerprocessor/metrics.go @@ -30,14 +30,14 @@ func samplingProcessorMetricViews(level configtelemetry.Level) []*view.View { sampledTagKeys := []tag.Key{tagPolicyKey, tagSampledKey} countTracesSampledView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statCountTracesSampled.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statCountTracesSampled.Name()), Measure: statCountTracesSampled, Description: statCountTracesSampled.Description(), TagKeys: sampledTagKeys, Aggregation: view.Sum(), } countLogsSampledView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statCountLogsSampled.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statCountLogsSampled.Name()), Measure: statCountLogsSampled, Description: statCountLogsSampled.Description(), TagKeys: sampledTagKeys, diff --git a/processor/redactionprocessor/internal/metadata/generated_status.go b/processor/redactionprocessor/internal/metadata/generated_status.go index 5b23e5082e05..ef1046b59dd1 100644 --- a/processor/redactionprocessor/internal/metadata/generated_status.go +++ b/processor/redactionprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("redaction") +) + const ( - Type = "redaction" TracesStability = component.StabilityLevelBeta ) diff --git a/processor/remotetapprocessor/internal/metadata/generated_status.go b/processor/remotetapprocessor/internal/metadata/generated_status.go index ecd8d35ad65d..82aae421a0ad 100644 --- a/processor/remotetapprocessor/internal/metadata/generated_status.go +++ b/processor/remotetapprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("remotetap") +) + const ( - Type = "remotetap" LogsStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelAlpha diff --git a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go index eba06df2b1ad..6a75a48cffd7 100644 --- a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go @@ -8,9 +8,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -const ( - Type = "resourcedetectionprocessor/azure" -) +const () func Meter(settings component.TelemetrySettings) metric.Meter { return settings.MeterProvider.Meter("otelcol/resourcedetection") diff --git a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go index beedf104c271..6a75a48cffd7 100644 --- a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go @@ -8,9 +8,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -const ( - Type = "resourcedetectionprocessor/heroku" -) +const () func Meter(settings component.TelemetrySettings) metric.Meter { return settings.MeterProvider.Meter("otelcol/resourcedetection") diff --git a/processor/resourcedetectionprocessor/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/metadata/generated_status.go index 23d96c5f25fd..800f179cdbe6 100644 --- a/processor/resourcedetectionprocessor/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("resourcedetection") +) + const ( - Type = "resourcedetection" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go index 2a1605dc295c..6a75a48cffd7 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go @@ -8,9 +8,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -const ( - Type = "resourcedetectionprocessor/openshift" -) +const () func Meter(settings component.TelemetrySettings) metric.Meter { return settings.MeterProvider.Meter("otelcol/resourcedetection") diff --git a/processor/resourceprocessor/internal/metadata/generated_status.go b/processor/resourceprocessor/internal/metadata/generated_status.go index 9ace4f7f196c..f93deb81327e 100644 --- a/processor/resourceprocessor/internal/metadata/generated_status.go +++ b/processor/resourceprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("resource") +) + const ( - Type = "resource" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/processor/routingprocessor/internal/metadata/generated_status.go b/processor/routingprocessor/internal/metadata/generated_status.go index 2dc74a64d0a0..2c1a9cda3636 100644 --- a/processor/routingprocessor/internal/metadata/generated_status.go +++ b/processor/routingprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("routing") +) + const ( - Type = "routing" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/processor/routingprocessor/logs.go b/processor/routingprocessor/logs.go index e59cebc056aa..d300f0e2b82e 100644 --- a/processor/routingprocessor/logs.go +++ b/processor/routingprocessor/logs.go @@ -45,7 +45,7 @@ func newLogProcessor(settings component.TelemetrySettings, config component.Conf meter := settings.MeterProvider.Meter(scopeName + nameSep + "logs") nonRoutedLogRecordsCounter, err := meter.Int64Counter( - metadata.Type+metricSep+processorKey+metricSep+nonRoutedLogRecordsKey, + metadata.Type.String()+metricSep+processorKey+metricSep+nonRoutedLogRecordsKey, metric.WithDescription("Number of log records that were not routed to some or all exporters"), ) if err != nil { diff --git a/processor/routingprocessor/metrics.go b/processor/routingprocessor/metrics.go index 9ee474494e26..ea8f4b5ecbe2 100644 --- a/processor/routingprocessor/metrics.go +++ b/processor/routingprocessor/metrics.go @@ -45,7 +45,7 @@ func newMetricProcessor(settings component.TelemetrySettings, config component.C meter := settings.MeterProvider.Meter(scopeName + nameSep + "metrics") nonRoutedMetricPointsCounter, err := meter.Int64Counter( - metadata.Type+metricSep+processorKey+metricSep+nonRoutedMetricPointsKey, + metadata.Type.String()+metricSep+processorKey+metricSep+nonRoutedMetricPointsKey, metric.WithDescription("Number of metric points that were not routed to some or all exporters."), ) if err != nil { diff --git a/processor/routingprocessor/traces.go b/processor/routingprocessor/traces.go index f0f004c76ce6..779ca4f4fe5c 100644 --- a/processor/routingprocessor/traces.go +++ b/processor/routingprocessor/traces.go @@ -45,7 +45,7 @@ func newTracesProcessor(settings component.TelemetrySettings, config component.C meter := settings.MeterProvider.Meter(scopeName + nameSep + "traces") nonRoutedSpansCounter, err := meter.Int64Counter( - metadata.Type+metricSep+processorKey+metricSep+nonRoutedSpansKey, + metadata.Type.String()+metricSep+processorKey+metricSep+nonRoutedSpansKey, metric.WithDescription("Number of spans that were not routed to some or all exporters."), ) if err != nil { diff --git a/processor/schemaprocessor/internal/metadata/generated_status.go b/processor/schemaprocessor/internal/metadata/generated_status.go index e56e2c37e73a..df7de92c1475 100644 --- a/processor/schemaprocessor/internal/metadata/generated_status.go +++ b/processor/schemaprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("schema") +) + const ( - Type = "schema" TracesStability = component.StabilityLevelDevelopment MetricsStability = component.StabilityLevelDevelopment LogsStability = component.StabilityLevelDevelopment diff --git a/processor/spanmetricsprocessor/internal/metadata/generated_status.go b/processor/spanmetricsprocessor/internal/metadata/generated_status.go index c10c80d870e4..0bc0033037c0 100644 --- a/processor/spanmetricsprocessor/internal/metadata/generated_status.go +++ b/processor/spanmetricsprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("spanmetrics") +) + const ( - Type = "spanmetrics" TracesStability = component.StabilityLevelDeprecated ) diff --git a/processor/spanprocessor/factory_test.go b/processor/spanprocessor/factory_test.go index bcb9bc6d13ea..072f80bfa94f 100644 --- a/processor/spanprocessor/factory_test.go +++ b/processor/spanprocessor/factory_test.go @@ -20,7 +20,7 @@ import ( func TestFactory_Type(t *testing.T) { factory := NewFactory() - assert.Equal(t, factory.Type(), component.Type(metadata.Type)) + assert.Equal(t, factory.Type(), metadata.Type) } func TestFactory_CreateDefaultConfig(t *testing.T) { diff --git a/processor/spanprocessor/internal/metadata/generated_status.go b/processor/spanprocessor/internal/metadata/generated_status.go index 730db7bf9779..3fac8b49e470 100644 --- a/processor/spanprocessor/internal/metadata/generated_status.go +++ b/processor/spanprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("span") +) + const ( - Type = "span" TracesStability = component.StabilityLevelAlpha ) diff --git a/processor/sumologicprocessor/internal/metadata/generated_status.go b/processor/sumologicprocessor/internal/metadata/generated_status.go index c70c8b7fb4bd..63e95dbc1d1f 100644 --- a/processor/sumologicprocessor/internal/metadata/generated_status.go +++ b/processor/sumologicprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sumologic") +) + const ( - Type = "sumologic" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta diff --git a/processor/tailsamplingprocessor/internal/metadata/generated_status.go b/processor/tailsamplingprocessor/internal/metadata/generated_status.go index 06c076551b9a..89e61198cdee 100644 --- a/processor/tailsamplingprocessor/internal/metadata/generated_status.go +++ b/processor/tailsamplingprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("tail_sampling") +) + const ( - Type = "tail_sampling" TracesStability = component.StabilityLevelBeta ) diff --git a/processor/tailsamplingprocessor/metrics.go b/processor/tailsamplingprocessor/metrics.go index 8a70dd163c03..9cefb51fd596 100644 --- a/processor/tailsamplingprocessor/metrics.go +++ b/processor/tailsamplingprocessor/metrics.go @@ -47,34 +47,34 @@ func samplingProcessorMetricViews(level configtelemetry.Level) []*view.View { ageDistributionAggregation := view.Distribution(1, 2, 5, 10, 20, 30, 40, 50, 60, 90, 120, 180, 300, 600, 1800, 3600, 7200) decisionLatencyView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statDecisionLatencyMicroSec.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statDecisionLatencyMicroSec.Name()), Measure: statDecisionLatencyMicroSec, Description: statDecisionLatencyMicroSec.Description(), TagKeys: policyTagKeys, Aggregation: latencyDistributionAggregation, } overallDecisionLatencyView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statOverallDecisionLatencyUs.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statOverallDecisionLatencyUs.Name()), Measure: statOverallDecisionLatencyUs, Description: statOverallDecisionLatencyUs.Description(), Aggregation: latencyDistributionAggregation, } traceRemovalAgeView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statTraceRemovalAgeSec.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statTraceRemovalAgeSec.Name()), Measure: statTraceRemovalAgeSec, Description: statTraceRemovalAgeSec.Description(), Aggregation: ageDistributionAggregation, } lateSpanArrivalView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statLateSpanArrivalAfterDecision.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statLateSpanArrivalAfterDecision.Name()), Measure: statLateSpanArrivalAfterDecision, Description: statLateSpanArrivalAfterDecision.Description(), Aggregation: ageDistributionAggregation, } countPolicyEvaluationErrorView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statPolicyEvaluationErrorCount.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statPolicyEvaluationErrorCount.Name()), Measure: statPolicyEvaluationErrorCount, Description: statPolicyEvaluationErrorCount.Description(), Aggregation: view.Sum(), @@ -82,7 +82,7 @@ func samplingProcessorMetricViews(level configtelemetry.Level) []*view.View { sampledTagKeys := []tag.Key{tagPolicyKey, tagSampledKey} countTracesSampledView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statCountTracesSampled.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statCountTracesSampled.Name()), Measure: statCountTracesSampled, Description: statCountTracesSampled.Description(), TagKeys: sampledTagKeys, @@ -90,7 +90,7 @@ func samplingProcessorMetricViews(level configtelemetry.Level) []*view.View { } countGlobalTracesSampledView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statCountGlobalTracesSampled.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statCountGlobalTracesSampled.Name()), Measure: statCountGlobalTracesSampled, Description: statCountGlobalTracesSampled.Description(), TagKeys: []tag.Key{tagSampledKey}, @@ -98,19 +98,19 @@ func samplingProcessorMetricViews(level configtelemetry.Level) []*view.View { } countTraceDroppedTooEarlyView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statDroppedTooEarlyCount.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statDroppedTooEarlyCount.Name()), Measure: statDroppedTooEarlyCount, Description: statDroppedTooEarlyCount.Description(), Aggregation: view.Sum(), } countTraceIDArrivalView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statNewTraceIDReceivedCount.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statNewTraceIDReceivedCount.Name()), Measure: statNewTraceIDReceivedCount, Description: statNewTraceIDReceivedCount.Description(), Aggregation: view.Sum(), } trackTracesOnMemorylView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statTracesOnMemoryGauge.Name()), + Name: processorhelper.BuildCustomMetricName(metadata.Type.String(), statTracesOnMemoryGauge.Name()), Measure: statTracesOnMemoryGauge, Description: statTracesOnMemoryGauge.Description(), Aggregation: view.LastValue(), diff --git a/processor/transformprocessor/factory_test.go b/processor/transformprocessor/factory_test.go index af670d5bf841..c9cc89ca2459 100644 --- a/processor/transformprocessor/factory_test.go +++ b/processor/transformprocessor/factory_test.go @@ -23,7 +23,7 @@ import ( func TestFactory_Type(t *testing.T) { factory := NewFactory() - assert.Equal(t, factory.Type(), component.Type(metadata.Type)) + assert.Equal(t, factory.Type(), metadata.Type) } func TestFactory_CreateDefaultConfig(t *testing.T) { diff --git a/processor/transformprocessor/internal/metadata/generated_status.go b/processor/transformprocessor/internal/metadata/generated_status.go index 9ac7b26f2525..871a7daeb918 100644 --- a/processor/transformprocessor/internal/metadata/generated_status.go +++ b/processor/transformprocessor/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("transform") +) + const ( - Type = "transform" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/receiver/activedirectorydsreceiver/factory_windows.go b/receiver/activedirectorydsreceiver/factory_windows.go index 60156ca495d0..a5e482a9b5e4 100644 --- a/receiver/activedirectorydsreceiver/factory_windows.go +++ b/receiver/activedirectorydsreceiver/factory_windows.go @@ -32,7 +32,7 @@ func createMetricsReceiver( adds := newActiveDirectoryDSScraper(c.MetricsBuilderConfig, params) scraper, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), adds.scrape, scraperhelper.WithStart(adds.start), scraperhelper.WithShutdown(adds.shutdown), diff --git a/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go b/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go index 98a1160d8453..3bc51ff26862 100644 --- a/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go +++ b/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("active_directory_ds") +) + const ( - Type = "active_directory_ds" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/aerospikereceiver/factory.go b/receiver/aerospikereceiver/factory.go index 3f49c631aec0..63f15633f252 100644 --- a/receiver/aerospikereceiver/factory.go +++ b/receiver/aerospikereceiver/factory.go @@ -44,7 +44,7 @@ func createMetricsReceiver( } scraper, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), receiver.scrape, scraperhelper.WithStart(receiver.start), scraperhelper.WithShutdown(receiver.shutdown), diff --git a/receiver/aerospikereceiver/internal/metadata/generated_status.go b/receiver/aerospikereceiver/internal/metadata/generated_status.go index 78be7a216a94..d13f2376f166 100644 --- a/receiver/aerospikereceiver/internal/metadata/generated_status.go +++ b/receiver/aerospikereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("aerospike") +) + const ( - Type = "aerospike" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/apachereceiver/factory.go b/receiver/apachereceiver/factory.go index f11e1dde6719..ab17714fd2b1 100644 --- a/receiver/apachereceiver/factory.go +++ b/receiver/apachereceiver/factory.go @@ -74,7 +74,7 @@ func createMetricsReceiver( } ns := newApacheScraper(params, cfg, serverName, port) - scraper, err := scraperhelper.NewScraper(metadata.Type, ns.scrape, scraperhelper.WithStart(ns.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ns.scrape, scraperhelper.WithStart(ns.start)) if err != nil { return nil, err } diff --git a/receiver/apachereceiver/internal/metadata/generated_status.go b/receiver/apachereceiver/internal/metadata/generated_status.go index 870bb1c2a3ac..d5094f371c57 100644 --- a/receiver/apachereceiver/internal/metadata/generated_status.go +++ b/receiver/apachereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("apache") +) + const ( - Type = "apache" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/apachesparkreceiver/factory.go b/receiver/apachesparkreceiver/factory.go index b2ec51d11045..1568c270993b 100644 --- a/receiver/apachesparkreceiver/factory.go +++ b/receiver/apachesparkreceiver/factory.go @@ -53,7 +53,7 @@ func createMetricsReceiver( } sparkScraper := newSparkScraper(params.Logger, sparkConfig, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, sparkScraper.scrape, + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), sparkScraper.scrape, scraperhelper.WithStart(sparkScraper.start)) if err != nil { return nil, err diff --git a/receiver/apachesparkreceiver/internal/metadata/generated_status.go b/receiver/apachesparkreceiver/internal/metadata/generated_status.go index 71eeacd3063f..eb4b23d89250 100644 --- a/receiver/apachesparkreceiver/internal/metadata/generated_status.go +++ b/receiver/apachesparkreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("apachespark") +) + const ( - Type = "apachespark" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go b/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go index b8795e41e369..7aa82afe675a 100644 --- a/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awscloudwatchmetrics") +) + const ( - Type = "awscloudwatchmetrics" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go b/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go index 4e2b6df838a9..f9a3fd7a7258 100644 --- a/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go +++ b/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awscloudwatch") +) + const ( - Type = "awscloudwatch" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go b/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go index 75b28f270687..107c7913fbd2 100644 --- a/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go +++ b/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awscontainerinsightreceiver") +) + const ( - Type = "awscontainerinsightreceiver" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go b/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go index 8f9401e2bb2f..f4d87bd9774a 100644 --- a/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awsecscontainermetrics") +) + const ( - Type = "awsecscontainermetrics" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/awsfirehosereceiver/internal/metadata/generated_status.go b/receiver/awsfirehosereceiver/internal/metadata/generated_status.go index ee52e719a041..6ba6d7b23b2f 100644 --- a/receiver/awsfirehosereceiver/internal/metadata/generated_status.go +++ b/receiver/awsfirehosereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awsfirehose") +) + const ( - Type = "awsfirehose" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/awsxrayreceiver/factory_test.go b/receiver/awsxrayreceiver/factory_test.go index 6190dc4f75e6..c2b0e0b16c4a 100644 --- a/receiver/awsxrayreceiver/factory_test.go +++ b/receiver/awsxrayreceiver/factory_test.go @@ -23,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) { assert.NotNil(t, cfg, "failed to create default config") assert.NoError(t, componenttest.CheckConfigStruct(cfg)) - assert.Equal(t, component.Type(metadata.Type), factory.Type()) + assert.Equal(t, metadata.Type, factory.Type()) } func TestCreateTracesReceiver(t *testing.T) { diff --git a/receiver/awsxrayreceiver/internal/metadata/generated_status.go b/receiver/awsxrayreceiver/internal/metadata/generated_status.go index dfb257d0fee3..c6b9b04339a4 100644 --- a/receiver/awsxrayreceiver/internal/metadata/generated_status.go +++ b/receiver/awsxrayreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("awsxray") +) + const ( - Type = "awsxray" TracesStability = component.StabilityLevelBeta ) diff --git a/receiver/awsxrayreceiver/internal/udppoller/poller.go b/receiver/awsxrayreceiver/internal/udppoller/poller.go index e6d45a91a8fe..fe2c82071b0f 100644 --- a/receiver/awsxrayreceiver/internal/udppoller/poller.go +++ b/receiver/awsxrayreceiver/internal/udppoller/poller.go @@ -174,11 +174,11 @@ func (p *poller) poll() { // TODO: We may want to attempt to shutdown/clean the broken socket and open a new one // with the same address p.logger.Error("Irrecoverable socket read error. Exiting poller", zap.Error(err)) - p.obsrecv.EndTracesOp(ctx, metadata.Type, 1, err) + p.obsrecv.EndTracesOp(ctx, metadata.Type.String(), 1, err) return } else if errors.As(err, &errRecv) { p.logger.Error("Recoverable socket read error", zap.Error(err)) - p.obsrecv.EndTracesOp(ctx, metadata.Type, 1, err) + p.obsrecv.EndTracesOp(ctx, metadata.Type.String(), 1, err) continue } @@ -190,7 +190,7 @@ func (p *poller) poll() { if errors.As(err, &errRecv) { p.logger.Error("Failed to split segment header and body", zap.Error(err)) - p.obsrecv.EndTracesOp(ctx, metadata.Type, 1, err) + p.obsrecv.EndTracesOp(ctx, metadata.Type.String(), 1, err) continue } @@ -199,7 +199,7 @@ func (p *poller) poll() { zap.String("header format", header.Format), zap.Int("header version", header.Version), ) - p.obsrecv.EndTracesOp(ctx, metadata.Type, 1, + p.obsrecv.EndTracesOp(ctx, metadata.Type.String(), 1, errors.New("dropped span due to missing body that contains segment")) continue } @@ -210,7 +210,7 @@ func (p *poller) poll() { Payload: copybody, Ctx: ctx, } - p.obsrecv.EndTracesOp(ctx, metadata.Type, 1, nil) + p.obsrecv.EndTracesOp(ctx, metadata.Type.String(), 1, nil) } } } diff --git a/receiver/awsxrayreceiver/internal/udppoller/poller_test.go b/receiver/awsxrayreceiver/internal/udppoller/poller_test.go index 46cbb45c7160..04e9911bc7f0 100644 --- a/receiver/awsxrayreceiver/internal/udppoller/poller_test.go +++ b/receiver/awsxrayreceiver/internal/udppoller/poller_test.go @@ -138,7 +138,7 @@ func TestSuccessfullyPollPacket(t *testing.T) { }) require.NoError(t, err) ctx := obsrecv.StartMetricsOp(seg.Ctx) - obsrecv.EndTracesOp(ctx, metadata.Type, 1, nil) + obsrecv.EndTracesOp(ctx, metadata.Type.String(), 1, nil) return open && randString.String() == string(seg.Payload) default: return false diff --git a/receiver/awsxrayreceiver/receiver.go b/receiver/awsxrayreceiver/receiver.go index 9bdd2a37d395..887ba542adbe 100644 --- a/receiver/awsxrayreceiver/receiver.go +++ b/receiver/awsxrayreceiver/receiver.go @@ -114,16 +114,16 @@ func (x *xrayReceiver) start() { traces, totalSpanCount, err := translator.ToTraces(seg.Payload, x.registry.LoadOrNop(x.settings.ID)) if err != nil { x.settings.Logger.Warn("X-Ray segment to OT traces conversion failed", zap.Error(err)) - x.obsrecv.EndTracesOp(ctx, metadata.Type, totalSpanCount, err) + x.obsrecv.EndTracesOp(ctx, metadata.Type.String(), totalSpanCount, err) continue } err = x.consumer.ConsumeTraces(ctx, traces) if err != nil { x.settings.Logger.Warn("Trace consumer errored out", zap.Error(err)) - x.obsrecv.EndTracesOp(ctx, metadata.Type, totalSpanCount, err) + x.obsrecv.EndTracesOp(ctx, metadata.Type.String(), totalSpanCount, err) continue } - x.obsrecv.EndTracesOp(ctx, metadata.Type, totalSpanCount, nil) + x.obsrecv.EndTracesOp(ctx, metadata.Type.String(), totalSpanCount, nil) } } diff --git a/receiver/azureblobreceiver/internal/metadata/generated_status.go b/receiver/azureblobreceiver/internal/metadata/generated_status.go index 167e958fe000..2d1c9dec8792 100644 --- a/receiver/azureblobreceiver/internal/metadata/generated_status.go +++ b/receiver/azureblobreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("azureblob") +) + const ( - Type = "azureblob" LogsStability = component.StabilityLevelDevelopment TracesStability = component.StabilityLevelDevelopment ) diff --git a/receiver/azureblobreceiver/receiver.go b/receiver/azureblobreceiver/receiver.go index 5484b18550dd..0e26bc65794a 100644 --- a/receiver/azureblobreceiver/receiver.go +++ b/receiver/azureblobreceiver/receiver.go @@ -71,7 +71,7 @@ func (b *blobReceiver) consumeLogsJSON(ctx context.Context, json []byte) error { err = b.nextLogsConsumer.ConsumeLogs(logsContext, logs) - b.obsrecv.EndLogsOp(logsContext, metadata.Type, 1, err) + b.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err) return err } @@ -90,7 +90,7 @@ func (b *blobReceiver) consumeTracesJSON(ctx context.Context, json []byte) error err = b.nextTracesConsumer.ConsumeTraces(tracesContext, traces) - b.obsrecv.EndTracesOp(tracesContext, metadata.Type, 1, err) + b.obsrecv.EndTracesOp(tracesContext, metadata.Type.String(), 1, err) return err } diff --git a/receiver/azureeventhubreceiver/eventhubhandler_test.go b/receiver/azureeventhubreceiver/eventhubhandler_test.go index 8fdb6778f9c6..8b086f2fde9a 100644 --- a/receiver/azureeventhubreceiver/eventhubhandler_test.go +++ b/receiver/azureeventhubreceiver/eventhubhandler_test.go @@ -78,7 +78,7 @@ func (m *mockDataConsumer) consume(ctx context.Context, event *eventhub.Event) e } err = m.nextLogsConsumer.ConsumeLogs(logsContext, logs) - m.obsrecv.EndLogsOp(logsContext, metadata.Type, 1, err) + m.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err) return err } diff --git a/receiver/azureeventhubreceiver/factory.go b/receiver/azureeventhubreceiver/factory.go index 4c15d0e4d59e..a9d0bfea544d 100644 --- a/receiver/azureeventhubreceiver/factory.go +++ b/receiver/azureeventhubreceiver/factory.go @@ -15,9 +15,9 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata" ) -const ( +var ( // The receiver scope name - receiverScopeName = "otelcol/" + metadata.Type + "receiver" + receiverScopeName = "otelcol/" + metadata.Type.String() + "receiver" ) var ( diff --git a/receiver/azureeventhubreceiver/internal/metadata/generated_status.go b/receiver/azureeventhubreceiver/internal/metadata/generated_status.go index a44b92d8eb82..23cb579bc0f4 100644 --- a/receiver/azureeventhubreceiver/internal/metadata/generated_status.go +++ b/receiver/azureeventhubreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("azureeventhub") +) + const ( - Type = "azureeventhub" MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/azureeventhubreceiver/receiver.go b/receiver/azureeventhubreceiver/receiver.go index 2370f9c910ae..1f407c1737ce 100644 --- a/receiver/azureeventhubreceiver/receiver.go +++ b/receiver/azureeventhubreceiver/receiver.go @@ -99,7 +99,7 @@ func (receiver *eventhubReceiver) consumeLogs(ctx context.Context, event *eventh receiver.logger.Debug("Log Records", zap.Any("logs", logs)) err = receiver.nextLogsConsumer.ConsumeLogs(logsContext, logs) - receiver.obsrecv.EndLogsOp(logsContext, metadata.Type, 1, err) + receiver.obsrecv.EndLogsOp(logsContext, metadata.Type.String(), 1, err) return err } @@ -124,7 +124,7 @@ func (receiver *eventhubReceiver) consumeMetrics(ctx context.Context, event *eve receiver.logger.Debug("Metric Records", zap.Any("metrics", metrics)) err = receiver.nextMetricsConsumer.ConsumeMetrics(metricsContext, metrics) - receiver.obsrecv.EndMetricsOp(metricsContext, metadata.Type, 1, err) + receiver.obsrecv.EndMetricsOp(metricsContext, metadata.Type.String(), 1, err) return err } diff --git a/receiver/azuremonitorreceiver/factory.go b/receiver/azuremonitorreceiver/factory.go index 4afb337d583c..96800cbea13c 100644 --- a/receiver/azuremonitorreceiver/factory.go +++ b/receiver/azuremonitorreceiver/factory.go @@ -54,7 +54,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC } azureScraper := newScraper(cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, azureScraper.scrape, scraperhelper.WithStart(azureScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), azureScraper.scrape, scraperhelper.WithStart(azureScraper.start)) if err != nil { return nil, err } diff --git a/receiver/azuremonitorreceiver/internal/metadata/generated_status.go b/receiver/azuremonitorreceiver/internal/metadata/generated_status.go index 4e756b90dab0..2355f6a730e1 100644 --- a/receiver/azuremonitorreceiver/internal/metadata/generated_status.go +++ b/receiver/azuremonitorreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("azuremonitor") +) + const ( - Type = "azuremonitor" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/bigipreceiver/factory.go b/receiver/bigipreceiver/factory.go index 9f9f40b1da69..5ab5837425bf 100644 --- a/receiver/bigipreceiver/factory.go +++ b/receiver/bigipreceiver/factory.go @@ -49,7 +49,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC } bigipScraper := newScraper(params.Logger, cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, bigipScraper.scrape, scraperhelper.WithStart(bigipScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), bigipScraper.scrape, scraperhelper.WithStart(bigipScraper.start)) if err != nil { return nil, err } diff --git a/receiver/bigipreceiver/internal/metadata/generated_status.go b/receiver/bigipreceiver/internal/metadata/generated_status.go index 7e3d39fee4d9..97d40339eab2 100644 --- a/receiver/bigipreceiver/internal/metadata/generated_status.go +++ b/receiver/bigipreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("bigip") +) + const ( - Type = "bigip" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/carbonreceiver/internal/metadata/generated_status.go b/receiver/carbonreceiver/internal/metadata/generated_status.go index 8fa4e933ad9c..7531a830d141 100644 --- a/receiver/carbonreceiver/internal/metadata/generated_status.go +++ b/receiver/carbonreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("carbon") +) + const ( - Type = "carbon" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/chronyreceiver/factory.go b/receiver/chronyreceiver/factory.go index 22899a579986..ac0195111481 100644 --- a/receiver/chronyreceiver/factory.go +++ b/receiver/chronyreceiver/factory.go @@ -39,7 +39,7 @@ func newMetricsReceiver( return nil, err } scraper, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), newScraper(ctx, chronyc, cfg, set).scrape, ) if err != nil { diff --git a/receiver/chronyreceiver/internal/metadata/generated_status.go b/receiver/chronyreceiver/internal/metadata/generated_status.go index 7a6939b6ca85..463507add2f1 100644 --- a/receiver/chronyreceiver/internal/metadata/generated_status.go +++ b/receiver/chronyreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("chrony") +) + const ( - Type = "chrony" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/cloudflarereceiver/internal/metadata/generated_status.go b/receiver/cloudflarereceiver/internal/metadata/generated_status.go index 83893156d838..bf0347b04d25 100644 --- a/receiver/cloudflarereceiver/internal/metadata/generated_status.go +++ b/receiver/cloudflarereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("cloudflare") +) + const ( - Type = "cloudflare" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/cloudflarereceiver/logs.go b/receiver/cloudflarereceiver/logs.go index ccd9cca74a8d..f8f260770d06 100644 --- a/receiver/cloudflarereceiver/logs.go +++ b/receiver/cloudflarereceiver/logs.go @@ -38,7 +38,8 @@ type logsReceiver struct { } const secretHeaderName = "X-CF-Secret" -const receiverScopeName = "otelcol/" + metadata.Type + +var receiverScopeName = "otelcol/" + metadata.Type.String() func newLogsReceiver(params rcvr.CreateSettings, cfg *Config, consumer consumer.Logs) (*logsReceiver, error) { recv := &logsReceiver{ diff --git a/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go b/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go index fd69ff02cda3..66bed4ad4cf8 100644 --- a/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go +++ b/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("cloudfoundry") +) + const ( - Type = "cloudfoundry" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/collectdreceiver/internal/metadata/generated_status.go b/receiver/collectdreceiver/internal/metadata/generated_status.go index 9fa9bd1a1cfd..500490e9bfde 100644 --- a/receiver/collectdreceiver/internal/metadata/generated_status.go +++ b/receiver/collectdreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("collectd") +) + const ( - Type = "collectd" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/collectdreceiver/receiver.go b/receiver/collectdreceiver/receiver.go index 50dee268977d..49ce8e27e1d6 100644 --- a/receiver/collectdreceiver/receiver.go +++ b/receiver/collectdreceiver/receiver.go @@ -98,21 +98,21 @@ func (cdr *collectdReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { ctx = cdr.obsrecv.StartMetricsOp(ctx) if r.Method != "POST" { - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, errors.New("invalid http verb")) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, errors.New("invalid http verb")) w.WriteHeader(http.StatusBadRequest) return } body, err := io.ReadAll(r.Body) if err != nil { - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, err) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, err) w.WriteHeader(http.StatusBadRequest) return } var records []collectDRecord err = json.Unmarshal(body, &records) if err != nil { - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, err) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, err) cdr.handleHTTPErr(w, err, "unable to decode json") return } @@ -124,7 +124,7 @@ func (cdr *collectdReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { for _, record := range records { err = record.appendToMetrics(cdr.logger, scopeMetrics, defaultAttrs) if err != nil { - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, len(records), err) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), len(records), err) cdr.handleHTTPErr(w, err, "unable to process metrics") return } @@ -133,16 +133,16 @@ func (cdr *collectdReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { err = cdr.nextConsumer.ConsumeMetrics(ctx, metrics) if err != nil { - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, lenDp, err) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), lenDp, err) return } _, err = w.Write([]byte("OK")) if err != nil { - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, lenDp, err) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), lenDp, err) return } - cdr.obsrecv.EndMetricsOp(ctx, metadata.Type, lenDp, nil) + cdr.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), lenDp, nil) } func (cdr *collectdReceiver) defaultAttributes(req *http.Request) map[string]string { diff --git a/receiver/couchdbreceiver/factory.go b/receiver/couchdbreceiver/factory.go index de7cf6c8e2a8..baeebf8359d0 100644 --- a/receiver/couchdbreceiver/factory.go +++ b/receiver/couchdbreceiver/factory.go @@ -45,7 +45,7 @@ func createMetricsReceiver( ) (receiver.Metrics, error) { cfg := rConf.(*Config) ns := newCouchdbScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, ns.scrape, scraperhelper.WithStart(ns.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ns.scrape, scraperhelper.WithStart(ns.start)) if err != nil { return nil, err } diff --git a/receiver/couchdbreceiver/internal/metadata/generated_status.go b/receiver/couchdbreceiver/internal/metadata/generated_status.go index 3324981bbbe9..24e0ce01bf8e 100644 --- a/receiver/couchdbreceiver/internal/metadata/generated_status.go +++ b/receiver/couchdbreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("couchdb") +) + const ( - Type = "couchdb" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/datadogreceiver/internal/metadata/generated_status.go b/receiver/datadogreceiver/internal/metadata/generated_status.go index a1e7e3ce0d44..01e1ff45b697 100644 --- a/receiver/datadogreceiver/internal/metadata/generated_status.go +++ b/receiver/datadogreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("datadog") +) + const ( - Type = "datadog" TracesStability = component.StabilityLevelAlpha ) diff --git a/receiver/dockerstatsreceiver/factory.go b/receiver/dockerstatsreceiver/factory.go index f86bea25ab10..c96a9dfaed55 100644 --- a/receiver/dockerstatsreceiver/factory.go +++ b/receiver/dockerstatsreceiver/factory.go @@ -52,7 +52,7 @@ func createMetricsReceiver( dockerConfig := config.(*Config) dsr := newMetricsReceiver(params, dockerConfig) - scrp, err := scraperhelper.NewScraper(metadata.Type, dsr.scrapeV2, scraperhelper.WithStart(dsr.start)) + scrp, err := scraperhelper.NewScraper(metadata.Type.String(), dsr.scrapeV2, scraperhelper.WithStart(dsr.start)) if err != nil { return nil, err } diff --git a/receiver/dockerstatsreceiver/internal/metadata/generated_status.go b/receiver/dockerstatsreceiver/internal/metadata/generated_status.go index 1081bd85d0cb..537150dc6fe0 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/generated_status.go +++ b/receiver/dockerstatsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("docker_stats") +) + const ( - Type = "docker_stats" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/elasticsearchreceiver/factory.go b/receiver/elasticsearchreceiver/factory.go index b64323dac3e9..413a30da4e6d 100644 --- a/receiver/elasticsearchreceiver/factory.go +++ b/receiver/elasticsearchreceiver/factory.go @@ -62,7 +62,7 @@ func createMetricsReceiver( } es := newElasticSearchScraper(params, c) - scraper, err := scraperhelper.NewScraper(metadata.Type, es.scrape, scraperhelper.WithStart(es.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), es.scrape, scraperhelper.WithStart(es.start)) if err != nil { return nil, err } diff --git a/receiver/elasticsearchreceiver/internal/metadata/generated_status.go b/receiver/elasticsearchreceiver/internal/metadata/generated_status.go index 19508d0618a7..3ffd3a6d2b4c 100644 --- a/receiver/elasticsearchreceiver/internal/metadata/generated_status.go +++ b/receiver/elasticsearchreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("elasticsearch") +) + const ( - Type = "elasticsearch" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/expvarreceiver/factory.go b/receiver/expvarreceiver/factory.go index e617a88d5856..1334ad0d1dc8 100644 --- a/receiver/expvarreceiver/factory.go +++ b/receiver/expvarreceiver/factory.go @@ -39,7 +39,7 @@ func newMetricsReceiver( expVar := newExpVarScraper(cfg, set) scraper, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), expVar.scrape, scraperhelper.WithStart(expVar.start), ) diff --git a/receiver/expvarreceiver/internal/metadata/generated_status.go b/receiver/expvarreceiver/internal/metadata/generated_status.go index 3a161a54892c..bc1d7c771b3a 100644 --- a/receiver/expvarreceiver/internal/metadata/generated_status.go +++ b/receiver/expvarreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("expvar") +) + const ( - Type = "expvar" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/filelogreceiver/internal/metadata/generated_status.go b/receiver/filelogreceiver/internal/metadata/generated_status.go index af0ec1daee9b..fd46b73b2224 100644 --- a/receiver/filelogreceiver/internal/metadata/generated_status.go +++ b/receiver/filelogreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("filelog") +) + const ( - Type = "filelog" LogsStability = component.StabilityLevelBeta ) diff --git a/receiver/filereceiver/internal/metadata/generated_status.go b/receiver/filereceiver/internal/metadata/generated_status.go index 52d9e4b70db5..8c577d37c282 100644 --- a/receiver/filereceiver/internal/metadata/generated_status.go +++ b/receiver/filereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("file") +) + const ( - Type = "file" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/filestatsreceiver/factory.go b/receiver/filestatsreceiver/factory.go index c3ec097c3a3b..db397268fa9b 100644 --- a/receiver/filestatsreceiver/factory.go +++ b/receiver/filestatsreceiver/factory.go @@ -38,7 +38,7 @@ func newReceiver( fileStatsConfig := cfg.(*Config) mp := newScraper(fileStatsConfig, settings) - s, err := scraperhelper.NewScraper(metadata.Type, mp.scrape) + s, err := scraperhelper.NewScraper(metadata.Type.String(), mp.scrape) if err != nil { return nil, err } diff --git a/receiver/filestatsreceiver/internal/metadata/generated_status.go b/receiver/filestatsreceiver/internal/metadata/generated_status.go index fe2affc5b847..6e4ce9b5b9a5 100644 --- a/receiver/filestatsreceiver/internal/metadata/generated_status.go +++ b/receiver/filestatsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("filestats") +) + const ( - Type = "filestats" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/flinkmetricsreceiver/factory.go b/receiver/flinkmetricsreceiver/factory.go index 2afaf2404179..e5d3a8de66fb 100644 --- a/receiver/flinkmetricsreceiver/factory.go +++ b/receiver/flinkmetricsreceiver/factory.go @@ -53,7 +53,7 @@ func createMetricsReceiver( return nil, errConfigNotflinkmetrics } ns := newflinkScraper(cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, ns.scrape, scraperhelper.WithStart(ns.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ns.scrape, scraperhelper.WithStart(ns.start)) if err != nil { return nil, err } diff --git a/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go b/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go index c7c54c576fa5..a35bcbb774c2 100644 --- a/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("flinkmetrics") +) + const ( - Type = "flinkmetrics" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/fluentforwardreceiver/internal/metadata/generated_status.go b/receiver/fluentforwardreceiver/internal/metadata/generated_status.go index af9b652c005f..d49cc6b2320c 100644 --- a/receiver/fluentforwardreceiver/internal/metadata/generated_status.go +++ b/receiver/fluentforwardreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("fluentforward") +) + const ( - Type = "fluentforward" LogsStability = component.StabilityLevelBeta ) diff --git a/receiver/gitproviderreceiver/internal/metadata/generated_status.go b/receiver/gitproviderreceiver/internal/metadata/generated_status.go index 7418c60fae43..bfcdeec1aa56 100644 --- a/receiver/gitproviderreceiver/internal/metadata/generated_status.go +++ b/receiver/gitproviderreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("gitprovider") +) + const ( - Type = "gitprovider" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/googlecloudpubsubreceiver/factory_test.go b/receiver/googlecloudpubsubreceiver/factory_test.go index d4e97c5c6d4b..88838e0b145e 100644 --- a/receiver/googlecloudpubsubreceiver/factory_test.go +++ b/receiver/googlecloudpubsubreceiver/factory_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver/receivertest" @@ -25,7 +24,7 @@ func TestCreateDefaultConfig(t *testing.T) { func TestType(t *testing.T) { factory := NewFactory() - assert.Equal(t, component.Type(metadata.Type), factory.Type()) + assert.Equal(t, metadata.Type, factory.Type()) } func TestCreateTracesReceiver(t *testing.T) { diff --git a/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go b/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go index 6fbc953505eb..dc564ad9e3c6 100644 --- a/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go +++ b/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("googlecloudpubsub") +) + const ( - Type = "googlecloudpubsub" TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta diff --git a/receiver/googlecloudspannerreceiver/factory.go b/receiver/googlecloudspannerreceiver/factory.go index efe120b44828..76ad73ffcb70 100644 --- a/receiver/googlecloudspannerreceiver/factory.go +++ b/receiver/googlecloudspannerreceiver/factory.go @@ -50,7 +50,7 @@ func createMetricsReceiver( rCfg := baseCfg.(*Config) r := newGoogleCloudSpannerReceiver(settings.Logger, rCfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, r.Scrape, scraperhelper.WithStart(r.Start), + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), r.Scrape, scraperhelper.WithStart(r.Start), scraperhelper.WithShutdown(r.Shutdown)) if err != nil { return nil, err diff --git a/receiver/googlecloudspannerreceiver/factory_test.go b/receiver/googlecloudspannerreceiver/factory_test.go index 6541d95472d0..d07e16af5d7a 100644 --- a/receiver/googlecloudspannerreceiver/factory_test.go +++ b/receiver/googlecloudspannerreceiver/factory_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver/receivertest" @@ -24,7 +23,7 @@ func TestCreateDefaultConfig(t *testing.T) { func TestType(t *testing.T) { factory := NewFactory() - assert.Equal(t, component.Type(metadata.Type), factory.Type()) + assert.Equal(t, metadata.Type, factory.Type()) } func TestCreateMetricsReceiver(t *testing.T) { diff --git a/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go b/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go index 8a5b22791786..b3d026546893 100644 --- a/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go +++ b/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("googlecloudspanner") +) + const ( - Type = "googlecloudspanner" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/haproxyreceiver/factory.go b/receiver/haproxyreceiver/factory.go index 7ecfb452b460..fdabd7e2ef5a 100644 --- a/receiver/haproxyreceiver/factory.go +++ b/receiver/haproxyreceiver/factory.go @@ -37,7 +37,7 @@ func newReceiver( ) (receiver.Metrics, error) { haProxyCfg := cfg.(*Config) mp := newScraper(haProxyCfg, settings) - s, err := scraperhelper.NewScraper(metadata.Type, mp.scrape, scraperhelper.WithStart(mp.start)) + s, err := scraperhelper.NewScraper(metadata.Type.String(), mp.scrape, scraperhelper.WithStart(mp.start)) if err != nil { return nil, err } diff --git a/receiver/haproxyreceiver/internal/metadata/generated_status.go b/receiver/haproxyreceiver/internal/metadata/generated_status.go index f87f2a87d730..8f5c57a1f7a3 100644 --- a/receiver/haproxyreceiver/internal/metadata/generated_status.go +++ b/receiver/haproxyreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("haproxy") +) + const ( - Type = "haproxy" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/hostmetricsreceiver/internal/metadata/generated_status.go b/receiver/hostmetricsreceiver/internal/metadata/generated_status.go index 98c47b73ced1..19d3e14049cd 100644 --- a/receiver/hostmetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/hostmetricsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("hostmetrics") +) + const ( - Type = "hostmetrics" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/httpcheckreceiver/factory.go b/receiver/httpcheckreceiver/factory.go index b311c6316229..fae8cbb22655 100644 --- a/receiver/httpcheckreceiver/factory.go +++ b/receiver/httpcheckreceiver/factory.go @@ -44,7 +44,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC } httpcheckScraper := newScraper(cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, httpcheckScraper.scrape, scraperhelper.WithStart(httpcheckScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), httpcheckScraper.scrape, scraperhelper.WithStart(httpcheckScraper.start)) if err != nil { return nil, err } diff --git a/receiver/httpcheckreceiver/internal/metadata/generated_status.go b/receiver/httpcheckreceiver/internal/metadata/generated_status.go index 8428f435ef12..0eb85d909fd1 100644 --- a/receiver/httpcheckreceiver/internal/metadata/generated_status.go +++ b/receiver/httpcheckreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("httpcheck") +) + const ( - Type = "httpcheck" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/iisreceiver/factory_windows.go b/receiver/iisreceiver/factory_windows.go index 0bef9d48ab78..3b730611d722 100644 --- a/receiver/iisreceiver/factory_windows.go +++ b/receiver/iisreceiver/factory_windows.go @@ -25,7 +25,7 @@ func createMetricsReceiver( cfg := rConf.(*Config) rcvr := newIisReceiver(params, cfg, nextConsumer) - scraper, err := scraperhelper.NewScraper(metadata.Type, rcvr.scrape, + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), rcvr.scrape, scraperhelper.WithStart(rcvr.start), scraperhelper.WithShutdown(rcvr.shutdown)) if err != nil { diff --git a/receiver/iisreceiver/internal/metadata/generated_status.go b/receiver/iisreceiver/internal/metadata/generated_status.go index c3d3269a3932..9bd56047d0d1 100644 --- a/receiver/iisreceiver/internal/metadata/generated_status.go +++ b/receiver/iisreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("iis") +) + const ( - Type = "iis" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/influxdbreceiver/internal/metadata/generated_status.go b/receiver/influxdbreceiver/internal/metadata/generated_status.go index ab98f7407999..15bd0a3e3301 100644 --- a/receiver/influxdbreceiver/internal/metadata/generated_status.go +++ b/receiver/influxdbreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("influxdb") +) + const ( - Type = "influxdb" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/jaegerreceiver/internal/metadata/generated_status.go b/receiver/jaegerreceiver/internal/metadata/generated_status.go index f41e9f271679..d6894605509c 100644 --- a/receiver/jaegerreceiver/internal/metadata/generated_status.go +++ b/receiver/jaegerreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("jaeger") +) + const ( - Type = "jaeger" TracesStability = component.StabilityLevelBeta ) diff --git a/receiver/jmxreceiver/internal/metadata/generated_status.go b/receiver/jmxreceiver/internal/metadata/generated_status.go index 5f33297d4bd4..4a520a28a95d 100644 --- a/receiver/jmxreceiver/internal/metadata/generated_status.go +++ b/receiver/jmxreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("jmx") +) + const ( - Type = "jmx" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/journaldreceiver/internal/metadata/generated_status.go b/receiver/journaldreceiver/internal/metadata/generated_status.go index 8ae820cac5c0..badc9697ebc8 100644 --- a/receiver/journaldreceiver/internal/metadata/generated_status.go +++ b/receiver/journaldreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("journald") +) + const ( - Type = "journald" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_status.go b/receiver/k8sclusterreceiver/internal/metadata/generated_status.go index 784c87d59c29..290d9fefb06b 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_status.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("k8s_cluster") +) + const ( - Type = "k8s_cluster" MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/k8sclusterreceiver/receiver.go b/receiver/k8sclusterreceiver/receiver.go index 9b9dbefc596e..313c1f98d97c 100644 --- a/receiver/k8sclusterreceiver/receiver.go +++ b/receiver/k8sclusterreceiver/receiver.go @@ -110,7 +110,7 @@ func (kr *kubernetesReceiver) dispatchMetrics(ctx context.Context) { numPoints := mds.DataPointCount() err := kr.metricsConsumer.ConsumeMetrics(c, mds) - kr.obsrecv.EndMetricsOp(c, metadata.Type, numPoints, err) + kr.obsrecv.EndMetricsOp(c, metadata.Type.String(), numPoints, err) } // newMetricsReceiver creates the Kubernetes cluster receiver with the given configuration. diff --git a/receiver/k8seventsreceiver/internal/metadata/generated_status.go b/receiver/k8seventsreceiver/internal/metadata/generated_status.go index 3c9e145082dc..c409ea67fb82 100644 --- a/receiver/k8seventsreceiver/internal/metadata/generated_status.go +++ b/receiver/k8seventsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("k8s_events") +) + const ( - Type = "k8s_events" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/k8seventsreceiver/receiver.go b/receiver/k8seventsreceiver/receiver.go index dc0e6f2d6450..34410be01361 100644 --- a/receiver/k8seventsreceiver/receiver.go +++ b/receiver/k8seventsreceiver/receiver.go @@ -112,7 +112,7 @@ func (kr *k8seventsReceiver) handleEvent(ev *corev1.Event) { ctx := kr.obsrecv.StartLogsOp(kr.ctx) consumerErr := kr.logsConsumer.ConsumeLogs(ctx, ld) - kr.obsrecv.EndLogsOp(ctx, metadata.Type, 1, consumerErr) + kr.obsrecv.EndLogsOp(ctx, metadata.Type.String(), 1, consumerErr) } } diff --git a/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go b/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go index 33e5b5d2de8e..f258c886a3cb 100644 --- a/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go +++ b/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("k8sobjects") +) + const ( - Type = "k8sobjects" LogsStability = component.StabilityLevelBeta ) diff --git a/receiver/k8sobjectsreceiver/receiver.go b/receiver/k8sobjectsreceiver/receiver.go index b19265f6852b..71e32c75cba0 100644 --- a/receiver/k8sobjectsreceiver/receiver.go +++ b/receiver/k8sobjectsreceiver/receiver.go @@ -141,7 +141,7 @@ func (kr *k8sobjectsreceiver) startPull(ctx context.Context, config *K8sObjectsC obsCtx := kr.obsrecv.StartLogsOp(ctx) logRecordCount := logs.LogRecordCount() err = kr.consumer.ConsumeLogs(obsCtx, logs) - kr.obsrecv.EndLogsOp(obsCtx, metadata.Type, logRecordCount, err) + kr.obsrecv.EndLogsOp(obsCtx, metadata.Type.String(), logRecordCount, err) } case <-stopperChan: return @@ -223,7 +223,7 @@ func (kr *k8sobjectsreceiver) doWatch(ctx context.Context, config *K8sObjectsCon } else { obsCtx := kr.obsrecv.StartLogsOp(ctx) err := kr.consumer.ConsumeLogs(obsCtx, logs) - kr.obsrecv.EndLogsOp(obsCtx, metadata.Type, 1, err) + kr.obsrecv.EndLogsOp(obsCtx, metadata.Type.String(), 1, err) } case <-stopperChan: watcher.Stop() diff --git a/receiver/kafkametricsreceiver/internal/metadata/generated_status.go b/receiver/kafkametricsreceiver/internal/metadata/generated_status.go index 3cfff1ef398c..7caf153923da 100644 --- a/receiver/kafkametricsreceiver/internal/metadata/generated_status.go +++ b/receiver/kafkametricsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("kafkametrics") +) + const ( - Type = "kafkametrics" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/kafkareceiver/internal/metadata/generated_status.go b/receiver/kafkareceiver/internal/metadata/generated_status.go index b8f06cb67437..0fcde389867f 100644 --- a/receiver/kafkareceiver/internal/metadata/generated_status.go +++ b/receiver/kafkareceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("kafka") +) + const ( - Type = "kafka" MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta TracesStability = component.StabilityLevelBeta diff --git a/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go b/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go index 69c4917f6879..e6f7a1c7db86 100644 --- a/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go +++ b/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("kubeletstats") +) + const ( - Type = "kubeletstats" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/kubeletstatsreceiver/scraper.go b/receiver/kubeletstatsreceiver/scraper.go index f6aa46bc9970..c7f95d8703f0 100644 --- a/receiver/kubeletstatsreceiver/scraper.go +++ b/receiver/kubeletstatsreceiver/scraper.go @@ -68,7 +68,7 @@ func newKubletScraper( metricsConfig.Metrics.K8sContainerMemoryLimitUtilization.Enabled || metricsConfig.Metrics.K8sContainerMemoryRequestUtilization.Enabled, } - return scraperhelper.NewScraper(metadata.Type, ks.scrape) + return scraperhelper.NewScraper(metadata.Type.String(), ks.scrape) } func (r *kubletScraper) scrape(context.Context) (pmetric.Metrics, error) { diff --git a/receiver/lokireceiver/internal/metadata/generated_status.go b/receiver/lokireceiver/internal/metadata/generated_status.go index 81830681b00b..2f1739a88c2a 100644 --- a/receiver/lokireceiver/internal/metadata/generated_status.go +++ b/receiver/lokireceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("loki") +) + const ( - Type = "loki" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/memcachedreceiver/factory.go b/receiver/memcachedreceiver/factory.go index faf73a2e9368..4f4cc77f2dbc 100644 --- a/receiver/memcachedreceiver/factory.go +++ b/receiver/memcachedreceiver/factory.go @@ -54,7 +54,7 @@ func createMetricsReceiver( ms := newMemcachedScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, ms.scrape) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ms.scrape) if err != nil { return nil, err } diff --git a/receiver/memcachedreceiver/internal/metadata/generated_status.go b/receiver/memcachedreceiver/internal/metadata/generated_status.go index 7d22c62ad2af..aaf5888a5b6c 100644 --- a/receiver/memcachedreceiver/internal/metadata/generated_status.go +++ b/receiver/memcachedreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("memcached") +) + const ( - Type = "memcached" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go b/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go index 69faf0e507d9..2d03c514c34f 100644 --- a/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go +++ b/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("mongodbatlas") +) + const ( - Type = "mongodbatlas" MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) diff --git a/receiver/mongodbatlasreceiver/receiver.go b/receiver/mongodbatlasreceiver/receiver.go index fa71c8eb1e88..182ed9bb5cbd 100644 --- a/receiver/mongodbatlasreceiver/receiver.go +++ b/receiver/mongodbatlasreceiver/receiver.go @@ -51,7 +51,7 @@ func newMongoDBAtlasReceiver(settings receiver.CreateSettings, cfg *Config) *mon } func newMongoDBAtlasScraper(recv *mongodbatlasreceiver) (scraperhelper.Scraper, error) { - return scraperhelper.NewScraper(metadata.Type, recv.scrape, scraperhelper.WithShutdown(recv.shutdown)) + return scraperhelper.NewScraper(metadata.Type.String(), recv.scrape, scraperhelper.WithShutdown(recv.shutdown)) } func (s *mongodbatlasreceiver) scrape(ctx context.Context) (pmetric.Metrics, error) { diff --git a/receiver/mongodbreceiver/factory.go b/receiver/mongodbreceiver/factory.go index a66c12afd8f9..a16b296cc7ad 100644 --- a/receiver/mongodbreceiver/factory.go +++ b/receiver/mongodbreceiver/factory.go @@ -48,7 +48,7 @@ func createMetricsReceiver( cfg := rConf.(*Config) ms := newMongodbScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, ms.scrape, + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ms.scrape, scraperhelper.WithStart(ms.start), scraperhelper.WithShutdown(ms.shutdown)) if err != nil { diff --git a/receiver/mongodbreceiver/internal/metadata/generated_status.go b/receiver/mongodbreceiver/internal/metadata/generated_status.go index a883d449e5d0..11711f5ce9f8 100644 --- a/receiver/mongodbreceiver/internal/metadata/generated_status.go +++ b/receiver/mongodbreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("mongodb") +) + const ( - Type = "mongodb" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/mysqlreceiver/factory.go b/receiver/mysqlreceiver/factory.go index fcbd8ce4554a..f4d3ac7dd6ea 100644 --- a/receiver/mysqlreceiver/factory.go +++ b/receiver/mysqlreceiver/factory.go @@ -52,7 +52,7 @@ func createMetricsReceiver( cfg := rConf.(*Config) ns := newMySQLScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, ns.scrape, scraperhelper.WithStart(ns.start), + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ns.scrape, scraperhelper.WithStart(ns.start), scraperhelper.WithShutdown(ns.shutdown)) if err != nil { diff --git a/receiver/mysqlreceiver/internal/metadata/generated_status.go b/receiver/mysqlreceiver/internal/metadata/generated_status.go index d1919504daf2..87b3839fea0e 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_status.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("mysql") +) + const ( - Type = "mysql" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/namedpipereceiver/internal/metadata/generated_status.go b/receiver/namedpipereceiver/internal/metadata/generated_status.go index 3d006f004aa5..293adb115064 100644 --- a/receiver/namedpipereceiver/internal/metadata/generated_status.go +++ b/receiver/namedpipereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("namedpipe") +) + const ( - Type = "namedpipe" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/nginxreceiver/factory.go b/receiver/nginxreceiver/factory.go index 5b959c5e256b..40e79c14a07d 100644 --- a/receiver/nginxreceiver/factory.go +++ b/receiver/nginxreceiver/factory.go @@ -47,7 +47,7 @@ func createMetricsReceiver( cfg := rConf.(*Config) ns := newNginxScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, ns.scrape, scraperhelper.WithStart(ns.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ns.scrape, scraperhelper.WithStart(ns.start)) if err != nil { return nil, err } diff --git a/receiver/nginxreceiver/internal/metadata/generated_status.go b/receiver/nginxreceiver/internal/metadata/generated_status.go index 01df7602840e..496ce6a47760 100644 --- a/receiver/nginxreceiver/internal/metadata/generated_status.go +++ b/receiver/nginxreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("nginx") +) + const ( - Type = "nginx" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/nsxtreceiver/factory.go b/receiver/nsxtreceiver/factory.go index 480bb7eeb2a6..e56f57cdde30 100644 --- a/receiver/nsxtreceiver/factory.go +++ b/receiver/nsxtreceiver/factory.go @@ -41,7 +41,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC s := newScraper(cfg, params) scraper, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), s.scrape, scraperhelper.WithStart(s.start), ) diff --git a/receiver/nsxtreceiver/internal/metadata/generated_status.go b/receiver/nsxtreceiver/internal/metadata/generated_status.go index 98e7cc3d5ca8..d8488ec8145d 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_status.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("nsxt") +) + const ( - Type = "nsxt" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/opencensusreceiver/internal/metadata/generated_status.go b/receiver/opencensusreceiver/internal/metadata/generated_status.go index d5c0349c5e93..96b5e9b3c1e1 100644 --- a/receiver/opencensusreceiver/internal/metadata/generated_status.go +++ b/receiver/opencensusreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("opencensus") +) + const ( - Type = "opencensus" MetricsStability = component.StabilityLevelBeta TracesStability = component.StabilityLevelBeta ) diff --git a/receiver/oracledbreceiver/internal/metadata/generated_status.go b/receiver/oracledbreceiver/internal/metadata/generated_status.go index 0cdef17bbece..52529b479196 100644 --- a/receiver/oracledbreceiver/internal/metadata/generated_status.go +++ b/receiver/oracledbreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("oracledb") +) + const ( - Type = "oracledb" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/osqueryreceiver/internal/metadata/generated_status.go b/receiver/osqueryreceiver/internal/metadata/generated_status.go index cd35580f0929..acd11f35a99b 100644 --- a/receiver/osqueryreceiver/internal/metadata/generated_status.go +++ b/receiver/osqueryreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("osquery") +) + const ( - Type = "osquery" LogsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/otlpjsonfilereceiver/file.go b/receiver/otlpjsonfilereceiver/file.go index e7eabc633c89..b8f8d243bf35 100644 --- a/receiver/otlpjsonfilereceiver/file.go +++ b/receiver/otlpjsonfilereceiver/file.go @@ -78,13 +78,13 @@ func createLogsReceiver(_ context.Context, settings receiver.CreateSettings, con var l plog.Logs l, err = logsUnmarshaler.UnmarshalLogs(token) if err != nil { - obsrecv.EndLogsOp(ctx, metadata.Type, 0, err) + obsrecv.EndLogsOp(ctx, metadata.Type.String(), 0, err) } else { logRecordCount := l.LogRecordCount() if logRecordCount != 0 { err = logs.ConsumeLogs(ctx, l) } - obsrecv.EndLogsOp(ctx, metadata.Type, logRecordCount, err) + obsrecv.EndLogsOp(ctx, metadata.Type.String(), logRecordCount, err) } return nil }) @@ -111,12 +111,12 @@ func createMetricsReceiver(_ context.Context, settings receiver.CreateSettings, var m pmetric.Metrics m, err = metricsUnmarshaler.UnmarshalMetrics(token) if err != nil { - obsrecv.EndMetricsOp(ctx, metadata.Type, 0, err) + obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, err) } else { if m.ResourceMetrics().Len() != 0 { err = metrics.ConsumeMetrics(ctx, m) } - obsrecv.EndMetricsOp(ctx, metadata.Type, m.MetricCount(), err) + obsrecv.EndMetricsOp(ctx, metadata.Type.String(), m.MetricCount(), err) } return nil }) @@ -143,12 +143,12 @@ func createTracesReceiver(_ context.Context, settings receiver.CreateSettings, c var t ptrace.Traces t, err = tracesUnmarshaler.UnmarshalTraces(token) if err != nil { - obsrecv.EndTracesOp(ctx, metadata.Type, 0, err) + obsrecv.EndTracesOp(ctx, metadata.Type.String(), 0, err) } else { if t.ResourceSpans().Len() != 0 { err = traces.ConsumeTraces(ctx, t) } - obsrecv.EndTracesOp(ctx, metadata.Type, t.SpanCount(), err) + obsrecv.EndTracesOp(ctx, metadata.Type.String(), t.SpanCount(), err) } return nil }) diff --git a/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go b/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go index 20aae4cd14d2..79cddd7ed9a8 100644 --- a/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go +++ b/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("otlpjsonfile") +) + const ( - Type = "otlpjsonfile" TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/receiver/podmanreceiver/internal/metadata/generated_status.go b/receiver/podmanreceiver/internal/metadata/generated_status.go index 3db39a5e22e4..cb2403b34504 100644 --- a/receiver/podmanreceiver/internal/metadata/generated_status.go +++ b/receiver/podmanreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("podman_stats") +) + const ( - Type = "podman_stats" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/podmanreceiver/receiver.go b/receiver/podmanreceiver/receiver.go index 74fbc1e76d5a..2fe1685bb271 100644 --- a/receiver/podmanreceiver/receiver.go +++ b/receiver/podmanreceiver/receiver.go @@ -51,7 +51,7 @@ func newMetricsReceiver( set: set, } - scrp, err := scraperhelper.NewScraper(metadata.Type, recv.scrape, scraperhelper.WithStart(recv.start)) + scrp, err := scraperhelper.NewScraper(metadata.Type.String(), recv.scrape, scraperhelper.WithStart(recv.start)) if err != nil { return nil, err } diff --git a/receiver/postgresqlreceiver/factory.go b/receiver/postgresqlreceiver/factory.go index ac6719d1d6e4..8b309b0be507 100644 --- a/receiver/postgresqlreceiver/factory.go +++ b/receiver/postgresqlreceiver/factory.go @@ -51,7 +51,7 @@ func createMetricsReceiver( cfg := rConf.(*Config) ns := newPostgreSQLScraper(params, cfg, &defaultClientFactory{}) - scraper, err := scraperhelper.NewScraper(metadata.Type, ns.scrape) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), ns.scrape) if err != nil { return nil, err } diff --git a/receiver/postgresqlreceiver/internal/metadata/generated_status.go b/receiver/postgresqlreceiver/internal/metadata/generated_status.go index c99b7977ca0b..8827fc308694 100644 --- a/receiver/postgresqlreceiver/internal/metadata/generated_status.go +++ b/receiver/postgresqlreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("postgresql") +) + const ( - Type = "postgresql" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/prometheusreceiver/internal/metadata/generated_status.go b/receiver/prometheusreceiver/internal/metadata/generated_status.go index b96cf65f2bdf..899fc01f709e 100644 --- a/receiver/prometheusreceiver/internal/metadata/generated_status.go +++ b/receiver/prometheusreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("prometheus") +) + const ( - Type = "prometheus" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/pulsarreceiver/internal/metadata/generated_status.go b/receiver/pulsarreceiver/internal/metadata/generated_status.go index 8e040d2b292c..92eab810ccdd 100644 --- a/receiver/pulsarreceiver/internal/metadata/generated_status.go +++ b/receiver/pulsarreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("pulsar") +) + const ( - Type = "pulsar" MetricsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha diff --git a/receiver/purefareceiver/internal/metadata/generated_status.go b/receiver/purefareceiver/internal/metadata/generated_status.go index d1c878d0e344..22a4f6e3d711 100644 --- a/receiver/purefareceiver/internal/metadata/generated_status.go +++ b/receiver/purefareceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("purefa") +) + const ( - Type = "purefa" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/purefbreceiver/internal/metadata/generated_status.go b/receiver/purefbreceiver/internal/metadata/generated_status.go index c9278be7e477..5ffe7bfeca0d 100644 --- a/receiver/purefbreceiver/internal/metadata/generated_status.go +++ b/receiver/purefbreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("purefb") +) + const ( - Type = "purefb" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/rabbitmqreceiver/factory.go b/receiver/rabbitmqreceiver/factory.go index 68c7c9489778..51aca22ca36d 100644 --- a/receiver/rabbitmqreceiver/factory.go +++ b/receiver/rabbitmqreceiver/factory.go @@ -48,7 +48,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC } rabbitScraper := newScraper(params.Logger, cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, rabbitScraper.scrape, scraperhelper.WithStart(rabbitScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), rabbitScraper.scrape, scraperhelper.WithStart(rabbitScraper.start)) if err != nil { return nil, err } diff --git a/receiver/rabbitmqreceiver/internal/metadata/generated_status.go b/receiver/rabbitmqreceiver/internal/metadata/generated_status.go index 670cf57b741f..d98d36660bb0 100644 --- a/receiver/rabbitmqreceiver/internal/metadata/generated_status.go +++ b/receiver/rabbitmqreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("rabbitmq") +) + const ( - Type = "rabbitmq" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/receivercreator/internal/metadata/generated_status.go b/receiver/receivercreator/internal/metadata/generated_status.go index 38b0e84f697d..3cab9158da0a 100644 --- a/receiver/receivercreator/internal/metadata/generated_status.go +++ b/receiver/receivercreator/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("receiver_creator") +) + const ( - Type = "receiver_creator" LogsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelBeta diff --git a/receiver/redisreceiver/internal/metadata/generated_status.go b/receiver/redisreceiver/internal/metadata/generated_status.go index 86fd27ad64c5..5b1d606b3b52 100644 --- a/receiver/redisreceiver/internal/metadata/generated_status.go +++ b/receiver/redisreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("redis") +) + const ( - Type = "redis" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/redisreceiver/redis_scraper.go b/receiver/redisreceiver/redis_scraper.go index 442c477c5fa9..dc7a9161cd2c 100644 --- a/receiver/redisreceiver/redis_scraper.go +++ b/receiver/redisreceiver/redis_scraper.go @@ -61,7 +61,7 @@ func newRedisScraperWithClient(client client, settings receiver.CreateSettings, configInfo: configInfo, } return scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), rs.Scrape, scraperhelper.WithShutdown(rs.shutdown), ) diff --git a/receiver/riakreceiver/factory.go b/receiver/riakreceiver/factory.go index 07c8d898ed88..fb12efe5d12f 100644 --- a/receiver/riakreceiver/factory.go +++ b/receiver/riakreceiver/factory.go @@ -48,7 +48,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC } riakScraper := newScraper(params.Logger, cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, riakScraper.scrape, scraperhelper.WithStart(riakScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), riakScraper.scrape, scraperhelper.WithStart(riakScraper.start)) if err != nil { return nil, err } diff --git a/receiver/riakreceiver/internal/metadata/generated_status.go b/receiver/riakreceiver/internal/metadata/generated_status.go index 92edb4084b5c..ca6e92c853a0 100644 --- a/receiver/riakreceiver/internal/metadata/generated_status.go +++ b/receiver/riakreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("riak") +) + const ( - Type = "riak" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/saphanareceiver/internal/metadata/generated_status.go b/receiver/saphanareceiver/internal/metadata/generated_status.go index 44a6597ae7f8..fe2b68c269fb 100644 --- a/receiver/saphanareceiver/internal/metadata/generated_status.go +++ b/receiver/saphanareceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("saphana") +) + const ( - Type = "saphana" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/saphanareceiver/scraper.go b/receiver/saphanareceiver/scraper.go index c45da4b1b6b3..3a5d8ebaddc1 100644 --- a/receiver/saphanareceiver/scraper.go +++ b/receiver/saphanareceiver/scraper.go @@ -34,7 +34,7 @@ func newSapHanaScraper(settings receiver.CreateSettings, cfg *Config, factory sa mbs: make(map[string]*metadata.MetricsBuilder), factory: factory, } - return scraperhelper.NewScraper(metadata.Type, rs.scrape) + return scraperhelper.NewScraper(metadata.Type.String(), rs.scrape) } func (s *sapHanaScraper) getMetricsBuilder(resourceAttributes map[string]string) (*metadata.MetricsBuilder, error) { diff --git a/receiver/sapmreceiver/internal/metadata/generated_status.go b/receiver/sapmreceiver/internal/metadata/generated_status.go index ba97ef60747a..b101db9f0963 100644 --- a/receiver/sapmreceiver/internal/metadata/generated_status.go +++ b/receiver/sapmreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sapm") +) + const ( - Type = "sapm" TracesStability = component.StabilityLevelBeta ) diff --git a/receiver/signalfxreceiver/internal/metadata/generated_status.go b/receiver/signalfxreceiver/internal/metadata/generated_status.go index 5a7f83a280af..dc815f186179 100644 --- a/receiver/signalfxreceiver/internal/metadata/generated_status.go +++ b/receiver/signalfxreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("signalfx") +) + const ( - Type = "signalfx" MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) diff --git a/receiver/signalfxreceiver/receiver.go b/receiver/signalfxreceiver/receiver.go index 597679f59233..430259879e7c 100644 --- a/receiver/signalfxreceiver/receiver.go +++ b/receiver/signalfxreceiver/receiver.go @@ -233,7 +233,7 @@ func (r *sfxReceiver) handleDatapointReq(resp http.ResponseWriter, req *http.Req } if len(msg.Datapoints) == 0 { - r.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, nil) + r.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, nil) _, _ = resp.Write(okRespBody) return } @@ -254,7 +254,7 @@ func (r *sfxReceiver) handleDatapointReq(resp http.ResponseWriter, req *http.Req } err = r.metricsConsumer.ConsumeMetrics(ctx, md) - r.obsrecv.EndMetricsOp(ctx, metadata.Type, len(msg.Datapoints), err) + r.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), len(msg.Datapoints), err) r.writeResponse(ctx, resp, err) } @@ -279,7 +279,7 @@ func (r *sfxReceiver) handleEventReq(resp http.ResponseWriter, req *http.Request } if len(msg.Events) == 0 { - r.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, nil) + r.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, nil) _, _ = resp.Write(okRespBody) return } @@ -298,7 +298,7 @@ func (r *sfxReceiver) handleEventReq(resp http.ResponseWriter, req *http.Request err := r.logsConsumer.ConsumeLogs(ctx, ld) r.obsrecv.EndMetricsOp( ctx, - metadata.Type, + metadata.Type.String(), len(msg.Events), err) @@ -327,7 +327,7 @@ func (r *sfxReceiver) failRequest( // Use the same pattern as strings.Builder String(). msg := *(*string)(unsafe.Pointer(&jsonResponse)) - r.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, err) + r.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), 0, err) r.settings.Logger.Debug( "SignalFx receiver request failed", zap.Int("http_status_code", httpStatusCode), diff --git a/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go b/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go index cff80b1efaba..894b71f2685f 100644 --- a/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go +++ b/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("prometheus_simple") +) + const ( - Type = "prometheus_simple" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/skywalkingreceiver/internal/metadata/generated_status.go b/receiver/skywalkingreceiver/internal/metadata/generated_status.go index 66fcb374c6b2..bd87fceb2344 100644 --- a/receiver/skywalkingreceiver/internal/metadata/generated_status.go +++ b/receiver/skywalkingreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("skywalking") +) + const ( - Type = "skywalking" TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/snmpreceiver/factory.go b/receiver/snmpreceiver/factory.go index aa18638e8bf9..dfcac84c072a 100644 --- a/receiver/snmpreceiver/factory.go +++ b/receiver/snmpreceiver/factory.go @@ -61,7 +61,7 @@ func createMetricsReceiver( } snmpScraper := newScraper(params.Logger, snmpConfig, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, snmpScraper.scrape, scraperhelper.WithStart(snmpScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), snmpScraper.scrape, scraperhelper.WithStart(snmpScraper.start)) if err != nil { return nil, err } diff --git a/receiver/snmpreceiver/internal/metadata/generated_status.go b/receiver/snmpreceiver/internal/metadata/generated_status.go index 0c8652dfa96f..356087fc67b1 100644 --- a/receiver/snmpreceiver/internal/metadata/generated_status.go +++ b/receiver/snmpreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("snmp") +) + const ( - Type = "snmp" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/snowflakereceiver/factory.go b/receiver/snowflakereceiver/factory.go index 4aaa08085cfa..91509b1ec7e0 100644 --- a/receiver/snowflakereceiver/factory.go +++ b/receiver/snowflakereceiver/factory.go @@ -51,7 +51,7 @@ func createMetricsReceiver(_ context.Context, cfg := baseCfg.(*Config) snowflakeScraper := newSnowflakeMetricsScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, snowflakeScraper.scrape, scraperhelper.WithStart(snowflakeScraper.start), scraperhelper.WithShutdown(snowflakeScraper.shutdown)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), snowflakeScraper.scrape, scraperhelper.WithStart(snowflakeScraper.start), scraperhelper.WithShutdown(snowflakeScraper.shutdown)) if err != nil { return nil, err } diff --git a/receiver/snowflakereceiver/internal/metadata/generated_status.go b/receiver/snowflakereceiver/internal/metadata/generated_status.go index 02686bbe1ad1..79492769c631 100644 --- a/receiver/snowflakereceiver/internal/metadata/generated_status.go +++ b/receiver/snowflakereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("snowflake") +) + const ( - Type = "snowflake" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/solacereceiver/internal/metadata/generated_status.go b/receiver/solacereceiver/internal/metadata/generated_status.go index ea4e1c54d4f6..3a47cec2daa8 100644 --- a/receiver/solacereceiver/internal/metadata/generated_status.go +++ b/receiver/solacereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("solace") +) + const ( - Type = "solace" TracesStability = component.StabilityLevelBeta ) diff --git a/receiver/splunkenterprisereceiver/factory.go b/receiver/splunkenterprisereceiver/factory.go index ec11df83041a..7c9a021730e3 100644 --- a/receiver/splunkenterprisereceiver/factory.go +++ b/receiver/splunkenterprisereceiver/factory.go @@ -58,7 +58,7 @@ func createMetricsReceiver( cfg := baseCfg.(*Config) splunkScraper := newSplunkMetricsScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), splunkScraper.scrape, scraperhelper.WithStart(splunkScraper.start)) if err != nil { diff --git a/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go b/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go index 061ba0be1da7..e22de51ed664 100644 --- a/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go +++ b/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("splunkenterprise") +) + const ( - Type = "splunkenterprise" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/splunkhecreceiver/internal/metadata/generated_status.go b/receiver/splunkhecreceiver/internal/metadata/generated_status.go index 2ab0fedbeb10..92b48738749b 100644 --- a/receiver/splunkhecreceiver/internal/metadata/generated_status.go +++ b/receiver/splunkhecreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("splunk_hec") +) + const ( - Type = "splunk_hec" MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) diff --git a/receiver/splunkhecreceiver/receiver.go b/receiver/splunkhecreceiver/receiver.go index f5db2c7532cd..ef26c3b415f4 100644 --- a/receiver/splunkhecreceiver/receiver.go +++ b/receiver/splunkhecreceiver/receiver.go @@ -255,7 +255,7 @@ func (r *splunkReceiver) handleRawReq(resp http.ResponseWriter, req *http.Reques } if req.ContentLength == 0 { - r.obsrecv.EndLogsOp(ctx, metadata.Type, 0, nil) + r.obsrecv.EndLogsOp(ctx, metadata.Type.String(), 0, nil) r.failRequest(ctx, resp, http.StatusBadRequest, noDataRespBody, 0, nil) return } @@ -303,7 +303,7 @@ func (r *splunkReceiver) handleRawReq(resp http.ResponseWriter, req *http.Reques r.failRequest(ctx, resp, http.StatusInternalServerError, errInternalServerError, slLen, consumerErr) } else { r.writeSuccessResponse(ctx, resp, ld.LogRecordCount()) - r.obsrecv.EndLogsOp(ctx, metadata.Type, slLen, nil) + r.obsrecv.EndLogsOp(ctx, metadata.Type.String(), slLen, nil) } } @@ -396,7 +396,7 @@ func (r *splunkReceiver) handleReq(resp http.ResponseWriter, req *http.Request) return } decodeErr := r.logsConsumer.ConsumeLogs(ctx, ld) - r.obsrecv.EndLogsOp(ctx, metadata.Type, len(events), decodeErr) + r.obsrecv.EndLogsOp(ctx, metadata.Type.String(), len(events), decodeErr) if decodeErr != nil { r.failRequest(ctx, resp, http.StatusInternalServerError, errInternalServerError, len(events), decodeErr) return @@ -407,7 +407,7 @@ func (r *splunkReceiver) handleReq(resp http.ResponseWriter, req *http.Request) md, _ := splunkHecToMetricsData(r.settings.Logger, metricEvents, resourceCustomizer, r.config) decodeErr := r.metricsConsumer.ConsumeMetrics(ctx, md) - r.obsrecv.EndMetricsOp(ctx, metadata.Type, len(metricEvents), decodeErr) + r.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), len(metricEvents), decodeErr) if decodeErr != nil { r.failRequest(ctx, resp, http.StatusInternalServerError, errInternalServerError, len(metricEvents), decodeErr) return @@ -449,9 +449,9 @@ func (r *splunkReceiver) failRequest( } if r.metricsConsumer == nil { - r.obsrecv.EndLogsOp(ctx, metadata.Type, numRecordsReceived, err) + r.obsrecv.EndLogsOp(ctx, metadata.Type.String(), numRecordsReceived, err) } else { - r.obsrecv.EndMetricsOp(ctx, metadata.Type, numRecordsReceived, err) + r.obsrecv.EndMetricsOp(ctx, metadata.Type.String(), numRecordsReceived, err) } if r.settings.Logger.Core().Enabled(zap.DebugLevel) { diff --git a/receiver/sqlqueryreceiver/internal/metadata/generated_status.go b/receiver/sqlqueryreceiver/internal/metadata/generated_status.go index c8ed5cda33d1..4a818d0e2a13 100644 --- a/receiver/sqlqueryreceiver/internal/metadata/generated_status.go +++ b/receiver/sqlqueryreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sqlquery") +) + const ( - Type = "sqlquery" MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/sqlqueryreceiver/logs_receiver.go b/receiver/sqlqueryreceiver/logs_receiver.go index 7372f8dcd47f..d689397b4922 100644 --- a/receiver/sqlqueryreceiver/logs_receiver.go +++ b/receiver/sqlqueryreceiver/logs_receiver.go @@ -161,7 +161,7 @@ func (receiver *logsReceiver) collect() { if logRecordCount > 0 { ctx := receiver.obsrecv.StartLogsOp(context.Background()) err := receiver.nextConsumer.ConsumeLogs(context.Background(), allLogs) - receiver.obsrecv.EndLogsOp(ctx, metadata.Type, logRecordCount, err) + receiver.obsrecv.EndLogsOp(ctx, metadata.Type.String(), logRecordCount, err) if err != nil { receiver.settings.Logger.Error("failed to send logs: %w", zap.Error(err)) } diff --git a/receiver/sqlserverreceiver/factory_windows.go b/receiver/sqlserverreceiver/factory_windows.go index 9b9448a17794..8f232885a9d0 100644 --- a/receiver/sqlserverreceiver/factory_windows.go +++ b/receiver/sqlserverreceiver/factory_windows.go @@ -32,7 +32,7 @@ func createMetricsReceiver( } sqlServerScraper := newSQLServerScraper(params, cfg) - scraper, err := scraperhelper.NewScraper(metadata.Type, sqlServerScraper.scrape, + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), sqlServerScraper.scrape, scraperhelper.WithStart(sqlServerScraper.start), scraperhelper.WithShutdown(sqlServerScraper.shutdown)) if err != nil { diff --git a/receiver/sqlserverreceiver/internal/metadata/generated_status.go b/receiver/sqlserverreceiver/internal/metadata/generated_status.go index 560b048eda86..72e3b7db7412 100644 --- a/receiver/sqlserverreceiver/internal/metadata/generated_status.go +++ b/receiver/sqlserverreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sqlserver") +) + const ( - Type = "sqlserver" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/sshcheckreceiver/config.go b/receiver/sshcheckreceiver/config.go index fed1ba9e9a10..46f73ecf5097 100644 --- a/receiver/sshcheckreceiver/config.go +++ b/receiver/sshcheckreceiver/config.go @@ -23,7 +23,7 @@ var ( errMissingPasswordAndKeyFile = errors.New(`either "password" or "key_file" is required`) errConfigNotSSHCheck = errors.New("config was not a SSH check receiver config") - errWindowsUnsupported = errors.New(metadata.Type + " is unsupported on Windows.") + errWindowsUnsupported = errors.New(metadata.Type.String() + " is unsupported on Windows.") ) type Config struct { diff --git a/receiver/sshcheckreceiver/factory.go b/receiver/sshcheckreceiver/factory.go index 41f843ba8d43..8fd7199f0785 100644 --- a/receiver/sshcheckreceiver/factory.go +++ b/receiver/sshcheckreceiver/factory.go @@ -49,7 +49,7 @@ func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rC } sshcheckScraper := newScraper(cfg, params) - scraper, err := scraperhelper.NewScraper(metadata.Type, sshcheckScraper.scrape, scraperhelper.WithStart(sshcheckScraper.start)) + scraper, err := scraperhelper.NewScraper(metadata.Type.String(), sshcheckScraper.scrape, scraperhelper.WithStart(sshcheckScraper.start)) if err != nil { return nil, err } diff --git a/receiver/sshcheckreceiver/internal/metadata/generated_status.go b/receiver/sshcheckreceiver/internal/metadata/generated_status.go index a122b3e84b47..3fce7893ad92 100644 --- a/receiver/sshcheckreceiver/internal/metadata/generated_status.go +++ b/receiver/sshcheckreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("sshcheck") +) + const ( - Type = "sshcheck" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/statsdreceiver/internal/metadata/generated_status.go b/receiver/statsdreceiver/internal/metadata/generated_status.go index 9d41088e3918..4c75afbaae42 100644 --- a/receiver/statsdreceiver/internal/metadata/generated_status.go +++ b/receiver/statsdreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("statsd") +) + const ( - Type = "statsd" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/syslogreceiver/internal/metadata/generated_status.go b/receiver/syslogreceiver/internal/metadata/generated_status.go index 44cfcd27eb85..e510424625fd 100644 --- a/receiver/syslogreceiver/internal/metadata/generated_status.go +++ b/receiver/syslogreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("syslog") +) + const ( - Type = "syslog" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/tcplogreceiver/internal/metadata/generated_status.go b/receiver/tcplogreceiver/internal/metadata/generated_status.go index 7ce1c6031dd2..4dbf479a4b88 100644 --- a/receiver/tcplogreceiver/internal/metadata/generated_status.go +++ b/receiver/tcplogreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("tcplog") +) + const ( - Type = "tcplog" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/udplogreceiver/internal/metadata/generated_status.go b/receiver/udplogreceiver/internal/metadata/generated_status.go index 9c3ccab41099..bd5e211e9486 100644 --- a/receiver/udplogreceiver/internal/metadata/generated_status.go +++ b/receiver/udplogreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("udplog") +) + const ( - Type = "udplog" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/vcenterreceiver/factory.go b/receiver/vcenterreceiver/factory.go index f9cb18e56949..673d40d088a3 100644 --- a/receiver/vcenterreceiver/factory.go +++ b/receiver/vcenterreceiver/factory.go @@ -52,7 +52,7 @@ func createMetricsReceiver( vr := newVmwareVcenterScraper(params.Logger, cfg, params) scraper, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), vr.scrape, scraperhelper.WithStart(vr.Start), scraperhelper.WithShutdown(vr.Shutdown), diff --git a/receiver/vcenterreceiver/internal/metadata/generated_status.go b/receiver/vcenterreceiver/internal/metadata/generated_status.go index 55e6ec944f65..0abf84b7603a 100644 --- a/receiver/vcenterreceiver/internal/metadata/generated_status.go +++ b/receiver/vcenterreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("vcenter") +) + const ( - Type = "vcenter" MetricsStability = component.StabilityLevelAlpha ) diff --git a/receiver/wavefrontreceiver/internal/metadata/generated_status.go b/receiver/wavefrontreceiver/internal/metadata/generated_status.go index 9536a060f539..a65303cc40c3 100644 --- a/receiver/wavefrontreceiver/internal/metadata/generated_status.go +++ b/receiver/wavefrontreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("wavefront") +) + const ( - Type = "wavefront" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/webhookeventreceiver/factory.go b/receiver/webhookeventreceiver/factory.go index 2f50bd3bedee..e4b3ac97c2e0 100644 --- a/receiver/webhookeventreceiver/factory.go +++ b/receiver/webhookeventreceiver/factory.go @@ -13,12 +13,13 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/webhookeventreceiver/internal/metadata" ) +var scopeLogName = "otlp/" + metadata.Type.String() + const ( // might add this later, for now I wish to require a valid // endpoint to be declared by the user. // Default endpoints to bind to. // defaultEndpoint = "localhost:8080" - scopeLogName = "otlp/" + metadata.Type defaultReadTimeout = "500ms" defaultWriteTimeout = "500ms" defaultPath = "/events" diff --git a/receiver/webhookeventreceiver/internal/metadata/generated_status.go b/receiver/webhookeventreceiver/internal/metadata/generated_status.go index 21f22f088068..0840e52d50fb 100644 --- a/receiver/webhookeventreceiver/internal/metadata/generated_status.go +++ b/receiver/webhookeventreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("webhookevent") +) + const ( - Type = "webhookevent" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/webhookeventreceiver/receiver.go b/receiver/webhookeventreceiver/receiver.go index 24cd0a571557..a7feda87eed8 100644 --- a/receiver/webhookeventreceiver/receiver.go +++ b/receiver/webhookeventreceiver/receiver.go @@ -170,7 +170,7 @@ func (er *eventReceiver) handleReq(w http.ResponseWriter, r *http.Request, _ htt } if r.ContentLength == 0 { - er.obsrecv.EndLogsOp(ctx, metadata.Type, 0, nil) + er.obsrecv.EndLogsOp(ctx, metadata.Type.String(), 0, nil) er.failBadReq(ctx, w, http.StatusBadRequest, errEmptyResponseBody) } @@ -199,10 +199,10 @@ func (er *eventReceiver) handleReq(w http.ResponseWriter, r *http.Request, _ htt if consumerErr != nil { er.failBadReq(ctx, w, http.StatusInternalServerError, consumerErr) - er.obsrecv.EndLogsOp(ctx, metadata.Type, numLogs, nil) + er.obsrecv.EndLogsOp(ctx, metadata.Type.String(), numLogs, nil) } else { w.WriteHeader(http.StatusOK) - er.obsrecv.EndLogsOp(ctx, metadata.Type, numLogs, nil) + er.obsrecv.EndLogsOp(ctx, metadata.Type.String(), numLogs, nil) } } diff --git a/receiver/webhookeventreceiver/req_to_log.go b/receiver/webhookeventreceiver/req_to_log.go index 222621f9c263..5fbe78391b6f 100644 --- a/receiver/webhookeventreceiver/req_to_log.go +++ b/receiver/webhookeventreceiver/req_to_log.go @@ -25,7 +25,7 @@ func reqToLog(sc *bufio.Scanner, scopeLog.Scope().SetName(scopeLogName) scopeLog.Scope().SetVersion(settings.BuildInfo.Version) scopeLog.Scope().Attributes().PutStr("source", settings.ID.String()) - scopeLog.Scope().Attributes().PutStr("receiver", metadata.Type) + scopeLog.Scope().Attributes().PutStr("receiver", metadata.Type.String()) for sc.Scan() { logRecord := scopeLog.LogRecords().AppendEmpty() diff --git a/receiver/windowseventlogreceiver/internal/metadata/generated_status.go b/receiver/windowseventlogreceiver/internal/metadata/generated_status.go index 9bd1d0745cbc..79174166a9fc 100644 --- a/receiver/windowseventlogreceiver/internal/metadata/generated_status.go +++ b/receiver/windowseventlogreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("windowseventlog") +) + const ( - Type = "windowseventlog" LogsStability = component.StabilityLevelAlpha ) diff --git a/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go b/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go index 9d64e7682bde..da35aaabb70e 100644 --- a/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go +++ b/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("windowsperfcounters") +) + const ( - Type = "windowsperfcounters" MetricsStability = component.StabilityLevelBeta ) diff --git a/receiver/zipkinreceiver/internal/metadata/generated_status.go b/receiver/zipkinreceiver/internal/metadata/generated_status.go index f06a4a308a90..467ec904547a 100644 --- a/receiver/zipkinreceiver/internal/metadata/generated_status.go +++ b/receiver/zipkinreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("zipkin") +) + const ( - Type = "zipkin" TracesStability = component.StabilityLevelBeta ) diff --git a/receiver/zookeeperreceiver/factory.go b/receiver/zookeeperreceiver/factory.go index 9bd1eef55f22..2bee6389e2b7 100644 --- a/receiver/zookeeperreceiver/factory.go +++ b/receiver/zookeeperreceiver/factory.go @@ -59,7 +59,7 @@ func createMetricsReceiver( } scrp, err := scraperhelper.NewScraper( - metadata.Type, + metadata.Type.String(), zms.scrape, scraperhelper.WithShutdown(zms.shutdown), ) diff --git a/receiver/zookeeperreceiver/internal/metadata/generated_status.go b/receiver/zookeeperreceiver/internal/metadata/generated_status.go index d3c5cf2350b9..2df108cbd860 100644 --- a/receiver/zookeeperreceiver/internal/metadata/generated_status.go +++ b/receiver/zookeeperreceiver/internal/metadata/generated_status.go @@ -8,8 +8,11 @@ import ( "go.opentelemetry.io/otel/trace" ) +var ( + Type = component.MustNewType("zookeeper") +) + const ( - Type = "zookeeper" MetricsStability = component.StabilityLevelDevelopment ) diff --git a/receiver/zookeeperreceiver/scraper.go b/receiver/zookeeperreceiver/scraper.go index 33b01fa114ee..24c6e42142b2 100644 --- a/receiver/zookeeperreceiver/scraper.go +++ b/receiver/zookeeperreceiver/scraper.go @@ -42,7 +42,7 @@ type zookeeperMetricsScraper struct { } func (z *zookeeperMetricsScraper) Name() string { - return metadata.Type + return metadata.Type.String() } func newZookeeperMetricsScraper(settings receiver.CreateSettings, config *Config) (*zookeeperMetricsScraper, error) {