From 6cb173db4653fdcd9784edf24313e661429c3e1b Mon Sep 17 00:00:00 2001 From: Yang Song Date: Sat, 25 May 2024 23:53:42 -0400 Subject: [PATCH] [chore] Replace internal/datadog with datadog agent packages --- .github/CODEOWNERS | 1 - .github/ISSUE_TEMPLATE/bug_report.yaml | 1 - .github/ISSUE_TEMPLATE/feature_request.yaml | 1 - .github/ISSUE_TEMPLATE/other.yaml | 1 - .github/ISSUE_TEMPLATE/unmaintained.yaml | 1 - cmd/configschema/go.mod | 5 +- cmd/configschema/go.sum | 4 + cmd/otelcontribcol/builder-config.yaml | 1 - cmd/otelcontribcol/go.mod | 5 +- cmd/otelcontribcol/go.sum | 4 + connector/datadogconnector/connector.go | 9 +- connector/datadogconnector/factory.go | 4 +- connector/datadogconnector/go.mod | 5 +- connector/datadogconnector/go.sum | 4 + exporter/datadogexporter/factory.go | 6 +- exporter/datadogexporter/go.mod | 5 +- exporter/datadogexporter/go.sum | 4 + .../datadogexporter/integrationtest/go.mod | 5 +- .../datadogexporter/integrationtest/go.sum | 4 + go.mod | 5 +- go.sum | 4 + internal/datadog/Makefile | 1 - internal/datadog/agent.go | 176 ----------- internal/datadog/agent_test.go | 87 ------ internal/datadog/go.mod | 93 ------ internal/datadog/go.sum | 290 ------------------ internal/datadog/metadata.yaml | 4 - internal/datadog/metrics_client.go | 160 ---------- internal/datadog/metrics_client_test.go | 229 -------------- versions.yaml | 1 - 30 files changed, 45 insertions(+), 1075 deletions(-) delete mode 100644 internal/datadog/Makefile delete mode 100644 internal/datadog/agent.go delete mode 100644 internal/datadog/agent_test.go delete mode 100644 internal/datadog/go.mod delete mode 100644 internal/datadog/go.sum delete mode 100644 internal/datadog/metadata.yaml delete mode 100644 internal/datadog/metrics_client.go delete mode 100644 internal/datadog/metrics_client_test.go diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8eb88c0b4576..1367596490c4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -123,7 +123,6 @@ extension/sumologicextension/ @open-telemetry/collect internal/aws/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @mxiamxia internal/collectd/ @open-telemetry/collector-contrib-approvers @atoulme internal/coreinternal/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers -internal/datadog/ @open-telemetry/collector-contrib-approvers @mx-psi @dineshg13 internal/docker/ @open-telemetry/collector-contrib-approvers @rmfitzpatrick @jamesmoessis internal/exp/metrics/ @open-telemetry/collector-contrib-approvers @sh0rez @RichieSams internal/filter/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index cafcd6c2fdb7..3618bbc8ceaf 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -121,7 +121,6 @@ body: - internal/aws - internal/collectd - internal/core - - internal/datadog - internal/docker - internal/exp/metrics - internal/filter diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 1ccb45cb3068..183db9a12d0d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -115,7 +115,6 @@ body: - internal/aws - internal/collectd - internal/core - - internal/datadog - internal/docker - internal/exp/metrics - internal/filter diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index 9cce3ca83707..47c23a6f57d3 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -115,7 +115,6 @@ body: - internal/aws - internal/collectd - internal/core - - internal/datadog - internal/docker - internal/exp/metrics - internal/filter diff --git a/.github/ISSUE_TEMPLATE/unmaintained.yaml b/.github/ISSUE_TEMPLATE/unmaintained.yaml index f349e1c10851..37d26bdf2ebc 100644 --- a/.github/ISSUE_TEMPLATE/unmaintained.yaml +++ b/.github/ISSUE_TEMPLATE/unmaintained.yaml @@ -120,7 +120,6 @@ body: - internal/aws - internal/collectd - internal/core - - internal/datadog - internal/docker - internal/exp/metrics - internal/filter diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index a1d234401384..80edc8357788 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -228,6 +228,8 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 // indirect github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/env v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/model v0.54.0-rc.5 // indirect @@ -562,7 +564,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.101.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.101.0 // indirect @@ -1187,8 +1188,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/obse replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../internal/datadog - replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling => ../../extension/jaegerremotesampling replace github.com/open-telemetry/opentelemetry-collector-contrib => ../.. diff --git a/cmd/configschema/go.sum b/cmd/configschema/go.sum index 931fd2cd9828..ae9d3c11c98c 100644 --- a/cmd/configschema/go.sum +++ b/cmd/configschema/go.sum @@ -748,6 +748,10 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5/go.mod h1:yMYGvbt3AAXiXoadUxEbxWl6C3/Ub2t8dn2UG7Y54SM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 h1:5HcA9XYLdI0Z81o5p7SppdVCYjKoshv9GBrqZfeLvC4= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5/go.mod h1:R2jDIkQpwYzy4AturN73oJB2X32jtivHW9TvdeN7BAQ= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 h1:KeIeWDAjzQxL6/ruBQmFlT/FRstEz11z/UT3LH+8sAA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646/go.mod h1:TIf/0Kb3DAYAtYbhhxmZ72etu+IKSqy66mcIGBuioik= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 h1:dyGnQr1QVLhwLdKzCTMsDsnYYUOkOXU4JWT2HuS1LJ4= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646/go.mod h1:m7gt1CfJ/8FgnidFPk2lENaxO9m0mOnWWJQylgJkMzw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5 h1:GuGbndVAnhNa6JOtDsDEWXmZFJB0fp4iCnJ3OO1JSks= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5/go.mod h1:6ydg+CWz9UlcBkV4pptOdQXTLNc/8YkTqta6VJFGg1M= github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 h1:YEvetFgYjf3oZsliKn0ddrz1t4ZvOzzlvOxJ100szlI= diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index 95a0bb1386d8..1c3b723566f6 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -266,7 +266,6 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/cassandraexporter => ../../exporter/cassandraexporter - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/udplogreceiver => ../../receiver/udplogreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk => ../../internal/splunk - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../internal/datadog - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver => ../../receiver/podmanreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver => ../../receiver/flinkmetricsreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsecscontainermetricsreceiver => ../../receiver/awsecscontainermetricsreceiver diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index bd37a0163c87..81f617bc4e1a 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -295,6 +295,8 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 // indirect github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/env v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/model v0.54.0-rc.5 // indirect @@ -614,7 +616,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.101.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.101.0 // indirect @@ -888,8 +889,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/udplo replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk => ../../internal/splunk -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../internal/datadog - replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver => ../../receiver/podmanreceiver replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver => ../../receiver/flinkmetricsreceiver diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index b75e76a66b19..d881da4b1f00 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -747,6 +747,10 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5/go.mod h1:yMYGvbt3AAXiXoadUxEbxWl6C3/Ub2t8dn2UG7Y54SM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 h1:5HcA9XYLdI0Z81o5p7SppdVCYjKoshv9GBrqZfeLvC4= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5/go.mod h1:R2jDIkQpwYzy4AturN73oJB2X32jtivHW9TvdeN7BAQ= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 h1:KeIeWDAjzQxL6/ruBQmFlT/FRstEz11z/UT3LH+8sAA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646/go.mod h1:TIf/0Kb3DAYAtYbhhxmZ72etu+IKSqy66mcIGBuioik= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 h1:dyGnQr1QVLhwLdKzCTMsDsnYYUOkOXU4JWT2HuS1LJ4= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646/go.mod h1:m7gt1CfJ/8FgnidFPk2lENaxO9m0mOnWWJQylgJkMzw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5 h1:GuGbndVAnhNa6JOtDsDEWXmZFJB0fp4iCnJ3OO1JSks= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5/go.mod h1:6ydg+CWz9UlcBkV4pptOdQXTLNc/8YkTqta6VJFGg1M= github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 h1:YEvetFgYjf3oZsliKn0ddrz1t4ZvOzzlvOxJ100szlI= diff --git a/connector/datadogconnector/connector.go b/connector/datadogconnector/connector.go index 03e83667d97d..711cbcffc559 100644 --- a/connector/datadogconnector/connector.go +++ b/connector/datadogconnector/connector.go @@ -9,6 +9,7 @@ import ( "sync" "time" + "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" "github.com/DataDog/datadog-agent/pkg/trace/timing" @@ -23,8 +24,6 @@ import ( semconv "go.opentelemetry.io/collector/semconv/v1.17.0" "go.opentelemetry.io/otel/metric/noop" "go.uber.org/zap" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" ) // traceToMetricConnector is the schema for connector @@ -34,7 +33,7 @@ type traceToMetricConnector struct { // agent specifies the agent used to ingest traces and output APM Stats. // It is implemented by the traceagent structure; replaced in tests. - agent datadog.Ingester + agent statsprocessor.Ingester // translator specifies the translator used to transform APM Stats Payloads // from the agent to OTLP Metrics. @@ -88,7 +87,7 @@ func newTraceToMetricConnector(set component.TelemetrySettings, cfg component.Co ctx := context.Background() return &traceToMetricConnector{ logger: set.Logger, - agent: datadog.NewAgentWithConfig(ctx, getTraceAgentCfg(set.Logger, cfg.(*Config).Traces, attributesTranslator), in, metricsClient, timingReporter), + agent: statsprocessor.NewAgentWithConfig(ctx, getTraceAgentCfg(set.Logger, cfg.(*Config).Traces, attributesTranslator), in, metricsClient, timingReporter), translator: trans, in: in, metricsConsumer: metricsConsumer, @@ -133,7 +132,7 @@ func (c *traceToMetricConnector) Start(_ context.Context, _ component.Host) erro // Shutdown implements the component.Component interface. func (c *traceToMetricConnector) Shutdown(context.Context) error { if !c.isStarted { - // Note: it is not necessary to manually close c.exit, c.in and c.agent.(*datadog.TraceAgent).exit channels as these are unused. + // Note: it is not necessary to manually close c.exit, c.in and c.agent.(*statsprocessor.TraceAgent).exit channels as these are unused. c.logger.Info("Requested shutdown, but not started, ignoring.") return nil } diff --git a/connector/datadogconnector/factory.go b/connector/datadogconnector/factory.go index bd7f2b7c04c2..fe6ed4ded352 100644 --- a/connector/datadogconnector/factory.go +++ b/connector/datadogconnector/factory.go @@ -8,13 +8,13 @@ package datadogconnector // import "github.com/open-telemetry/opentelemetry-coll import ( "context" + "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient" "github.com/DataDog/datadog-agent/pkg/trace/timing" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/consumer" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector/internal/metadata" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" ) // NewFactory creates a factory for tailtracer connector. @@ -39,7 +39,7 @@ func createDefaultConfig() component.Config { // defines the consumer type of the connector // we want to consume traces and export metrics therefore define nextConsumer as metrics, consumer is the next component in the pipeline func createTracesToMetricsConnector(_ context.Context, params connector.CreateSettings, cfg component.Config, nextConsumer consumer.Metrics) (connector.Traces, error) { - metricsClient := datadog.InitializeMetricClient(params.MeterProvider, datadog.ConnectorSourceTag) + metricsClient := metricsclient.InitializeMetricClient(params.MeterProvider, metricsclient.ConnectorSourceTag) timingReporter := timing.New(metricsClient) c, err := newTraceToMetricConnector(params.TelemetrySettings, cfg, nextConsumer, metricsClient, timingReporter) if err != nil { diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 7c0763d349eb..75ab91657290 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -3,13 +3,14 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/connector/datad go 1.21.0 require ( + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 github.com/DataDog/datadog-agent/pkg/proto v0.54.0-rc.5 github.com/DataDog/datadog-agent/pkg/trace v0.54.0-rc.5 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.16.1 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.16.1 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.101.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.101.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.101.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/stretchr/testify v1.9.0 @@ -275,8 +276,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../internal/datadog - replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor => ../../processor/tailsamplingprocessor replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => ../../internal/metadataproviders diff --git a/connector/datadogconnector/go.sum b/connector/datadogconnector/go.sum index 197817931e21..23b8e4e07c37 100644 --- a/connector/datadogconnector/go.sum +++ b/connector/datadogconnector/go.sum @@ -89,6 +89,10 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5/go.mod h1:yMYGvbt3AAXiXoadUxEbxWl6C3/Ub2t8dn2UG7Y54SM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 h1:5HcA9XYLdI0Z81o5p7SppdVCYjKoshv9GBrqZfeLvC4= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5/go.mod h1:R2jDIkQpwYzy4AturN73oJB2X32jtivHW9TvdeN7BAQ= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 h1:KeIeWDAjzQxL6/ruBQmFlT/FRstEz11z/UT3LH+8sAA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646/go.mod h1:TIf/0Kb3DAYAtYbhhxmZ72etu+IKSqy66mcIGBuioik= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 h1:dyGnQr1QVLhwLdKzCTMsDsnYYUOkOXU4JWT2HuS1LJ4= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646/go.mod h1:m7gt1CfJ/8FgnidFPk2lENaxO9m0mOnWWJQylgJkMzw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5 h1:GuGbndVAnhNa6JOtDsDEWXmZFJB0fp4iCnJ3OO1JSks= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5/go.mod h1:6ydg+CWz9UlcBkV4pptOdQXTLNc/8YkTqta6VJFGg1M= github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 h1:YEvetFgYjf3oZsliKn0ddrz1t4ZvOzzlvOxJ100szlI= diff --git a/exporter/datadogexporter/factory.go b/exporter/datadogexporter/factory.go index 61529b2005f7..c8840f5de19d 100644 --- a/exporter/datadogexporter/factory.go +++ b/exporter/datadogexporter/factory.go @@ -11,6 +11,7 @@ import ( "time" "github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline" + "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/pkg/trace/agent" "github.com/DataDog/datadog-agent/pkg/trace/telemetry" @@ -36,7 +37,6 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/hostmetadata" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/metadata" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry" ) @@ -151,7 +151,7 @@ func (f *factory) StopReporter() { } func (f *factory) TraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider, attrsTranslator *attributes.Translator) (*agent.Agent, error) { - agnt, err := newTraceAgent(ctx, params, cfg, sourceProvider, datadog.InitializeMetricClient(params.MeterProvider, datadog.ExporterSourceTag), attrsTranslator) + agnt, err := newTraceAgent(ctx, params, cfg, sourceProvider, metricsclient.InitializeMetricClient(params.MeterProvider, metricsclient.ExporterSourceTag), attrsTranslator) if err != nil { return nil, err } @@ -312,7 +312,7 @@ func (f *factory) createMetricsExporter( return nil, err } statsToAgent := make(chan *pb.StatsPayload) - metricsClient := datadog.InitializeMetricClient(set.MeterProvider, datadog.ExporterSourceTag) + metricsClient := metricsclient.InitializeMetricClient(set.MeterProvider, metricsclient.ExporterSourceTag) timingReporter := timing.New(metricsClient) statsWriter := writer.NewStatsWriter(acfg, statsToAgent, telemetry.NewNoopCollector(), metricsClient, timingReporter) diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index 3ac8543b4576..d4d765ecc18f 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -11,6 +11,7 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.54.0-rc.5 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5 github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 github.com/DataDog/datadog-agent/pkg/config/model v0.54.0-rc.5 github.com/DataDog/datadog-agent/pkg/config/setup v0.54.0-rc.5 github.com/DataDog/datadog-agent/pkg/logs/auditor v0.54.0-rc.5 // indirect @@ -39,7 +40,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.101.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.101.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.101.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.101.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.101.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.101.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.101.0 @@ -97,6 +97,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/secrets v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/def v0.54.0-rc.5 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 // indirect github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/env v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.54.0-rc.5 // indirect @@ -419,8 +420,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/prob replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver => ../../receiver/prometheusreceiver -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../internal/datadog - replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite => ../../pkg/translator/prometheusremotewrite replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor => ../../processor/tailsamplingprocessor diff --git a/exporter/datadogexporter/go.sum b/exporter/datadogexporter/go.sum index 772046f4f6bf..0cc0610224fd 100644 --- a/exporter/datadogexporter/go.sum +++ b/exporter/datadogexporter/go.sum @@ -97,6 +97,10 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5/go.mod h1:yMYGvbt3AAXiXoadUxEbxWl6C3/Ub2t8dn2UG7Y54SM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 h1:5HcA9XYLdI0Z81o5p7SppdVCYjKoshv9GBrqZfeLvC4= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5/go.mod h1:R2jDIkQpwYzy4AturN73oJB2X32jtivHW9TvdeN7BAQ= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 h1:KeIeWDAjzQxL6/ruBQmFlT/FRstEz11z/UT3LH+8sAA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646/go.mod h1:TIf/0Kb3DAYAtYbhhxmZ72etu+IKSqy66mcIGBuioik= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 h1:dyGnQr1QVLhwLdKzCTMsDsnYYUOkOXU4JWT2HuS1LJ4= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646/go.mod h1:m7gt1CfJ/8FgnidFPk2lENaxO9m0mOnWWJQylgJkMzw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5 h1:GuGbndVAnhNa6JOtDsDEWXmZFJB0fp4iCnJ3OO1JSks= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5/go.mod h1:6ydg+CWz9UlcBkV4pptOdQXTLNc/8YkTqta6VJFGg1M= github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 h1:YEvetFgYjf3oZsliKn0ddrz1t4ZvOzzlvOxJ100szlI= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index c6dbadb6fe3b..b0c83ccd17cd 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -40,6 +40,8 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 // indirect github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/env v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/model v0.54.0-rc.5 // indirect @@ -167,7 +169,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.101.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.101.0 // indirect @@ -275,8 +276,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../../internal/datadog - replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ../../../internal/k8sconfig replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => ../../../internal/metadataproviders diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index 4c7718890d31..0ca20e604f2b 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -89,6 +89,10 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5/go.mod h1:yMYGvbt3AAXiXoadUxEbxWl6C3/Ub2t8dn2UG7Y54SM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 h1:5HcA9XYLdI0Z81o5p7SppdVCYjKoshv9GBrqZfeLvC4= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5/go.mod h1:R2jDIkQpwYzy4AturN73oJB2X32jtivHW9TvdeN7BAQ= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 h1:KeIeWDAjzQxL6/ruBQmFlT/FRstEz11z/UT3LH+8sAA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646/go.mod h1:TIf/0Kb3DAYAtYbhhxmZ72etu+IKSqy66mcIGBuioik= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 h1:dyGnQr1QVLhwLdKzCTMsDsnYYUOkOXU4JWT2HuS1LJ4= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646/go.mod h1:m7gt1CfJ/8FgnidFPk2lENaxO9m0mOnWWJQylgJkMzw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5 h1:GuGbndVAnhNa6JOtDsDEWXmZFJB0fp4iCnJ3OO1JSks= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5/go.mod h1:6ydg+CWz9UlcBkV4pptOdQXTLNc/8YkTqta6VJFGg1M= github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 h1:YEvetFgYjf3oZsliKn0ddrz1t4ZvOzzlvOxJ100szlI= diff --git a/go.mod b/go.mod index 035791e586ff..305ea859e344 100644 --- a/go.mod +++ b/go.mod @@ -245,6 +245,8 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 // indirect github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/env v0.54.0-rc.5 // indirect github.com/DataDog/datadog-agent/pkg/config/model v0.54.0-rc.5 // indirect @@ -562,7 +564,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.101.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.101.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.101.0 // indirect @@ -1167,8 +1168,6 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zooke replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver => ./extension/observer/dockerobserver -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ./internal/datadog - replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/jaegerremotesampling => ./extension/jaegerremotesampling // see https://github.com/google/gnostic/issues/262 diff --git a/go.sum b/go.sum index b6ed3748e9fa..c57b9dfc6fbd 100644 --- a/go.sum +++ b/go.sum @@ -750,6 +750,10 @@ github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelin github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.54.0-rc.5/go.mod h1:yMYGvbt3AAXiXoadUxEbxWl6C3/Ub2t8dn2UG7Y54SM= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5 h1:5HcA9XYLdI0Z81o5p7SppdVCYjKoshv9GBrqZfeLvC4= github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.54.0-rc.5/go.mod h1:R2jDIkQpwYzy4AturN73oJB2X32jtivHW9TvdeN7BAQ= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646 h1:KeIeWDAjzQxL6/ruBQmFlT/FRstEz11z/UT3LH+8sAA= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.0.0-20240525065430-d0b647bcb646/go.mod h1:TIf/0Kb3DAYAtYbhhxmZ72etu+IKSqy66mcIGBuioik= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 h1:dyGnQr1QVLhwLdKzCTMsDsnYYUOkOXU4JWT2HuS1LJ4= +github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646/go.mod h1:m7gt1CfJ/8FgnidFPk2lENaxO9m0mOnWWJQylgJkMzw= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5 h1:GuGbndVAnhNa6JOtDsDEWXmZFJB0fp4iCnJ3OO1JSks= github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.54.0-rc.5/go.mod h1:6ydg+CWz9UlcBkV4pptOdQXTLNc/8YkTqta6VJFGg1M= github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.54.0-rc.5 h1:YEvetFgYjf3oZsliKn0ddrz1t4ZvOzzlvOxJ100szlI= diff --git a/internal/datadog/Makefile b/internal/datadog/Makefile deleted file mode 100644 index ded7a36092dc..000000000000 --- a/internal/datadog/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../Makefile.Common diff --git a/internal/datadog/agent.go b/internal/datadog/agent.go deleted file mode 100644 index 37971096218d..000000000000 --- a/internal/datadog/agent.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package datadog // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" - -import ( - "context" - "net/http" - "runtime" - "sync" - "time" - - pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" - "github.com/DataDog/datadog-agent/pkg/trace/agent" - "github.com/DataDog/datadog-agent/pkg/trace/api" - traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" - "github.com/DataDog/datadog-agent/pkg/trace/stats" - "github.com/DataDog/datadog-agent/pkg/trace/telemetry" - "github.com/DataDog/datadog-agent/pkg/trace/timing" - "github.com/DataDog/datadog-go/v5/statsd" - "go.opentelemetry.io/collector/pdata/ptrace" -) - -// TraceAgent specifies a minimal trace agent instance that is able to process traces and output stats. -type TraceAgent struct { - *agent.Agent - - // pchan specifies the channel that will be used to output Datadog Trace Agent API Payloads - // resulting from ingested OpenTelemetry spans. - pchan chan *api.Payload - - // wg waits for all goroutines to exit. - wg sync.WaitGroup - - // exit signals the agent to shut down. - exit chan struct{} -} - -// newAgent creates a new unstarted traceagent using the given context. Call Start to start the traceagent. -// The out channel will receive outoing stats payloads resulting from spans ingested using the Ingest method. -func NewAgent(ctx context.Context, out chan *pb.StatsPayload, metricsClient statsd.ClientInterface, timingReporter timing.Reporter) *TraceAgent { - return NewAgentWithConfig(ctx, traceconfig.New(), out, metricsClient, timingReporter) -} - -// newAgentWithConfig creates a new traceagent with the given config cfg. Used in tests; use newAgent instead. -func NewAgentWithConfig(ctx context.Context, cfg *traceconfig.AgentConfig, out chan *pb.StatsPayload, metricsClient statsd.ClientInterface, timingReporter timing.Reporter) *TraceAgent { - // disable the HTTP receiver - cfg.ReceiverPort = 0 - // set the API key to succeed startup; it is never used nor needed - cfg.Endpoints[0].APIKey = "skip_check" - // set the default hostname to the translator's placeholder; in the case where no hostname - // can be deduced from incoming traces, we don't know the default hostname (because it is set - // in the exporter). In order to avoid duplicating the hostname setting in the processor and - // exporter, we use a placeholder and fill it in later (in the Datadog Exporter or Agent OTLP - // Ingest). This gives a better user experience. - cfg.Hostname = "__unset__" - pchan := make(chan *api.Payload, 1000) - a := agent.NewAgent(ctx, cfg, telemetry.NewNoopCollector(), metricsClient) - // replace the Concentrator (the component which computes and flushes APM Stats from incoming - // traces) with our own, which uses the 'out' channel. - a.Concentrator = stats.NewConcentrator(cfg, out, time.Now(), metricsClient) - // ...and the same for the ClientStatsAggregator; we don't use it here, but it is also a source - // of stats which should be available to us. - a.ClientStatsAggregator = stats.NewClientStatsAggregator(cfg, out, metricsClient) - // lastly, start the OTLP receiver, which will be used to introduce ResourceSpans into the traceagent, - // so that we can transform them to Datadog spans and receive stats. - a.OTLPReceiver = api.NewOTLPReceiver(pchan, cfg, metricsClient, timingReporter) - return &TraceAgent{ - Agent: a, - exit: make(chan struct{}), - pchan: pchan, - } -} - -// Start starts the traceagent, making it ready to ingest spans. -func (p *TraceAgent) Start() { - // we don't need to start the full agent, so we only start a set of minimal - // components needed to compute stats: - for _, starter := range []interface{ Start() }{ - p.Concentrator, - p.ClientStatsAggregator, - // we don't need the samplers' nor the processor's functionalities; - // but they are used by the agent nevertheless, so they need to be - // active and functioning. - p.PrioritySampler, - p.ErrorsSampler, - p.NoPrioritySampler, - p.EventProcessor, - } { - starter.Start() - } - - p.goDrain() - p.goProcess() -} - -// Stop stops the traceagent, making it unable to ingest spans. Do not call Ingest after Stop. -func (p *TraceAgent) Stop() { - for _, stopper := range []interface{ Stop() }{ - p.Concentrator, - p.ClientStatsAggregator, - p.PrioritySampler, - p.ErrorsSampler, - p.NoPrioritySampler, - p.EventProcessor, - } { - stopper.Stop() - } - close(p.exit) - p.wg.Wait() -} - -// goDrain drains the TraceWriter channel, ensuring it won't block. We don't need the traces, -// nor do we have a running TraceWrite. We just want the outgoing stats. -func (p *TraceAgent) goDrain() { - p.wg.Add(1) - go func() { - defer p.wg.Done() - for { - select { - case <-p.TraceWriter.In: - // we don't write these traces anywhere; drain the channel - case <-p.exit: - return - } - } - }() -} - -// Ingest processes the given spans within the traceagent and outputs stats through the output channel -// provided to newAgent. Do not call Ingest on an unstarted or stopped traceagent. -func (p *TraceAgent) Ingest(ctx context.Context, traces ptrace.Traces) { - rspanss := traces.ResourceSpans() - for i := 0; i < rspanss.Len(); i++ { - rspans := rspanss.At(i) - p.OTLPReceiver.ReceiveResourceSpans(ctx, rspans, http.Header{}) - // ...the call transforms the OTLP Spans into a Datadog payload and sends the result - // down the p.pchan channel - - } -} - -// goProcesses runs the main loop which takes incoming payloads, processes them and generates stats. -// It then picks up those stats and converts them to metrics. -func (p *TraceAgent) goProcess() { - for i := 0; i < runtime.NumCPU(); i++ { - p.wg.Add(1) - go func() { - defer p.wg.Done() - for { - select { - case payload := <-p.pchan: - p.Process(payload) - // ...the call processes the payload and outputs stats via the 'out' channel - // provided to newAgent - case <-p.exit: - return - } - } - }() - } -} - -var _ Ingester = (*TraceAgent)(nil) - -// An Ingester is able to ingest traces. Implemented by traceagent. -type Ingester interface { - // Start starts the ingester. - Start() - - // Ingest ingests the set of traces. - Ingest(ctx context.Context, traces ptrace.Traces) - - // Stop stops the ingester. - Stop() -} diff --git a/internal/datadog/agent_test.go b/internal/datadog/agent_test.go deleted file mode 100644 index c7787814fa16..000000000000 --- a/internal/datadog/agent_test.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package datadog // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" - -import ( - "context" - "testing" - "time" - - pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" - traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" - "github.com/DataDog/datadog-agent/pkg/trace/testutil" - "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component/componenttest" -) - -func TestTraceAgentConfig(t *testing.T) { - cfg := traceconfig.New() - require.NotZero(t, cfg.ReceiverPort) - - out := make(chan *pb.StatsPayload) - _, metricClient, timingReporter := setupMetricClient() - agnt := NewAgentWithConfig(context.Background(), cfg, out, metricClient, timingReporter) - require.Zero(t, cfg.ReceiverPort) - require.NotEmpty(t, cfg.Endpoints[0].APIKey) - require.Equal(t, "__unset__", cfg.Hostname) - require.Equal(t, out, agnt.Concentrator.Out) -} - -func TestTraceAgent(t *testing.T) { - cfg := traceconfig.New() - attributesTranslator, err := attributes.NewTranslator(componenttest.NewNopTelemetrySettings()) - require.NoError(t, err) - cfg.OTLPReceiver.AttributesTranslator = attributesTranslator - cfg.BucketInterval = 50 * time.Millisecond - out := make(chan *pb.StatsPayload, 10) - ctx := context.Background() - _, metricClient, timingReporter := setupMetricClient() - a := NewAgentWithConfig(ctx, cfg, out, metricClient, timingReporter) - a.Start() - defer a.Stop() - - traces := testutil.NewOTLPTracesRequest([]testutil.OTLPResourceSpan{ - { - LibName: "libname", - LibVersion: "1.2", - Attributes: map[string]any{}, - Spans: []*testutil.OTLPSpan{ - {Name: "1"}, - {Name: "2"}, - {Name: "3"}, - }, - }, - { - LibName: "other-libname", - LibVersion: "2.1", - Attributes: map[string]any{}, - Spans: []*testutil.OTLPSpan{ - {Name: "4", TraceID: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, - {Name: "5", TraceID: [16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}}, - }, - }, - }).Traces() - - a.Ingest(ctx, traces) - var stats *pb.StatsPayload - timeout := time.After(500 * time.Millisecond) -loop: - for { - select { - case stats = <-out: - if len(stats.Stats) != 0 { - break loop - } - case <-timeout: - t.Fatal("timed out") - } - } - require.Len(t, stats.Stats, 1) - require.Len(t, stats.Stats[0].Stats, 1) - // considering all spans in rspans have distinct aggregations, we should have an equal amount - // of groups - require.Len(t, stats.Stats[0].Stats[0].Stats, traces.SpanCount()) - require.Len(t, a.TraceWriter.In, 0) // the trace writer channel should've been drained -} diff --git a/internal/datadog/go.mod b/internal/datadog/go.mod deleted file mode 100644 index c21a74ce930e..000000000000 --- a/internal/datadog/go.mod +++ /dev/null @@ -1,93 +0,0 @@ -module github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog - -go 1.21.0 - -require ( - github.com/DataDog/datadog-agent/pkg/proto v0.54.0-rc.5 - github.com/DataDog/datadog-agent/pkg/trace v0.54.0-rc.5 - github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.16.1 - github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.101.1-0.20240527192838-af4fdd4e342a - go.opentelemetry.io/collector/pdata v1.8.1-0.20240527192838-af4fdd4e342a - go.opentelemetry.io/otel v1.27.0 - go.opentelemetry.io/otel/metric v1.27.0 - go.opentelemetry.io/otel/sdk/metric v1.27.0 -) - -require ( - github.com/DataDog/datadog-agent/pkg/obfuscate v0.54.0-rc.5 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.54.0-rc.5 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.54.0-rc.5 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.54.0-rc.5 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.54.0-rc.5 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.54.0-rc.5 // indirect - github.com/DataDog/go-sqllexer v0.0.9 // indirect - github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect - github.com/DataDog/sketches-go v1.4.4 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect - github.com/containerd/cgroups/v3 v3.0.2 // indirect - github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect - github.com/godbus/dbus/v5 v5.0.6 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/karrick/godirwalk v1.17.0 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/opencontainers/runtime-spec v1.1.0-rc.3 // indirect - github.com/outcaste-io/ristretto v0.2.1 // indirect - github.com/philhofer/fwd v1.1.2 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/prometheus/client_golang v1.19.1 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.53.0 // indirect - github.com/prometheus/procfs v0.15.0 // indirect - github.com/secure-systems-lab/go-securesystemslib v0.7.0 // indirect - github.com/shirou/gopsutil/v3 v3.24.2 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/tinylib/msgp v1.1.9 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect - github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.101.1-0.20240527192838-af4fdd4e342a // indirect - go.opentelemetry.io/collector/confmap v0.101.1-0.20240527192838-af4fdd4e342a // indirect - go.opentelemetry.io/collector/semconv v0.101.1-0.20240527192838-af4fdd4e342a // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.uber.org/atomic v1.11.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.16.1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/internal/datadog/go.sum b/internal/datadog/go.sum deleted file mode 100644 index 82353b9422e6..000000000000 --- a/internal/datadog/go.sum +++ /dev/null @@ -1,290 +0,0 @@ -github.com/DataDog/datadog-agent/pkg/obfuscate v0.54.0-rc.5 h1:qZg/3r8lLIgwzpHkqNBdnDKCdHexSxjgkb6FbPBaMnY= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.54.0-rc.5/go.mod h1:4/9D8y6pQo5a/Tg8GAQN8SaRIRWxxyl5QHzPRuu8D0k= -github.com/DataDog/datadog-agent/pkg/proto v0.54.0-rc.5 h1:0HdqgTFchLs6ElI9cVrfjsT/gOF8A7PiY/VI2JMDFJc= -github.com/DataDog/datadog-agent/pkg/proto v0.54.0-rc.5/go.mod h1:gHkSUTn6H6UEZQHY3XWBIGNjfI3Tdi0IxlrxIFBWDwU= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.54.0-rc.5 h1:wM6w1HtUOxrn/sgMW00jx+0p4rNzPv+NhPqmIpboyV0= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.54.0-rc.5/go.mod h1:3yFk56PJ57yS1GqI9HAsS4PSlAeGCC9RQA7jxKzYj6g= -github.com/DataDog/datadog-agent/pkg/trace v0.54.0-rc.5 h1:il5yFFe5CubI+bSfHolKr0077dQw0R+U5B9/iwW8aBg= -github.com/DataDog/datadog-agent/pkg/trace v0.54.0-rc.5/go.mod h1:63uSQX6TVeJzl1cFbIp8MkXlF4kUMJs8iUfGhrSgUHY= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.54.0-rc.5 h1:z5NnMMxKxO+cExUt0QCCSF7E+wX8LdD3nuL9LlDpR3Y= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.54.0-rc.5/go.mod h1:40rjMMqmvglVjktjWVUIk3o5W2zAtek0JU4FCsf7bsM= -github.com/DataDog/datadog-agent/pkg/util/log v0.54.0-rc.5 h1:BcA7+MK04/HRCFlX5Pn/sQzZu/gF4qA3DOF880Jy/oo= -github.com/DataDog/datadog-agent/pkg/util/log v0.54.0-rc.5/go.mod h1:MFVWM0DMaxEXhCnHLWnh6axtwubmKRn7C+w2xiL+atI= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.54.0-rc.5 h1:3zfbAoA9HSCJ/RsR/kP2MzntIvoI4szoReu4j3gpJrY= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.54.0-rc.5/go.mod h1:ahpEhdpkifOLy0/XLHas+SseEmMQnwMgV1CMVkSuXL0= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.54.0-rc.5 h1:Sob3M0CylnKxZ9FX8Ewjka5VRFYZUQLN2J0kyOGYnMM= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.54.0-rc.5/go.mod h1:8ASCNWHQtcmUedxL+WjbCPSIcGIM8LeVzil7JCzx0js= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= -github.com/DataDog/go-sqllexer v0.0.9 h1:Cx2Cu1S0hfj4coCCA8hzjM9+UNFRkcu1avIV//RU5Qw= -github.com/DataDog/go-sqllexer v0.0.9/go.mod h1:nB4Ea2YNsqMwtbWMc4Fm/oP98IIrSPapqwOwPioMspY= -github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= -github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.16.1 h1:ZI8u3CgdMXpDplrf9/gIr13+/g/tUzUcBMk2ZhXgzLE= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.16.1/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= -github.com/DataDog/sketches-go v1.4.4/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= -github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= -github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -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-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -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/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -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/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.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/karrick/godirwalk v1.17.0 h1:b4kY7nqDdioR/6qnbHQyDvmA17u5G1cZ6J+CZXwSWoI= -github.com/karrick/godirwalk v1.17.0/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= -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/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= -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/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.97.0 h1:iyn/KzvMIptpgsKnxgoafowjucQTgJBHz0vTKAEzvsM= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.97.0/go.mod h1:KBgW44WUf3iGvJCp1d0B6qT5ldKgKEITDo+gry/OuPw= -github.com/opencontainers/runtime-spec v1.1.0-rc.3 h1:l04uafi6kxByhbxev7OWiuUv0LZxEsYUfDWZ6bztAuU= -github.com/opencontainers/runtime-spec v1.1.0-rc.3/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/outcaste-io/ristretto v0.2.1 h1:KCItuNIGJZcursqHr3ghO7fc5ddZLEHspL9UR0cQM64= -github.com/outcaste-io/ristretto v0.2.1/go.mod h1:W8HywhmtlopSB1jeMg3JtdIhf+DYkLAr0VN/s4+MHac= -github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= -github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= -github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= -github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= -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/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg= -github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI= -github.com/shirou/gopsutil/v3 v3.24.2 h1:kcR0erMbLg5/3LcInpw0X/rrPSqq4CDPyI6A6ZRC18Y= -github.com/shirou/gopsutil/v3 v3.24.2/go.mod h1:tSg/594BcA+8UdQU2XcW803GWYgdtauFFPgJCJKZlVk= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= -github.com/tinylib/msgp v1.1.9/go.mod h1:BCXGB54lDD8qUEPmiG0cQQUANC4IUQyB2ItS2UDlO/k= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= -github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.97.0 h1:qyOju13byHIKEK/JehmTiGMj4pFLa4kDyrOCtTmjHU0= -go.opentelemetry.io/collector v0.97.0/go.mod h1:V6xquYAaO2VHVu4DBK28JYuikRdZajh7DH5Vl/Y8NiA= -go.opentelemetry.io/collector/component v0.101.1-0.20240527192838-af4fdd4e342a h1:8qOFfwhDNRcAobYZEy6VJ0EFzV8Rbn0jUR7DwYXS0T4= -go.opentelemetry.io/collector/component v0.101.1-0.20240527192838-af4fdd4e342a/go.mod h1:WBWJoYh8Js5S8e+0twmQxSF/uqR1HHkDb3YNKzgKaWY= -go.opentelemetry.io/collector/config/configtelemetry v0.101.1-0.20240527192838-af4fdd4e342a h1:EsbDY0mcCilr3LkM7XK5xRuOOZxn2qE6IdECWZ5xeFo= -go.opentelemetry.io/collector/config/configtelemetry v0.101.1-0.20240527192838-af4fdd4e342a/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/confmap v0.101.1-0.20240527192838-af4fdd4e342a h1:rBVMMiax68gRFxZFA3pP6ZtCJoV6o+sqj/QUVApjbIA= -go.opentelemetry.io/collector/confmap v0.101.1-0.20240527192838-af4fdd4e342a/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= -go.opentelemetry.io/collector/consumer v0.97.0 h1:S0BZQtJQxSHT156S8a5rLt3TeWYP8Rq+jn8QEyWQUYk= -go.opentelemetry.io/collector/consumer v0.97.0/go.mod h1:1D06LURiZ/1KA2OnuKNeSn9bvFmJ5ZWe6L8kLu0osSY= -go.opentelemetry.io/collector/pdata v1.8.1-0.20240527192838-af4fdd4e342a h1:ODREkUcnSXEoJz7QzPbnDlVcQQ0qnxSyAgiRciSXWbU= -go.opentelemetry.io/collector/pdata v1.8.1-0.20240527192838-af4fdd4e342a/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w= -go.opentelemetry.io/collector/processor v0.97.0 h1:L3R5R7x56LH2inF3sv0ZOsFfulVo8yuIFhO/OgpkCU0= -go.opentelemetry.io/collector/processor v0.97.0/go.mod h1:OsxBAPQ2fDytAn+yWLdEQ1yjYfl/OIak1AfKGfI8ALs= -go.opentelemetry.io/collector/semconv v0.101.1-0.20240527192838-af4fdd4e342a h1:6ZhX+c07YiQKr6Z+lbUJE/LoCtr6RzeJNoKxz/j0kEw= -go.opentelemetry.io/collector/semconv v0.101.1-0.20240527192838-af4fdd4e342a/go.mod h1:Egag6eTQ2oHrDRssbZTCOlU3NnVdKVtbLpeWQrBRXt8= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= -go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -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.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/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.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.25.5 h1:SQomYHvv+aO43qdu3QKRf9YuI0oI8w3RrOQ1qPbAUGY= -k8s.io/apimachinery v0.25.5/go.mod h1:1S2i1QHkmxc8+EZCIxe/fX5hpldVXk4gvnJInMEb8D4= diff --git a/internal/datadog/metadata.yaml b/internal/datadog/metadata.yaml deleted file mode 100644 index 27c4ee13b9e9..000000000000 --- a/internal/datadog/metadata.yaml +++ /dev/null @@ -1,4 +0,0 @@ -status: - codeowners: - active: [mx-psi, dineshg13] - emeritus: [gbbr] diff --git a/internal/datadog/metrics_client.go b/internal/datadog/metrics_client.go deleted file mode 100644 index 025001ce9036..000000000000 --- a/internal/datadog/metrics_client.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package datadog // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog" - -import ( - "context" - "strings" - "sync" - "time" - - "github.com/DataDog/datadog-go/v5/statsd" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/metric" -) - -const ( - ExporterSourceTag = "datadogexporter" - ConnectorSourceTag = "datadogconnector" -) - -type metricsClient struct { - meter metric.Meter - gauges map[string]float64 - mutex sync.Mutex - source string -} - -// InitializeMetricClient using a meter provider. -func InitializeMetricClient(mp metric.MeterProvider, source string) statsd.ClientInterface { - return &metricsClient{ - meter: mp.Meter("datadog"), - gauges: make(map[string]float64), - source: source, - } -} - -func (m *metricsClient) Gauge(name string, value float64, tags []string, _ float64) error { - // The last parameter is rate, but we're omitting it because rate does not have effect for gauge points: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/dedd44436ae064f5a0b43769d24adf897533957b/receiver/statsdreceiver/internal/protocol/metric_translator.go#L153-L156 - m.mutex.Lock() - defer m.mutex.Unlock() - if _, ok := m.gauges[name]; ok { - m.gauges[name] = value - return nil - } - m.gauges[name] = value - _, err := m.meter.Float64ObservableGauge(name, metric.WithFloat64Callback(func(_ context.Context, f metric.Float64Observer) error { - attr := m.attributeFromTags(tags) - m.mutex.Lock() - defer m.mutex.Unlock() - if v, ok := m.gauges[name]; ok { - f.Observe(v, metric.WithAttributeSet(attr)) - } - return nil - })) - if err != nil { - return err - } - return nil -} - -func (m *metricsClient) Count(name string, value int64, tags []string, _ float64) error { - counter, err := m.meter.Int64Counter(name) - if err != nil { - return err - } - attr := m.attributeFromTags(tags) - counter.Add(context.Background(), value, metric.WithAttributeSet(attr)) - return nil -} - -func (m *metricsClient) attributeFromTags(tags []string) attribute.Set { - attr := make([]attribute.KeyValue, 0, len(tags)+1) - attr = append(attr, attribute.KeyValue{ - Key: "source", - Value: attribute.StringValue(m.source), - }) - for _, t := range tags { - kv := strings.Split(t, ":") - attr = append(attr, attribute.KeyValue{ - Key: attribute.Key(kv[0]), - Value: attribute.StringValue(kv[1]), - }) - } - return attribute.NewSet(attr...) -} - -func (m *metricsClient) Histogram(name string, value float64, tags []string, _ float64) error { - hist, err := m.meter.Float64Histogram(name) - if err != nil { - return err - } - attr := m.attributeFromTags(tags) - hist.Record(context.Background(), value, metric.WithAttributeSet(attr)) - return nil -} - -func (m *metricsClient) Distribution(name string, value float64, tags []string, rate float64) error { - return m.Histogram(name, value, tags, rate) -} - -func (m *metricsClient) Timing(name string, value time.Duration, tags []string, rate float64) error { - return m.TimeInMilliseconds(name, value.Seconds()*1000, tags, rate) -} - -func (m *metricsClient) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error { - return m.Histogram(name, value, tags, rate) -} - -func (m *metricsClient) Decr(name string, tags []string, rate float64) error { - return m.Count(name, -1, tags, rate) -} - -func (m *metricsClient) Incr(name string, tags []string, rate float64) error { - return m.Count(name, 1, tags, rate) -} - -func (m *metricsClient) Flush() error { - return nil -} - -func (m *metricsClient) Set(string, string, []string, float64) error { - return nil -} - -func (m *metricsClient) Event(*statsd.Event) error { - return nil -} - -func (m *metricsClient) SimpleEvent(string, string) error { - return nil -} - -func (m *metricsClient) ServiceCheck(*statsd.ServiceCheck) error { - return nil -} - -func (m *metricsClient) SimpleServiceCheck(string, statsd.ServiceCheckStatus) error { - return nil -} - -func (m *metricsClient) Close() error { - return nil -} - -func (m *metricsClient) IsClosed() bool { - return false -} - -func (m *metricsClient) GetTelemetry() statsd.Telemetry { - return statsd.Telemetry{} -} - -func (m *metricsClient) GaugeWithTimestamp(string, float64, []string, float64, time.Time) error { - return nil -} - -func (m *metricsClient) CountWithTimestamp(string, int64, []string, float64, time.Time) error { - return nil -} diff --git a/internal/datadog/metrics_client_test.go b/internal/datadog/metrics_client_test.go deleted file mode 100644 index 3165d4f53960..000000000000 --- a/internal/datadog/metrics_client_test.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 -package datadog - -import ( - "context" - "sync" - "testing" - "time" - - "github.com/DataDog/datadog-agent/pkg/trace/timing" - "github.com/DataDog/datadog-go/v5/statsd" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/metricdata" - "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest" -) - -func setupMetricClient() (*metric.ManualReader, statsd.ClientInterface, timing.Reporter) { - reader := metric.NewManualReader() - meterProvider := metric.NewMeterProvider(metric.WithReader(reader)) - metricClient := InitializeMetricClient(meterProvider, ExporterSourceTag) - timingReporter := timing.New(metricClient) - return reader, metricClient, timingReporter -} - -func TestGauge(t *testing.T) { - reader, metricClient, _ := setupMetricClient() - - err := metricClient.Gauge("test_gauge", 1, []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - rm := metricdata.ResourceMetrics{} - assert.NoError(t, reader.Collect(context.Background(), &rm)) - require.Len(t, rm.ScopeMetrics, 1) - sm := rm.ScopeMetrics[0] - require.Len(t, sm.Metrics, 1) - got := sm.Metrics[0] - want := metricdata.Metrics{ - Name: "test_gauge", - Data: metricdata.Gauge[float64]{ - DataPoints: []metricdata.DataPoint[float64]{ - {Value: 1, Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("service", "otelcol"), attribute.String("source", ExporterSourceTag))}, - }, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) -} - -func TestGaugeMultiple(t *testing.T) { - reader, metricClient, _ := setupMetricClient() - - err := metricClient.Gauge("test_gauge", 1, []string{"otlp:true"}, 1) - assert.NoError(t, err) - err = metricClient.Gauge("test_gauge", 2, []string{"otlp:true"}, 1) - assert.NoError(t, err) - - rm := metricdata.ResourceMetrics{} - assert.NoError(t, reader.Collect(context.Background(), &rm)) - require.Len(t, rm.ScopeMetrics, 1) - sm := rm.ScopeMetrics[0] - require.Len(t, sm.Metrics, 1) - got := sm.Metrics[0] - want := metricdata.Metrics{ - Name: "test_gauge", - Data: metricdata.Gauge[float64]{ - DataPoints: []metricdata.DataPoint[float64]{ - {Value: 2, Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("source", ExporterSourceTag))}, - }, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) -} - -func TestGaugeDataRace(t *testing.T) { - reader, metricClient, _ := setupMetricClient() - var wg sync.WaitGroup - wg.Add(2) - - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - - go func() { - defer wg.Done() - for { - select { - case <-ctx.Done(): - return - default: - err := metricClient.Gauge("test_gauge", 1, []string{"otlp:true"}, 1) - assert.NoError(t, err) - } - } - }() - - go func() { - defer wg.Done() - for { - select { - case <-ctx.Done(): - return - default: - err := reader.Collect(context.Background(), &metricdata.ResourceMetrics{}) - assert.NoError(t, err) - } - } - }() - - wg.Wait() -} - -func TestCount(t *testing.T) { - reader, metricClient, _ := setupMetricClient() - - err := metricClient.Count("test_count", 1, []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - rm := metricdata.ResourceMetrics{} - assert.NoError(t, reader.Collect(context.Background(), &rm)) - require.Len(t, rm.ScopeMetrics, 1) - sm := rm.ScopeMetrics[0] - require.Len(t, sm.Metrics, 1) - got := sm.Metrics[0] - want := metricdata.Metrics{ - Name: "test_count", - Data: metricdata.Sum[int64]{ - Temporality: metricdata.CumulativeTemporality, - IsMonotonic: true, - DataPoints: []metricdata.DataPoint[int64]{ - {Value: 1, Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("service", "otelcol"), attribute.String("source", ExporterSourceTag))}, - }, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) - - err = metricClient.Count("test_count", 2, []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - err = metricClient.Count("test_count", 3, []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - err = metricClient.Count("test_count2", 3, []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - assert.NoError(t, reader.Collect(context.Background(), &rm)) - require.Len(t, rm.ScopeMetrics, 1) - sm = rm.ScopeMetrics[0] - require.Len(t, sm.Metrics, 2) - got = sm.Metrics[0] - want = metricdata.Metrics{ - Name: "test_count", - Data: metricdata.Sum[int64]{ - Temporality: metricdata.CumulativeTemporality, - IsMonotonic: true, - DataPoints: []metricdata.DataPoint[int64]{ - {Value: 6, Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("service", "otelcol"), attribute.String("source", ExporterSourceTag))}, - }, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) - - got = sm.Metrics[1] - want = metricdata.Metrics{ - Name: "test_count2", - Data: metricdata.Sum[int64]{ - Temporality: metricdata.CumulativeTemporality, - IsMonotonic: true, - DataPoints: []metricdata.DataPoint[int64]{ - {Value: 3, Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("service", "otelcol"), attribute.String("source", ExporterSourceTag))}, - }, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) -} - -func TestHistogram(t *testing.T) { - reader, metricClient, _ := setupMetricClient() - - err := metricClient.Histogram("test_histogram", 1, []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - rm := metricdata.ResourceMetrics{} - assert.NoError(t, reader.Collect(context.Background(), &rm)) - require.Len(t, rm.ScopeMetrics, 1) - sm := rm.ScopeMetrics[0] - require.Len(t, sm.Metrics, 1) - got := sm.Metrics[0] - want := metricdata.Metrics{ - Name: "test_histogram", - Data: metricdata.Histogram[float64]{ - Temporality: metricdata.CumulativeTemporality, - DataPoints: []metricdata.HistogramDataPoint[float64]{{ - Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("service", "otelcol"), attribute.String("source", ExporterSourceTag)), - Bounds: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000}, - BucketCounts: []uint64{0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - Count: 1, - Min: metricdata.NewExtrema(1.0), - Max: metricdata.NewExtrema(1.0), - Sum: 1, - }}, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) -} - -func TestTiming(t *testing.T) { - reader, metricClient, _ := setupMetricClient() - - err := metricClient.Timing("test_timing", time.Duration(1000000000), []string{"otlp:true", "service:otelcol"}, 1) - assert.NoError(t, err) - rm := metricdata.ResourceMetrics{} - assert.NoError(t, reader.Collect(context.Background(), &rm)) - require.Len(t, rm.ScopeMetrics, 1) - sm := rm.ScopeMetrics[0] - require.Len(t, sm.Metrics, 1) - got := sm.Metrics[0] - want := metricdata.Metrics{ - Name: "test_timing", - Data: metricdata.Histogram[float64]{ - Temporality: metricdata.CumulativeTemporality, - DataPoints: []metricdata.HistogramDataPoint[float64]{{ - Attributes: attribute.NewSet(attribute.String("otlp", "true"), attribute.String("service", "otelcol"), attribute.String("source", ExporterSourceTag)), - Bounds: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000}, - BucketCounts: []uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, - Count: 1, - Min: metricdata.NewExtrema(1000.0), - Max: metricdata.NewExtrema(1000.0), - Sum: 1000, - }}, - }, - } - metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) -} diff --git a/versions.yaml b/versions.yaml index 3d5572ba64a7..64068305aae4 100644 --- a/versions.yaml +++ b/versions.yaml @@ -131,7 +131,6 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent - github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sqlquery - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata