diff --git a/.chloggen/config.yaml b/.chloggen/config.yaml index 29143162c8e4b..31627741cd839 100644 --- a/.chloggen/config.yaml +++ b/.chloggen/config.yaml @@ -36,8 +36,8 @@ components: - exporter/awss3 - exporter/awsxray - exporter/azure_blob + - exporter/azure_monitor - exporter/azuredataexplorer - - exporter/azuremonitor - exporter/bmc_helix - exporter/cassandra - exporter/clickhouse diff --git a/.chloggen/dylan_rename-azure-monitor.yaml b/.chloggen/dylan_rename-azure-monitor.yaml new file mode 100644 index 0000000000000..f30b4b193da19 --- /dev/null +++ b/.chloggen/dylan_rename-azure-monitor.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog) +component: exporter/azure_monitor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Rename `azuremonitor` to `azure_monitor` + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [45339] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/exporter/azuremonitorexporter/README.md b/exporter/azuremonitorexporter/README.md index 726b003209b06..7ca3c9488ca64 100644 --- a/exporter/azuremonitorexporter/README.md +++ b/exporter/azuremonitorexporter/README.md @@ -66,7 +66,7 @@ Example — Azure Container Apps, where `service.instance.id` is set to a random ```yaml exporters: - azuremonitor: + azure_monitor: connection_string: "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://ingestion.azuremonitor.com/" tag_mappings: cloud_role_instance: [host.name, service.instance.id, unknown-instance] @@ -81,7 +81,7 @@ Example: # It is highly recommended to use the connection string which includes the InstrumentationKey and IngestionEndpoint # This is the preferred method over using 'instrumentation_key' alone. exporters: - azuremonitor: + azure_monitor: connection_string: "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://ingestion.azuremonitor.com/" ``` @@ -92,7 +92,7 @@ exporters: # The use of 'instrumentation_key' alone is not recommended and will be deprecated in the future. It is advised to use the connection_string instead. # This example is provided primarily for existing configurations that have not yet transitioned to the connection string. exporters: - azuremonitor: + azure_monitor: instrumentation_key: b1cd0778-85fc-4677-a3fa-79d3c23e0efd ``` @@ -102,7 +102,7 @@ Ensure `APPLICATIONINSIGHTS_CONNECTION_STRING` is set in your environment, then ```yaml exporters: - azuremonitor: + azure_monitor: ``` ## Attribute mapping diff --git a/exporter/azuremonitorexporter/factory.go b/exporter/azuremonitorexporter/factory.go index 35aa7f66386fc..b59064490eb99 100644 --- a/exporter/azuremonitorexporter/factory.go +++ b/exporter/azuremonitorexporter/factory.go @@ -17,6 +17,7 @@ import ( "go.opentelemetry.io/collector/config/configoptional" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" + "go.opentelemetry.io/collector/exporter/xexporter" conventions "go.opentelemetry.io/otel/semconv/v1.40.0" "go.uber.org/zap" @@ -34,12 +35,14 @@ func NewFactory() exporter.Factory { f := &factory{ loggerInitOnce: sync.Once{}, } - return exporter.NewFactory( + return xexporter.NewFactory( metadata.Type, createDefaultConfig, - exporter.WithTraces(f.createTracesExporter, metadata.TracesStability), - exporter.WithLogs(f.createLogsExporter, metadata.LogsStability), - exporter.WithMetrics(f.createMetricsExporter, metadata.MetricsStability)) + xexporter.WithTraces(f.createTracesExporter, metadata.TracesStability), + xexporter.WithLogs(f.createLogsExporter, metadata.LogsStability), + xexporter.WithMetrics(f.createMetricsExporter, metadata.MetricsStability), + xexporter.WithDeprecatedTypeAlias(metadata.DeprecatedType), + ) } // Implements the interface from go.opentelemetry.io/collector/exporter/factory.go diff --git a/exporter/azuremonitorexporter/generated_component_test.go b/exporter/azuremonitorexporter/generated_component_test.go index 8ad94bc887ab3..d6381e2a5aac8 100644 --- a/exporter/azuremonitorexporter/generated_component_test.go +++ b/exporter/azuremonitorexporter/generated_component_test.go @@ -19,7 +19,7 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" ) -var typ = component.MustNewType("azuremonitor") +var typ = component.MustNewType("azure_monitor") func TestComponentFactoryType(t *testing.T) { require.Equal(t, typ, NewFactory().Type()) diff --git a/exporter/azuremonitorexporter/go.mod b/exporter/azuremonitorexporter/go.mod index ab7b9647efabe..d2ef0b784b693 100644 --- a/exporter/azuremonitorexporter/go.mod +++ b/exporter/azuremonitorexporter/go.mod @@ -18,6 +18,7 @@ require ( go.opentelemetry.io/collector/exporter v1.61.1-0.20260625204839-9782f9e8a3d6 go.opentelemetry.io/collector/exporter/exporterhelper v0.155.1-0.20260625204839-9782f9e8a3d6 go.opentelemetry.io/collector/exporter/exportertest v0.155.1-0.20260625204839-9782f9e8a3d6 + go.opentelemetry.io/collector/exporter/xexporter v0.155.1-0.20260625204839-9782f9e8a3d6 go.opentelemetry.io/collector/pdata v1.61.1-0.20260625204839-9782f9e8a3d6 go.opentelemetry.io/otel v1.44.0 go.uber.org/zap v1.28.0 @@ -66,7 +67,6 @@ require ( go.opentelemetry.io/collector/consumer v1.61.1-0.20260625204839-9782f9e8a3d6 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.155.1-0.20260625204839-9782f9e8a3d6 // indirect go.opentelemetry.io/collector/consumer/xconsumer v0.155.1-0.20260625204839-9782f9e8a3d6 // indirect - go.opentelemetry.io/collector/exporter/xexporter v0.155.1-0.20260625204839-9782f9e8a3d6 // indirect go.opentelemetry.io/collector/extension v1.61.1-0.20260625204839-9782f9e8a3d6 // indirect go.opentelemetry.io/collector/extension/extensionauth v1.61.1-0.20260625204839-9782f9e8a3d6 // indirect go.opentelemetry.io/collector/extension/extensionmiddleware v0.155.1-0.20260625204839-9782f9e8a3d6 // indirect diff --git a/exporter/azuremonitorexporter/internal/metadata/generated_status.go b/exporter/azuremonitorexporter/internal/metadata/generated_status.go index 3278674628e0b..9e844567687ea 100644 --- a/exporter/azuremonitorexporter/internal/metadata/generated_status.go +++ b/exporter/azuremonitorexporter/internal/metadata/generated_status.go @@ -1,7 +1,7 @@ // Code generated by mdatagen. DO NOT EDIT. // Package metadata contains the autogenerated telemetry and -// build information for the exporter/azuremonitor component. +// build information for the exporter/azure_monitor component. package metadata import ( @@ -9,8 +9,9 @@ import ( ) var ( - Type = component.MustNewType("azuremonitor") - ScopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter" + Type = component.MustNewType("azure_monitor") + DeprecatedType = component.MustNewType("azuremonitor") + ScopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter" ) const ( diff --git a/exporter/azuremonitorexporter/metadata.yaml b/exporter/azuremonitorexporter/metadata.yaml index 26a9d2fee7ac9..b6745813c2319 100644 --- a/exporter/azuremonitorexporter/metadata.yaml +++ b/exporter/azuremonitorexporter/metadata.yaml @@ -1,4 +1,5 @@ -type: azuremonitor +type: azure_monitor +deprecated_type: azuremonitor display_name: Azure Monitor Exporter status: @@ -15,4 +16,4 @@ tests: instrumentation_key: b1cd0778-85fc-4677-a3fa-79d3c23e0efd expect_consumer_error: true goleak: - skip: true \ No newline at end of file + skip: true diff --git a/exporter/azuremonitorexporter/testdata/config.yaml b/exporter/azuremonitorexporter/testdata/config.yaml index d328ccb315817..92c4aad81124f 100644 --- a/exporter/azuremonitorexporter/testdata/config.yaml +++ b/exporter/azuremonitorexporter/testdata/config.yaml @@ -1,5 +1,5 @@ -azuremonitor: -azuremonitor/2: +azure_monitor: +azure_monitor/2: # endpoint is the uri used to communicate with Azure Monitor endpoint: "https://dc.services.visualstudio.com/v2/track" # instrumentation_key is the unique identifier for your Application Insights resource @@ -20,10 +20,10 @@ azuremonitor/2: num_consumers: 10 storage: disk -azuremonitor/tag_mappings: +azure_monitor/tag_mappings: connection_string: InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://ingestion.azuremonitor.com/ tag_mappings: cloud_role_instance: [host.name, service.instance.id, unknown-instance] application_version: [service.version] -disk/3: \ No newline at end of file +disk/3: diff --git a/reports/distributions/contrib.yaml b/reports/distributions/contrib.yaml index bb00a01fcfa8b..576d39656da22 100644 --- a/reports/distributions/contrib.yaml +++ b/reports/distributions/contrib.yaml @@ -23,8 +23,8 @@ components: - awss3 - awsxray - azure_blob + - azure_monitor - azuredataexplorer - - azuremonitor - bmc_helix - cassandra - clickhouse