Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pkg/translator/azure] update scope name #34712

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/codeboten_scope-azureresource.yaml
Original file line number Diff line number Diff line change
@@ -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: azuretranslator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "The scope name has been updated from `otelcol/azureresourcelogs` and `otelcol/azureresourcetraces` to `github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure`"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: []
codeboten marked this conversation as resolved.
Show resolved Hide resolved

# (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: []
2 changes: 1 addition & 1 deletion pkg/translator/azure/resourcelogs_to_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

const (
// Constants for OpenTelemetry Specs
scopeName = "otelcol/azureresourcelogs"
scopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure"

// Constants for Azure Log Records
azureCategory = "azure.category"
Expand Down
12 changes: 6 additions & 6 deletions pkg/translator/azure/resourcelogs_to_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func TestUnmarshalLogs(t *testing.T) {
expectedMinimum := plog.NewLogs()
resourceLogs := expectedMinimum.ResourceLogs().AppendEmpty()
scopeLogs := resourceLogs.ScopeLogs().AppendEmpty()
scopeLogs.Scope().SetName("otelcol/azureresourcelogs")
scopeLogs.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure")
scopeLogs.Scope().SetVersion(testBuildInfo.Version)
lr := scopeLogs.LogRecords().AppendEmpty()
resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID")
Expand All @@ -378,7 +378,7 @@ func TestUnmarshalLogs(t *testing.T) {
resourceLogs = expectedMinimum2.ResourceLogs().AppendEmpty()
resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID")
scopeLogs = resourceLogs.ScopeLogs().AppendEmpty()
scopeLogs.Scope().SetName("otelcol/azureresourcelogs")
scopeLogs.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure")
scopeLogs.Scope().SetVersion(testBuildInfo.Version)
logRecords := scopeLogs.LogRecords()
lr = logRecords.AppendEmpty()
Expand All @@ -390,15 +390,15 @@ func TestUnmarshalLogs(t *testing.T) {
resourceLogs = expectedMaximum.ResourceLogs().AppendEmpty()
resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID-1")
scopeLogs = resourceLogs.ScopeLogs().AppendEmpty()
scopeLogs.Scope().SetName("otelcol/azureresourcelogs")
scopeLogs.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure")
scopeLogs.Scope().SetVersion(testBuildInfo.Version)
lr = scopeLogs.LogRecords().AppendEmpty()
maximumLogRecord1.CopyTo(lr)

resourceLogs = expectedMaximum.ResourceLogs().AppendEmpty()
resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID-2")
scopeLogs = resourceLogs.ScopeLogs().AppendEmpty()
scopeLogs.Scope().SetName("otelcol/azureresourcelogs")
scopeLogs.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure")
scopeLogs.Scope().SetVersion(testBuildInfo.Version)
lr = scopeLogs.LogRecords().AppendEmpty()
lr2 := scopeLogs.LogRecords().AppendEmpty()
Expand All @@ -409,7 +409,7 @@ func TestUnmarshalLogs(t *testing.T) {
resourceLogs = expectedBadLevel.ResourceLogs().AppendEmpty()
resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID")
scopeLogs = resourceLogs.ScopeLogs().AppendEmpty()
scopeLogs.Scope().SetName("otelcol/azureresourcelogs")
scopeLogs.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure")
scopeLogs.Scope().SetVersion(testBuildInfo.Version)
lr = scopeLogs.LogRecords().AppendEmpty()
badLevelLogRecord.CopyTo(lr)
Expand All @@ -418,7 +418,7 @@ func TestUnmarshalLogs(t *testing.T) {
resourceLogs = expectedBadTime.ResourceLogs().AppendEmpty()
resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID")
scopeLogs = resourceLogs.ScopeLogs().AppendEmpty()
scopeLogs.Scope().SetName("otelcol/azureresourcelogs")
scopeLogs.Scope().SetName("github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure")
scopeLogs.Scope().SetVersion(testBuildInfo.Version)
lr = scopeLogs.LogRecords().AppendEmpty()
badTimeLogRecord.CopyTo(lr)
Expand Down
3 changes: 1 addition & 2 deletions pkg/translator/azure/resources_to_traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
const (
// Constants for OpenTelemetry Specs
traceAzureResourceID = "azure.resource.id"
traceScopeName = "otelcol/azureresourcetraces"
)

type azureTracesRecords struct {
Expand Down Expand Up @@ -79,7 +78,7 @@ func (r TracesUnmarshaler) UnmarshalTraces(buf []byte) (ptrace.Traces, error) {

resourceTraces := t.ResourceSpans().AppendEmpty()
resource := resourceTraces.Resource()
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKName, traceScopeName)
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKName, scopeName)
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKLanguage, conventions.AttributeTelemetrySDKLanguageGo)
resource.Attributes().PutStr(conventions.AttributeTelemetrySDKVersion, r.Version)
resource.Attributes().PutStr(conventions.AttributeCloudProvider, conventions.AttributeCloudProviderAzure)
Expand Down
Loading