From 00e1b303da1d7fb78740213637a508dc891500b6 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:11:41 -0700 Subject: [PATCH] [stanza/fileconsumer] update scope name for consistency (#34619) Part of open-telemetry/opentelemetry-collector#9494 --------- Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- .chloggen/codeboten_more-scope-9.yaml | 27 +++++++++++++++++++ .../internal/metadata/generated_telemetry.go | 4 +-- .../metadata/generated_telemetry_test.go | 4 +-- pkg/stanza/fileconsumer/metadata.yaml | 1 - 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 .chloggen/codeboten_more-scope-9.yaml diff --git a/.chloggen/codeboten_more-scope-9.yaml b/.chloggen/codeboten_more-scope-9.yaml new file mode 100644 index 000000000000..6012668b97c3 --- /dev/null +++ b/.chloggen/codeboten_more-scope-9.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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: fileconsumer + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Update the scope name for telemetry produced by pkg/stanza/fileconsumer from `otelcol/fileconsumer` to `github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer`" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [34619] + +# (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/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry.go b/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry.go index 94d0af873337..e30a191336ae 100644 --- a/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry.go +++ b/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry.go @@ -14,11 +14,11 @@ import ( ) func Meter(settings component.TelemetrySettings) metric.Meter { - return settings.MeterProvider.Meter("otelcol/fileconsumer") + return settings.MeterProvider.Meter("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer") } func Tracer(settings component.TelemetrySettings) trace.Tracer { - return settings.TracerProvider.Tracer("otelcol/fileconsumer") + return settings.TracerProvider.Tracer("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer") } // TelemetryBuilder provides an interface for components to report telemetry diff --git a/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry_test.go b/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry_test.go index 1517f672ddd7..26a05ef91d8b 100644 --- a/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry_test.go +++ b/pkg/stanza/fileconsumer/internal/metadata/generated_telemetry_test.go @@ -49,14 +49,14 @@ func TestProviders(t *testing.T) { meter := Meter(set) if m, ok := meter.(mockMeter); ok { - require.Equal(t, "otelcol/fileconsumer", m.name) + require.Equal(t, "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer", m.name) } else { require.Fail(t, "returned Meter not mockMeter") } tracer := Tracer(set) if m, ok := tracer.(mockTracer); ok { - require.Equal(t, "otelcol/fileconsumer", m.name) + require.Equal(t, "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer", m.name) } else { require.Fail(t, "returned Meter not mockTracer") } diff --git a/pkg/stanza/fileconsumer/metadata.yaml b/pkg/stanza/fileconsumer/metadata.yaml index d17aa17c4008..0f02e2f9e387 100644 --- a/pkg/stanza/fileconsumer/metadata.yaml +++ b/pkg/stanza/fileconsumer/metadata.yaml @@ -1,5 +1,4 @@ type: fileconsumer -scope_name: otelcol/fileconsumer status: class: pkg