Skip to content

Commit

Permalink
[pkg/otlp/logs] upgrade datadog-api-client-go version
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Dec 9, 2024
1 parent 6c2d6a8 commit 08b9103
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
4 changes: 3 additions & 1 deletion pkg/otlp/logs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs
go 1.20

require (
github.com/DataDog/datadog-api-client-go/v2 v2.13.0
github.com/DataDog/datadog-api-client-go/v2 v2.33.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/component v0.94.1
Expand All @@ -21,8 +21,10 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
Expand Down
14 changes: 12 additions & 2 deletions pkg/otlp/logs/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/DataDog/datadog-api-client-go/v2 v2.13.0 h1:2c1dXSyUfum2YIVoYlqnBhV5JOG1cLSW+4jB3RrKjLc=
github.com/DataDog/datadog-api-client-go/v2 v2.13.0/go.mod h1:kntOqXEh1SmjwSDzW/eJkr9kS7EqttvEkelglWtJRbg=
github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM=
github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U=
github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8=
github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand All @@ -16,6 +16,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
Expand All @@ -24,7 +26,10 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand All @@ -36,7 +41,9 @@ github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC
github.com/knadh/koanf/v2 v2.0.2 h1:sEZzPW2rVWSahcYILNq/syJdEyRafZIG0l9aWwL86HA=
github.com/knadh/koanf/v2 v2.0.2/go.mod h1:HN9uZ+qFAejH1e4G41gnoffIanINWQuONLXiV7kir6k=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
Expand All @@ -59,6 +66,7 @@ github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1B
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
Expand Down Expand Up @@ -89,6 +97,7 @@ go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
Expand Down Expand Up @@ -152,5 +161,6 @@ google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion pkg/otlp/logs/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Transform(lr plog.LogRecord, res pcommon.Resource, logger *zap.Logger) data

func transform(lr plog.LogRecord, host, service string, res pcommon.Resource, logger *zap.Logger) datadogV2.HTTPLogItem {
l := datadogV2.HTTPLogItem{
AdditionalProperties: make(map[string]string),
AdditionalProperties: make(map[string]interface{}),
}
if host != "" {
l.Hostname = datadog.PtrString(host)
Expand Down
36 changes: 18 additions & 18 deletions pkg/otlp/logs/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestTranslator(t *testing.T) {
want: datadogV2.HTTPLogItem{
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand All @@ -89,7 +89,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("service:otlp_col,otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("service:otlp_col,foo:bar,otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -241,7 +241,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -274,7 +274,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -336,7 +336,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "alert",
otelSeverityText: "alert",
Expand Down Expand Up @@ -371,7 +371,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"message": "This is log",
"app": "test",
"status": "warn",
Expand Down Expand Up @@ -406,7 +406,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"message": "This is log",
"app": "test",
"status": "error",
Expand Down Expand Up @@ -438,7 +438,7 @@ func TestTranslator(t *testing.T) {
Ddtags: datadog.PtrString("service:otlp_col,otel_source:test"),
Message: *datadog.PtrString(""),
Service: datadog.PtrString("otlp_col"),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -466,7 +466,7 @@ func TestTranslator(t *testing.T) {
want: datadogV2.HTTPLogItem{
Ddtags: datadog.PtrString("service:otlp_col,otel_source:test"),
Message: *datadog.PtrString(""),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"app": "test",
"status": "debug",
otelSeverityNumber: "5",
Expand Down Expand Up @@ -505,7 +505,7 @@ func TestTranslator(t *testing.T) {
want: datadogV2.HTTPLogItem{
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"root.nest1.nest2": "val",
"root.nest12.nest22.nest3": "val2",
"root.nest13": "val3",
Expand All @@ -529,7 +529,7 @@ func TestTranslator(t *testing.T) {
want: datadogV2.HTTPLogItem{
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"status": "",
},
},
Expand Down Expand Up @@ -579,7 +579,7 @@ func TestTranslator(t *testing.T) {
want: datadogV2.HTTPLogItem{
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"nest1.nest2.nest3.nest4.nest5.nest6.nest7.nest8.nest9.nest10": "{\"nest11\":{\"nest12\":\"ok\"}}",
"nest1.nest2.nest3.nest4.nest5.nest14.nest15": "ok2",
"status": "",
Expand All @@ -603,7 +603,7 @@ func TestTranslator(t *testing.T) {
want: datadogV2.HTTPLogItem{
Ddtags: datadog.PtrString("otel_source:test"),
Message: *datadog.PtrString(""),
AdditionalProperties: map[string]string{
AdditionalProperties: map[string]interface{}{
"status": "debug",
otelSeverityNumber: "5",
ddTimestamp: "2023-11-20T16:55:03.397Z",
Expand Down

0 comments on commit 08b9103

Please sign in to comment.