Skip to content

Commit 997a153

Browse files
songy23dmathieu
authored andcommitted
[chore][exporter/datadog] try fix linter (open-telemetry#39165)
#### Description Un-deprecate an internal config field. End users will still get warnings if they set this config. This seems to introduce flakiness in linters (sometimes linter picks up the `//nolint:staticcheck` comment, sometimes doesn't). It is not very clear to me how linters can be flaky but this PR should make it stable
1 parent 8b0e231 commit 997a153

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

exporter/datadogexporter/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func (f *factory) createMetricsExporter(
319319
// Start the hostmetadata pusher once.
320320
// It sends the hostmetadata for the host where the collector is running.
321321
if cfg.HostMetadata.Enabled {
322-
if cfg.HostMetadata.HostnameSource == datadogconfig.HostnameSourceFirstResource { //nolint:staticcheck
322+
if cfg.HostMetadata.HostnameSource == datadogconfig.HostnameSourceFirstResource {
323323
set.Logger.Warn("first_resource has no effect when serializer exporter is used for exporting metrics")
324324
}
325325
f.onceMetadata.Do(func() {

exporter/datadogexporter/hostmetadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func newMetadataConfigfromConfig(cfg *datadogconfig.Config) hostmetadata.PusherC
1515
ConfigTags: cfg.HostMetadata.Tags,
1616
MetricsEndpoint: cfg.Metrics.Endpoint,
1717
APIKey: string(cfg.API.Key),
18-
UseResourceMetadata: cfg.HostMetadata.HostnameSource == datadogconfig.HostnameSourceFirstResource, //nolint:staticcheck
18+
UseResourceMetadata: cfg.HostMetadata.HostnameSource == datadogconfig.HostnameSourceFirstResource,
1919
InsecureSkipVerify: cfg.TLSSetting.InsecureSkipVerify,
2020
ClientConfig: cfg.ClientConfig,
2121
RetrySettings: cfg.BackOffConfig,

pkg/datadog/config/host.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import (
1313
type HostnameSource string
1414

1515
const (
16-
// Deprecated: [v0.124.0] opt in to https://docs.datadoghq.com/opentelemetry/mapping/host_metadata/ instead
17-
//
1816
// HostnameSourceFirstResource picks the host metadata hostname from the resource
1917
// attributes on the first OTLP payload that gets to the exporter. If it is lacking any
2018
// hostname-like attributes, it will fallback to 'config_or_system' behavior (see below).

0 commit comments

Comments
 (0)