Skip to content

Commit

Permalink
[OTEL-2297] upgrade opentelemetry-mapping-go versions
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Dec 11, 2024
1 parent 97fdc4d commit ef71c7e
Show file tree
Hide file tree
Showing 30 changed files with 174 additions and 146 deletions.
10 changes: 5 additions & 5 deletions comp/otelcol/ddflareextension/impl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,16 @@ require (
github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect
github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect
github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // indirect
github.com/DataDog/datadog-go/v5 v5.5.0 // indirect
github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect
github.com/DataDog/go-sqllexer v0.0.17 // indirect
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 // indirect
github.com/DataDog/sketches-go v1.4.6 // indirect
github.com/DataDog/viper v1.13.5 // indirect
github.com/DataDog/zstd v1.5.6 // indirect
Expand Down
28 changes: 14 additions & 14 deletions comp/otelcol/ddflareextension/impl/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions comp/otelcol/otlp/components/exporter/datadogexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ require (
github.com/DataDog/datadog-agent/pkg/serializer v0.56.0-rc.3
github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3
github.com/DataDog/datadog-go/v5 v5.5.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0
github.com/stretchr/testify v1.10.0
go.opentelemetry.io/collector/component v0.115.0
Expand Down Expand Up @@ -197,13 +197,13 @@ require (
github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect
github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect
github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // indirect
github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect
github.com/DataDog/go-sqllexer v0.0.17 // indirect
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 // indirect
github.com/DataDog/sketches-go v1.4.6 // indirect
github.com/DataDog/viper v1.13.5 // indirect
github.com/DataDog/zstd v1.5.6 // indirect
Expand Down Expand Up @@ -259,7 +259,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/outcaste-io/ristretto v0.2.3 // indirect
Expand Down
28 changes: 14 additions & 14 deletions comp/otelcol/otlp/components/exporter/datadogexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ require (
github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3
github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3
github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0
github.com/stormcat24/protodep v0.1.8
github.com/stretchr/testify v1.10.0
go.opentelemetry.io/collector/component v0.115.0
Expand Down Expand Up @@ -90,8 +90,8 @@ require (
github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect
github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect
github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 // indirect
github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 // indirect
github.com/DataDog/sketches-go v1.4.6 // indirect
github.com/DataDog/viper v1.13.5 // indirect
github.com/DataDog/zstd v1.5.6 // indirect
Expand Down
16 changes: 8 additions & 8 deletions comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,22 @@ func (e *Exporter) ConsumeLogs(ctx context.Context, ld plog.Logs) (err error) {
if ddLog.Service != nil {
service = *ddLog.Service
}
status := ddLog.AdditionalProperties["status"]
if status == "" {
status = message.StatusInfo
status := message.StatusInfo
if val, ok := ddLog.AdditionalProperties["status"]; ok {
if strVal, ok := val.(string); ok && strVal != "" {
status = strVal
}
}
origin := message.NewOrigin(e.logSource)
origin.SetTags(tags)
origin.SetService(service)
if src, ok := ddLog.AdditionalProperties["datadog.log.source"]; ok {
origin.SetSource(src)
} else {
origin.SetSource(e.logSource.Name)
src := e.logSource.Name
if val, ok := ddLog.AdditionalProperties["datadog.log.source"]; ok {
if strVal, ok := val.(string); ok && strVal != "" {
src = strVal
}
}
origin.SetSource(src)

content, err := ddLog.MarshalJSON()
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,38 @@ func TestLogsExporter(t *testing.T) {
},
expectedTags: [][]string{{"otel_source:datadog_agent"}},
},
{
name: "status",
args: args{
ld: func() plog.Logs {
l := testutil.GenerateLogsOneLogRecord()
rl := l.ResourceLogs().At(0)
rl.ScopeLogs().At(0).LogRecords().At(0).SetSeverityText("Fatal")
return l
}(),
otelSource: otelSource,
logSourceName: LogSourceName,
},

want: testutil.JSONLogs{
{
"message": "This is a log message",
"app": "server",
"instance_num": "1",
"@timestamp": testutil.TestLogTime.Format("2006-01-02T15:04:05.000Z07:00"),
"status": "Fatal",
"dd.span_id": fmt.Sprintf("%d", spanIDToUint64(ld.SpanID())),
"dd.trace_id": fmt.Sprintf("%d", traceIDToUint64(ld.TraceID())),
"otel.severity_text": "Fatal",
"otel.severity_number": "9",
"otel.span_id": spanIDToHexOrEmptyString(ld.SpanID()),
"otel.trace_id": traceIDToHexOrEmptyString(ld.TraceID()),
"otel.timestamp": fmt.Sprintf("%d", testutil.TestLogTime.UnixNano()),
"resource-attr": "resource-attr-val-1",
},
},
expectedTags: [][]string{{"otel_source:datadog_agent"}},
},
{
name: "ddtags",
args: args{
Expand Down
Loading

0 comments on commit ef71c7e

Please sign in to comment.