Skip to content

Commit

Permalink
pkg/trace/api: Deprecate and remove usage of UsePreviewHostnameLogic. (
Browse files Browse the repository at this point in the history
…#16159)

* pkg/trace/api: Deprecate and remove usage of UsePreviewHostnameLogic.

Follow up to: [PR](DataDog/opentelemetry-mapping-go#21).

This PR Deprecates field `UsePreviewHostnameLogic` and removes usage of this field. This is in an effort to graduate the `exporter.datadog.hostname.preview` feature gate to stable ([task](https://datadoghq.atlassian.net/browse/OTEL-231)).

Once this change is released, the next steps are:
- opentelemetry-collector-contrib: Mark the `exporter.datadog.hostname.preview` feature gate as stable. Replace deprecated functions calls by new function calls (following [PR](DataDog/opentelemetry-mapping-go#21)). Remove references of `UsePreviewHostnameLogic` field (e.g. [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.73.0/exporter/datadogexporter/traces_exporter.go#L179)).
- opentelemetry-mapping-go: remove deprecated functions and codepaths which use preview rules.
  • Loading branch information
mackjmr authored Mar 22, 2023
1 parent 878abc1 commit 8b27e87
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 87 deletions.
4 changes: 4 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1844,18 +1844,22 @@ core,google.golang.org/protobuf/internal/filetype,BSD-3-Clause,Copyright (c) 201
core,google.golang.org/protobuf/internal/flags,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/genid,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/impl,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/msgfmt,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/order,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/pragma,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/set,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/strs,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/internal/version,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/proto,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/reflect/protodesc,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/reflect/protopath,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/reflect/protorange,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/reflect/protoreflect,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/reflect/protoregistry,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/runtime/protoiface,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/runtime/protoimpl,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/types/descriptorpb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/types/dynamicpb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/types/known/anypb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/types/known/durationpb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
core,google.golang.org/protobuf/types/known/emptypb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved
Expand Down
13 changes: 6 additions & 7 deletions cmd/trace-agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,12 @@ func applyDatadogConfig(c *config.AgentConfig) error {
grpcPort = coreconfig.Datadog.GetInt(coreconfig.OTLPTracePort)
}
c.OTLPReceiver = &config.OTLP{
BindHost: c.ReceiverHost,
GRPCPort: grpcPort,
UsePreviewHostnameLogic: true,
MaxRequestBytes: c.MaxRequestBytes,
SpanNameRemappings: coreconfig.Datadog.GetStringMapString("otlp_config.traces.span_name_remappings"),
SpanNameAsResourceName: coreconfig.Datadog.GetBool("otlp_config.traces.span_name_as_resource_name"),
ProbabilisticSampling: coreconfig.Datadog.GetFloat64("otlp_config.traces.probabilistic_sampler.sampling_percentage"),
BindHost: c.ReceiverHost,
GRPCPort: grpcPort,
MaxRequestBytes: c.MaxRequestBytes,
SpanNameRemappings: coreconfig.Datadog.GetStringMapString("otlp_config.traces.span_name_remappings"),
SpanNameAsResourceName: coreconfig.Datadog.GetBool("otlp_config.traces.span_name_as_resource_name"),
ProbabilisticSampling: coreconfig.Datadog.GetFloat64("otlp_config.traces.probabilistic_sampler.sampling_percentage"),
}

if coreconfig.Datadog.GetBool("apm_config.telemetry.enabled") {
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ require (
github.com/DataDog/gohai v0.0.0-20221116153829-5d479901d2e9
github.com/DataDog/gopsutil v1.2.2
github.com/DataDog/nikos v1.10.0
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.1.1
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.1.3
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.1.1
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.1.1
github.com/DataDog/sketches-go v1.4.1
Expand Down Expand Up @@ -200,14 +200,14 @@ require (
go.opentelemetry.io/collector/confmap v0.71.0
go.opentelemetry.io/collector/exporter/loggingexporter v0.71.0
go.opentelemetry.io/collector/exporter/otlpexporter v0.71.0
go.opentelemetry.io/collector/pdata v1.0.0-rc5
go.opentelemetry.io/collector/pdata v1.0.0-rc7
go.opentelemetry.io/collector/processor/batchprocessor v0.71.0
go.opentelemetry.io/collector/receiver/otlpreceiver v0.71.0
go.uber.org/atomic v1.10.0
go.uber.org/automaxprocs v1.5.1
go.uber.org/dig v1.15.0
go.uber.org/fx v1.18.2
go.uber.org/multierr v1.9.0
go.uber.org/multierr v1.10.0
go.uber.org/zap v1.24.0
go4.org/netipx v0.0.0-20220812043211-3cc044ffd68d
golang.org/x/arch v0.3.0
Expand All @@ -219,10 +219,10 @@ require (
golang.org/x/time v0.3.0
golang.org/x/tools v0.7.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
google.golang.org/grpc v1.53.0
google.golang.org/grpc/examples v0.0.0-20221020162917-9127159caf5a
google.golang.org/protobuf v1.28.1
google.golang.org/protobuf v1.30.0
gopkg.in/DataDog/dd-trace-go.v1 v1.37.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -246,11 +246,11 @@ require (
)

require (
cloud.google.com/go v0.107.0 // indirect
cloud.google.com/go/compute v1.15.1 // indirect
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.8.0 // indirect
cloud.google.com/go/storage v1.28.0 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/storage v1.28.1 // indirect
code.cloudfoundry.org/cfhttp/v2 v2.0.0 // indirect
code.cloudfoundry.org/clock v1.0.0 // indirect
code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97 // indirect
Expand Down Expand Up @@ -374,7 +374,7 @@ require (
github.com/google/licenseclassifier/v2 v2.0.0 // indirect
github.com/google/uuid v1.3.0
github.com/google/wire v0.5.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down Expand Up @@ -519,7 +519,7 @@ require (
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector/consumer v0.71.0 // indirect
go.opentelemetry.io/collector/featuregate v0.71.0 // indirect
go.opentelemetry.io/collector/semconv v0.71.0 // indirect
go.opentelemetry.io/collector/semconv v0.73.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.39.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.39.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.14.0 // indirect
Expand All @@ -536,11 +536,11 @@ require (
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/term v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gonum.org/v1/gonum v0.12.0 // indirect
google.golang.org/api v0.103.0 // indirect
google.golang.org/api v0.110.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
Expand Down
Loading

0 comments on commit 8b27e87

Please sign in to comment.