From 9d091f3c500c157413c64c3d739fe650a8141098 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 5 Sep 2024 14:56:06 -0400 Subject: [PATCH 01/47] New tests --- .../tests/otel/{ => otel-agent}/collector.yml | 10 +- .../tests/otel/otel-agent/pipelines_test.go | 349 ++++++++++++++++++ test/new-e2e/tests/otel/otel_test.go | 201 ---------- 3 files changed, 358 insertions(+), 202 deletions(-) rename test/new-e2e/tests/otel/{ => otel-agent}/collector.yml (81%) create mode 100644 test/new-e2e/tests/otel/otel-agent/pipelines_test.go delete mode 100644 test/new-e2e/tests/otel/otel_test.go diff --git a/test/new-e2e/tests/otel/collector.yml b/test/new-e2e/tests/otel/otel-agent/collector.yml similarity index 81% rename from test/new-e2e/tests/otel/collector.yml rename to test/new-e2e/tests/otel/otel-agent/collector.yml index 11902ac93aec8..df99ae63b55b1 100644 --- a/test/new-e2e/tests/otel/collector.yml +++ b/test/new-e2e/tests/otel/otel-agent/collector.yml @@ -9,9 +9,13 @@ exporters: datadog: traces: span_name_as_resource_name: true + metrics: + resource_attributes_as_tags: true hostname: "otelcol-docker" api: key: ${DD_API_KEY} + debug: + verbosity: detailed processors: batch: connectors: @@ -20,8 +24,12 @@ connectors: traces: span_name_as_resource_name: true compute_stats_by_span_kind: true + compute_top_level_by_span_kind: true peer_tags_aggregation: true service: + telemetry: + logs: + level: debug pipelines: traces: receivers: [otlp] @@ -38,4 +46,4 @@ service: logs: receivers: [otlp] processors: [batch] - exporters: [datadog] + exporters: [datadog, debug] diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go b/test/new-e2e/tests/otel/otel-agent/pipelines_test.go new file mode 100644 index 0000000000000..d082c57c226d6 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/pipelines_test.go @@ -0,0 +1,349 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + "context" + _ "embed" + "fmt" + "strings" + "testing" + "time" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + + "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" + "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" + fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" +) + +const ( + service = "telemetrygen-job" + env = "e2e" + version = "1.0" + customAttribute = "custom.attribute" + customAttributeValue = "true" +) + +type linuxTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed collector.yml +var collectorConfig string + +func TestOTel(t *testing.T) { + e2e.Run(t, &linuxTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(collectorConfig))))) +} + +func (s *linuxTestSuite) TestOTelAgentInstalled() { + agent := s.getAgentPod() + assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") +} + +func (s *linuxTestSuite) TestOTLPTraces() { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + numTraces := 10 + + s.T().Log("Starting telemetrygen") + s.createTelemetrygenJob(ctx, "traces", []string{"--traces", fmt.Sprint(numTraces)}) + + var traces []*aggregator.TracePayload + var err error + s.T().Log("Waiting for traces") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + traces, err = s.Env().FakeIntake.Client().GetTraces() + assert.NoError(c, err) + assert.NotEmpty(c, traces) + }, 2*time.Minute, 10*time.Second) + require.NotEmpty(s.T(), traces) + s.T().Log("Got traces", traces) + trace := traces[0] + require.NotEmpty(s.T(), trace.TracerPayloads) + + // Verify tags on traces and spans + tp := trace.TracerPayloads[0] + ctags, ok := getContainerTags(s.T(), tp) + require.True(s.T(), ok) + assert.Equal(s.T(), env, tp.Env) + assert.Equal(s.T(), version, tp.AppVersion) + require.NotEmpty(s.T(), tp.Chunks) + require.NotEmpty(s.T(), tp.Chunks[0].Spans) + spans := tp.Chunks[0].Spans + for _, sp := range spans { + assert.Equal(s.T(), service, sp.Service) + assert.Equal(s.T(), env, sp.Meta["env"]) + assert.Equal(s.T(), version, sp.Meta["version"]) + assert.Equal(s.T(), customAttributeValue, sp.Meta[customAttribute]) + assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) + assert.Equal(s.T(), sp.Meta["k8s.node.name"], tp.Hostname) + s.T().Log("k8s.node.name", sp.Meta["k8s.node.name"]) + s.T().Log("tp.Hostname", tp.Hostname) + + // Verify container tags from infraattributes processor + assert.NotNil(s.T(), ctags["kube_container_name"]) + assert.NotNil(s.T(), ctags["kube_namespace"]) + assert.NotNil(s.T(), ctags["pod_name"]) + assert.Equal(s.T(), sp.Meta["k8s.container.name"], ctags["kube_container_name"]) + assert.Equal(s.T(), sp.Meta["k8s.namespace.name"], ctags["kube_namespace"]) + assert.Equal(s.T(), sp.Meta["k8s.pod.name"], ctags["pod_name"]) + } + + s.T().Log("Waiting for APM stats") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + stats, err := s.Env().FakeIntake.Client().GetAPMStats() + assert.NoError(c, err) + assert.NotEmpty(c, stats) + s.T().Log("Got APM stats", stats) + hasStatsForService := false + for _, payload := range stats { + for _, csp := range payload.StatsPayload.Stats { + for _, bucket := range csp.Stats { + for _, cgs := range bucket.Stats { + if cgs.Service == service { + hasStatsForService = true + assert.EqualValues(c, cgs.Hits, numTraces) + assert.EqualValues(c, cgs.TopLevelHits, numTraces) + } + } + } + } + } + assert.True(c, hasStatsForService) + }, 2*time.Minute, 10*time.Second) +} + +func (s *linuxTestSuite) TestOTLPMetrics() { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + numMetrics := 10 + + s.T().Log("Starting telemetrygen") + s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) + + var metrics []*aggregator.MetricSeries + var err error + s.T().Log("Waiting for metrics") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) + assert.NoError(c, err) + assert.NotEmpty(c, metrics) + s.T().Log("Got metrics", metrics) + }, 2*time.Minute, 10*time.Second) + + for _, metricSeries := range metrics { + tags := getTagMapFromSlice(s.T(), metricSeries.Tags) + assert.Equal(s.T(), service, tags["service"]) + assert.Equal(s.T(), env, tags["env"]) + assert.Equal(s.T(), version, tags["version"]) + assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) + + // Verify container tags from infraattributes processor + assert.NotNil(s.T(), tags["kube_container_name"]) + assert.NotNil(s.T(), tags["kube_namespace"]) + assert.NotNil(s.T(), tags["pod_name"]) + assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) + assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) + assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) + + hasHostResource := false + for _, resource := range metricSeries.Resources { + if resource.Type == "host" { + assert.Equal(s.T(), tags["k8s.node.name"], resource.Name) + s.T().Log("k8s.node.name", tags["k8s.node.name"]) + s.T().Log("resource.Name", resource.Name) + hasHostResource = true + } + } + assert.True(s.T(), hasHostResource) + } +} + +func (s *linuxTestSuite) TestOTLPLogs() { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + numLogs := 10 + logBody := "telemetrygen log" + + s.T().Log("Starting telemetrygen") + ddtags := fmt.Sprintf("ddtags=\"k8s.namespace.name:$(OTEL_K8S_NAMESPACE),k8s.node.name:$(OTEL_K8S_NODE_NAME),k8s.pod.name:$(OTEL_K8S_POD_NAME),k8s.container.name:telemetrygen-job,%v:%v\"", customAttribute, customAttributeValue) + s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) + + var logs []*aggregator.Log + var err error + s.T().Log("Waiting for logs") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) + assert.NoError(c, err) + assert.NotEmpty(c, logs) + }, 2*time.Minute, 10*time.Second) + + require.NotEmpty(s.T(), logs) + for _, log := range logs { + assert.Contains(s.T(), log.Message, logBody) + s.T().Log("log.Tags", log.Tags) + tags := getTagMapFromSlice(s.T(), log.Tags) + s.T().Log("tags", tags) + assert.Equal(s.T(), service, tags["service"]) + assert.Equal(s.T(), env, tags["env"]) + assert.Equal(s.T(), version, tags["version"]) + assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) + assert.Equal(s.T(), tags["k8s.node.name"], log.HostName) + s.T().Log("k8s.node.name", tags["k8s.node.name"]) + s.T().Log("log.HostName", log.HostName) + + // Verify container tags from infraattributes processor + assert.NotNil(s.T(), tags["kube_container_name"]) + assert.NotNil(s.T(), tags["kube_namespace"]) + assert.NotNil(s.T(), tags["pod_name"]) + assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) + assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) + assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) + s.T().Log("source", log.Source) + s.T().Log("status", log.Status) + } + + time.Sleep(30 * time.Second) +} + +func (s *linuxTestSuite) TestOTelFlare() { + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + + s.T().Log("Starting flare") + agent := s.getAgentPod() + stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) + require.NoError(s.T(), err, "Failed to execute flare") + require.Empty(s.T(), stderr) + require.NotNil(s.T(), stdout) + + s.T().Log("Getting latest flare") + flare, err := s.Env().FakeIntake.Client().GetLatestFlare() + require.NoError(s.T(), err, "Failed to get latest flare") + otelFolder, otelFlareFolder := false, false + var otelResponse string + for _, filename := range flare.GetFilenames() { + if strings.Contains(filename, "/otel/") { + otelFolder = true + } + if strings.Contains(filename, "/otel/otel-flare/") { + otelFlareFolder = true + } + if strings.Contains(filename, "otel/otel-response.json") { + otelResponse = filename + } + } + assert.True(s.T(), otelFolder) + assert.True(s.T(), otelFlareFolder) + otelResponseContent, err := flare.GetFileContent(otelResponse) + require.NoError(s.T(), err) + expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} + for _, expected := range expectedContents { + assert.Contains(s.T(), otelResponseContent, expected) + } +} + +func (s *linuxTestSuite) getAgentPod() corev1.Pod { + res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), + }) + require.NoError(s.T(), err) + require.NotEmpty(s.T(), res.Items) + return res.Items[0] +} + +func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry string, options []string) { + var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 + var backOffLimit int32 = 4 + + otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) + jobSpec := &batchv1.Job{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("telemetrygen-job-%v", telemetry), + Namespace: "datadog", + }, + Spec: batchv1.JobSpec{ + TTLSecondsAfterFinished: &ttlSecondsAfterFinished, + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Env: []corev1.EnvVar{{ + Name: "OTEL_SERVICE_NAME", + Value: service, + }, { + Name: "OTEL_K8S_NAMESPACE", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, + }, { + Name: "OTEL_K8S_NODE_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, + }, { + Name: "OTEL_K8S_POD_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }}, + Name: "telemetrygen-job", + Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.107.0", + Command: append([]string{ + "/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure", + "--telemetry-attributes", fmt.Sprintf("%v=%v", customAttribute, customAttributeValue), + "--otlp-attributes", "service.name=\"$(OTEL_SERVICE_NAME)\"", + "--otlp-attributes", "host.name=\"$(OTEL_K8S_NODE_NAME)\"", + "--otlp-attributes", fmt.Sprintf("deployment.environment=\"%v\"", env), + "--otlp-attributes", fmt.Sprintf("service.version=\"%v\"", version), + "--otlp-attributes", "k8s.namespace.name=\"$(OTEL_K8S_NAMESPACE)\"", + "--otlp-attributes", "k8s.node.name=\"$(OTEL_K8S_NODE_NAME)\"", + "--otlp-attributes", "k8s.pod.name=\"$(OTEL_K8S_POD_NAME)\"", + "--otlp-attributes", "k8s.container.name=\"telemetrygen-job\"", + }, options...), + }, + }, + RestartPolicy: corev1.RestartPolicyNever, + }, + }, + BackoffLimit: &backOffLimit, + }, + } + + _, err := s.Env().KubernetesCluster.Client().BatchV1().Jobs("datadog").Create(ctx, jobSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start job") +} + +func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { + ctags, ok := tp.Tags["_dd.tags.container"] + if !ok { + return nil, false + } + splits := strings.Split(ctags, ",") + m := make(map[string]string) + for _, s := range splits { + kv := strings.SplitN(s, ":", 2) + if !assert.Len(t, kv, 2, "malformed container tag: %v", s) { + continue + } + m[kv[0]] = kv[1] + } + return m, true +} + +func getTagMapFromSlice(t *testing.T, tagSlice []string) map[string]string { + m := make(map[string]string) + for _, s := range tagSlice { + kv := strings.SplitN(s, ":", 2) + require.Len(t, kv, 2, "malformed tag: %v", s) + m[kv[0]] = kv[1] + } + return m +} diff --git a/test/new-e2e/tests/otel/otel_test.go b/test/new-e2e/tests/otel/otel_test.go deleted file mode 100644 index d67c79aefcd90..0000000000000 --- a/test/new-e2e/tests/otel/otel_test.go +++ /dev/null @@ -1,201 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -// Package localkubernetes contains the provisioner for the local Kubernetes based environments - -package otel - -import ( - "context" - _ "embed" - "fmt" - "strings" - "testing" - "time" - - "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - - "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" - fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" -) - -type linuxTestSuite struct { - e2e.BaseSuite[environments.Kubernetes] -} - -//go:embed collector.yml -var collectorConfig string - -func TestOTel(t *testing.T) { - e2e.Run(t, &linuxTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(collectorConfig))))) -} - -func (s *linuxTestSuite) TestOTelAgentInstalled() { - agent := s.getAgentPod() - assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") -} - -func (s *linuxTestSuite) TestOTLPTraces() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - numTraces := 10 - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "traces", []string{"--service", service, "--traces", fmt.Sprint(numTraces)}) - - var traces []*aggregator.TracePayload - var err error - s.T().Log("Waiting for traces") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - traces, err = s.Env().FakeIntake.Client().GetTraces() - assert.NoError(c, err) - assert.NotEmpty(c, traces) - }, 2*time.Minute, 10*time.Second) - - require.NotEmpty(s.T(), traces) - trace := traces[0] - assert.Equal(s.T(), "none", trace.Env) - require.NotEmpty(s.T(), trace.TracerPayloads) - tp := trace.TracerPayloads[0] - require.NotEmpty(s.T(), tp.Chunks) - require.NotEmpty(s.T(), tp.Chunks[0].Spans) - spans := tp.Chunks[0].Spans - for _, sp := range spans { - assert.Equal(s.T(), service, sp.Service) - assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) - } -} - -func (s *linuxTestSuite) TestOTLPMetrics() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) - numMetrics := 10 - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics), "--otlp-attributes", serviceAttribute}) - - s.T().Log("Waiting for metrics") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - serviceTag := "service:" + service - metrics, err := s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{serviceTag})) - assert.NoError(c, err) - assert.NotEmpty(c, metrics) - }, 2*time.Minute, 10*time.Second) -} - -func (s *linuxTestSuite) TestOTLPLogs() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) - numLogs := 10 - logBody := "telemetrygen log" - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--otlp-attributes", serviceAttribute, "--body", logBody}) - - var logs []*aggregator.Log - var err error - s.T().Log("Waiting for logs") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - logs, err = s.Env().FakeIntake.Client().FilterLogs(service) - assert.NoError(c, err) - assert.NotEmpty(c, logs) - }, 2*time.Minute, 10*time.Second) - - require.NotEmpty(s.T(), logs) - for _, log := range logs { - assert.Contains(s.T(), log.Message, logBody) - } -} - -func (s *linuxTestSuite) TestOTelFlare() { - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - - s.T().Log("Starting flare") - agent := s.getAgentPod() - stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) - require.NoError(s.T(), err, "Failed to execute flare") - require.Empty(s.T(), stderr) - require.NotNil(s.T(), stdout) - - s.T().Log("Getting latest flare") - flare, err := s.Env().FakeIntake.Client().GetLatestFlare() - require.NoError(s.T(), err, "Failed to get latest flare") - otelFolder, otelFlareFolder := false, false - var otelResponse string - for _, filename := range flare.GetFilenames() { - if strings.Contains(filename, "/otel/") { - otelFolder = true - } - if strings.Contains(filename, "/otel/otel-flare/") { - otelFlareFolder = true - } - if strings.Contains(filename, "otel/otel-response.json") { - otelResponse = filename - } - } - assert.True(s.T(), otelFolder) - assert.True(s.T(), otelFlareFolder) - otelResponseContent, err := flare.GetFileContent(otelResponse) - require.NoError(s.T(), err) - expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} - for _, expected := range expectedContents { - assert.Contains(s.T(), otelResponseContent, expected) - } -} - -func (s *linuxTestSuite) getAgentPod() corev1.Pod { - res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), - }) - require.NoError(s.T(), err) - require.NotEmpty(s.T(), res.Items) - return res.Items[0] -} - -func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry string, options []string) { - var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 - var backOffLimit int32 = 4 - - otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) - jobSpec := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("telemetrygen-job-%v", telemetry), - Namespace: "datadog", - }, - Spec: batchv1.JobSpec{ - TTLSecondsAfterFinished: &ttlSecondsAfterFinished, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ - { - Name: "telemetrygen-job", - Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest", - Command: append([]string{"/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure"}, options...), - }, - }, - RestartPolicy: corev1.RestartPolicyNever, - }, - }, - BackoffLimit: &backOffLimit, - }, - } - - _, err := s.Env().KubernetesCluster.Client().BatchV1().Jobs("datadog").Create(ctx, jobSpec, metav1.CreateOptions{}) - require.NoError(s.T(), err, "Could not properly start job") -} From f9ad75e69dea3538858e66919cb042e8f0a66b3c Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 5 Sep 2024 14:56:14 -0400 Subject: [PATCH 02/47] Logs fix --- .../components/exporter/logsagentexporter/logs_exporter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go b/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go index 7bf6c54154f23..04f8eaeae152b 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go @@ -94,6 +94,9 @@ func (e *Exporter) ConsumeLogs(ctx context.Context, ld plog.Logs) (err error) { // ingestionTs is an internal field used for latency tracking on the status page, not the actual log timestamp. ingestionTs := time.Now().UnixNano() message := message.NewMessage(content, origin, status, ingestionTs) + if ddLog.Hostname != nil { + message.Hostname = *ddLog.Hostname + } e.logsAgentChannel <- message } From 3dd909c5a37494b493667cb3c9142381f88f385f Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 5 Sep 2024 14:57:58 -0400 Subject: [PATCH 03/47] Revert --- .../tests/otel/otel-agent/pipelines_test.go | 349 ------------------ test/new-e2e/tests/otel/otel_test.go | 201 ++++++++++ 2 files changed, 201 insertions(+), 349 deletions(-) delete mode 100644 test/new-e2e/tests/otel/otel-agent/pipelines_test.go create mode 100644 test/new-e2e/tests/otel/otel_test.go diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go b/test/new-e2e/tests/otel/otel-agent/pipelines_test.go deleted file mode 100644 index d082c57c226d6..0000000000000 --- a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go +++ /dev/null @@ -1,349 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -// Package otelagent contains e2e otel agent tests -package otelagent - -import ( - "context" - _ "embed" - "fmt" - "strings" - "testing" - "time" - - "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - - "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" - "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" - fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" -) - -const ( - service = "telemetrygen-job" - env = "e2e" - version = "1.0" - customAttribute = "custom.attribute" - customAttributeValue = "true" -) - -type linuxTestSuite struct { - e2e.BaseSuite[environments.Kubernetes] -} - -//go:embed collector.yml -var collectorConfig string - -func TestOTel(t *testing.T) { - e2e.Run(t, &linuxTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(collectorConfig))))) -} - -func (s *linuxTestSuite) TestOTelAgentInstalled() { - agent := s.getAgentPod() - assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") -} - -func (s *linuxTestSuite) TestOTLPTraces() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - numTraces := 10 - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "traces", []string{"--traces", fmt.Sprint(numTraces)}) - - var traces []*aggregator.TracePayload - var err error - s.T().Log("Waiting for traces") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - traces, err = s.Env().FakeIntake.Client().GetTraces() - assert.NoError(c, err) - assert.NotEmpty(c, traces) - }, 2*time.Minute, 10*time.Second) - require.NotEmpty(s.T(), traces) - s.T().Log("Got traces", traces) - trace := traces[0] - require.NotEmpty(s.T(), trace.TracerPayloads) - - // Verify tags on traces and spans - tp := trace.TracerPayloads[0] - ctags, ok := getContainerTags(s.T(), tp) - require.True(s.T(), ok) - assert.Equal(s.T(), env, tp.Env) - assert.Equal(s.T(), version, tp.AppVersion) - require.NotEmpty(s.T(), tp.Chunks) - require.NotEmpty(s.T(), tp.Chunks[0].Spans) - spans := tp.Chunks[0].Spans - for _, sp := range spans { - assert.Equal(s.T(), service, sp.Service) - assert.Equal(s.T(), env, sp.Meta["env"]) - assert.Equal(s.T(), version, sp.Meta["version"]) - assert.Equal(s.T(), customAttributeValue, sp.Meta[customAttribute]) - assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) - assert.Equal(s.T(), sp.Meta["k8s.node.name"], tp.Hostname) - s.T().Log("k8s.node.name", sp.Meta["k8s.node.name"]) - s.T().Log("tp.Hostname", tp.Hostname) - - // Verify container tags from infraattributes processor - assert.NotNil(s.T(), ctags["kube_container_name"]) - assert.NotNil(s.T(), ctags["kube_namespace"]) - assert.NotNil(s.T(), ctags["pod_name"]) - assert.Equal(s.T(), sp.Meta["k8s.container.name"], ctags["kube_container_name"]) - assert.Equal(s.T(), sp.Meta["k8s.namespace.name"], ctags["kube_namespace"]) - assert.Equal(s.T(), sp.Meta["k8s.pod.name"], ctags["pod_name"]) - } - - s.T().Log("Waiting for APM stats") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - stats, err := s.Env().FakeIntake.Client().GetAPMStats() - assert.NoError(c, err) - assert.NotEmpty(c, stats) - s.T().Log("Got APM stats", stats) - hasStatsForService := false - for _, payload := range stats { - for _, csp := range payload.StatsPayload.Stats { - for _, bucket := range csp.Stats { - for _, cgs := range bucket.Stats { - if cgs.Service == service { - hasStatsForService = true - assert.EqualValues(c, cgs.Hits, numTraces) - assert.EqualValues(c, cgs.TopLevelHits, numTraces) - } - } - } - } - } - assert.True(c, hasStatsForService) - }, 2*time.Minute, 10*time.Second) -} - -func (s *linuxTestSuite) TestOTLPMetrics() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - numMetrics := 10 - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) - - var metrics []*aggregator.MetricSeries - var err error - s.T().Log("Waiting for metrics") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) - assert.NoError(c, err) - assert.NotEmpty(c, metrics) - s.T().Log("Got metrics", metrics) - }, 2*time.Minute, 10*time.Second) - - for _, metricSeries := range metrics { - tags := getTagMapFromSlice(s.T(), metricSeries.Tags) - assert.Equal(s.T(), service, tags["service"]) - assert.Equal(s.T(), env, tags["env"]) - assert.Equal(s.T(), version, tags["version"]) - assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) - - // Verify container tags from infraattributes processor - assert.NotNil(s.T(), tags["kube_container_name"]) - assert.NotNil(s.T(), tags["kube_namespace"]) - assert.NotNil(s.T(), tags["pod_name"]) - assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) - assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) - assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) - - hasHostResource := false - for _, resource := range metricSeries.Resources { - if resource.Type == "host" { - assert.Equal(s.T(), tags["k8s.node.name"], resource.Name) - s.T().Log("k8s.node.name", tags["k8s.node.name"]) - s.T().Log("resource.Name", resource.Name) - hasHostResource = true - } - } - assert.True(s.T(), hasHostResource) - } -} - -func (s *linuxTestSuite) TestOTLPLogs() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - numLogs := 10 - logBody := "telemetrygen log" - - s.T().Log("Starting telemetrygen") - ddtags := fmt.Sprintf("ddtags=\"k8s.namespace.name:$(OTEL_K8S_NAMESPACE),k8s.node.name:$(OTEL_K8S_NODE_NAME),k8s.pod.name:$(OTEL_K8S_POD_NAME),k8s.container.name:telemetrygen-job,%v:%v\"", customAttribute, customAttributeValue) - s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) - - var logs []*aggregator.Log - var err error - s.T().Log("Waiting for logs") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) - assert.NoError(c, err) - assert.NotEmpty(c, logs) - }, 2*time.Minute, 10*time.Second) - - require.NotEmpty(s.T(), logs) - for _, log := range logs { - assert.Contains(s.T(), log.Message, logBody) - s.T().Log("log.Tags", log.Tags) - tags := getTagMapFromSlice(s.T(), log.Tags) - s.T().Log("tags", tags) - assert.Equal(s.T(), service, tags["service"]) - assert.Equal(s.T(), env, tags["env"]) - assert.Equal(s.T(), version, tags["version"]) - assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) - assert.Equal(s.T(), tags["k8s.node.name"], log.HostName) - s.T().Log("k8s.node.name", tags["k8s.node.name"]) - s.T().Log("log.HostName", log.HostName) - - // Verify container tags from infraattributes processor - assert.NotNil(s.T(), tags["kube_container_name"]) - assert.NotNil(s.T(), tags["kube_namespace"]) - assert.NotNil(s.T(), tags["pod_name"]) - assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) - assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) - assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) - s.T().Log("source", log.Source) - s.T().Log("status", log.Status) - } - - time.Sleep(30 * time.Second) -} - -func (s *linuxTestSuite) TestOTelFlare() { - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - - s.T().Log("Starting flare") - agent := s.getAgentPod() - stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) - require.NoError(s.T(), err, "Failed to execute flare") - require.Empty(s.T(), stderr) - require.NotNil(s.T(), stdout) - - s.T().Log("Getting latest flare") - flare, err := s.Env().FakeIntake.Client().GetLatestFlare() - require.NoError(s.T(), err, "Failed to get latest flare") - otelFolder, otelFlareFolder := false, false - var otelResponse string - for _, filename := range flare.GetFilenames() { - if strings.Contains(filename, "/otel/") { - otelFolder = true - } - if strings.Contains(filename, "/otel/otel-flare/") { - otelFlareFolder = true - } - if strings.Contains(filename, "otel/otel-response.json") { - otelResponse = filename - } - } - assert.True(s.T(), otelFolder) - assert.True(s.T(), otelFlareFolder) - otelResponseContent, err := flare.GetFileContent(otelResponse) - require.NoError(s.T(), err) - expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} - for _, expected := range expectedContents { - assert.Contains(s.T(), otelResponseContent, expected) - } -} - -func (s *linuxTestSuite) getAgentPod() corev1.Pod { - res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), - }) - require.NoError(s.T(), err) - require.NotEmpty(s.T(), res.Items) - return res.Items[0] -} - -func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry string, options []string) { - var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 - var backOffLimit int32 = 4 - - otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) - jobSpec := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("telemetrygen-job-%v", telemetry), - Namespace: "datadog", - }, - Spec: batchv1.JobSpec{ - TTLSecondsAfterFinished: &ttlSecondsAfterFinished, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ - { - Env: []corev1.EnvVar{{ - Name: "OTEL_SERVICE_NAME", - Value: service, - }, { - Name: "OTEL_K8S_NAMESPACE", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, - }, { - Name: "OTEL_K8S_NODE_NAME", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, - }, { - Name: "OTEL_K8S_POD_NAME", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, - }}, - Name: "telemetrygen-job", - Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.107.0", - Command: append([]string{ - "/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure", - "--telemetry-attributes", fmt.Sprintf("%v=%v", customAttribute, customAttributeValue), - "--otlp-attributes", "service.name=\"$(OTEL_SERVICE_NAME)\"", - "--otlp-attributes", "host.name=\"$(OTEL_K8S_NODE_NAME)\"", - "--otlp-attributes", fmt.Sprintf("deployment.environment=\"%v\"", env), - "--otlp-attributes", fmt.Sprintf("service.version=\"%v\"", version), - "--otlp-attributes", "k8s.namespace.name=\"$(OTEL_K8S_NAMESPACE)\"", - "--otlp-attributes", "k8s.node.name=\"$(OTEL_K8S_NODE_NAME)\"", - "--otlp-attributes", "k8s.pod.name=\"$(OTEL_K8S_POD_NAME)\"", - "--otlp-attributes", "k8s.container.name=\"telemetrygen-job\"", - }, options...), - }, - }, - RestartPolicy: corev1.RestartPolicyNever, - }, - }, - BackoffLimit: &backOffLimit, - }, - } - - _, err := s.Env().KubernetesCluster.Client().BatchV1().Jobs("datadog").Create(ctx, jobSpec, metav1.CreateOptions{}) - require.NoError(s.T(), err, "Could not properly start job") -} - -func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { - ctags, ok := tp.Tags["_dd.tags.container"] - if !ok { - return nil, false - } - splits := strings.Split(ctags, ",") - m := make(map[string]string) - for _, s := range splits { - kv := strings.SplitN(s, ":", 2) - if !assert.Len(t, kv, 2, "malformed container tag: %v", s) { - continue - } - m[kv[0]] = kv[1] - } - return m, true -} - -func getTagMapFromSlice(t *testing.T, tagSlice []string) map[string]string { - m := make(map[string]string) - for _, s := range tagSlice { - kv := strings.SplitN(s, ":", 2) - require.Len(t, kv, 2, "malformed tag: %v", s) - m[kv[0]] = kv[1] - } - return m -} diff --git a/test/new-e2e/tests/otel/otel_test.go b/test/new-e2e/tests/otel/otel_test.go new file mode 100644 index 0000000000000..d67c79aefcd90 --- /dev/null +++ b/test/new-e2e/tests/otel/otel_test.go @@ -0,0 +1,201 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package localkubernetes contains the provisioner for the local Kubernetes based environments + +package otel + +import ( + "context" + _ "embed" + "fmt" + "strings" + "testing" + "time" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + + "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" + fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" +) + +type linuxTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed collector.yml +var collectorConfig string + +func TestOTel(t *testing.T) { + e2e.Run(t, &linuxTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(collectorConfig))))) +} + +func (s *linuxTestSuite) TestOTelAgentInstalled() { + agent := s.getAgentPod() + assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") +} + +func (s *linuxTestSuite) TestOTLPTraces() { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + service := "telemetrygen-job" + numTraces := 10 + + s.T().Log("Starting telemetrygen") + s.createTelemetrygenJob(ctx, "traces", []string{"--service", service, "--traces", fmt.Sprint(numTraces)}) + + var traces []*aggregator.TracePayload + var err error + s.T().Log("Waiting for traces") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + traces, err = s.Env().FakeIntake.Client().GetTraces() + assert.NoError(c, err) + assert.NotEmpty(c, traces) + }, 2*time.Minute, 10*time.Second) + + require.NotEmpty(s.T(), traces) + trace := traces[0] + assert.Equal(s.T(), "none", trace.Env) + require.NotEmpty(s.T(), trace.TracerPayloads) + tp := trace.TracerPayloads[0] + require.NotEmpty(s.T(), tp.Chunks) + require.NotEmpty(s.T(), tp.Chunks[0].Spans) + spans := tp.Chunks[0].Spans + for _, sp := range spans { + assert.Equal(s.T(), service, sp.Service) + assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) + } +} + +func (s *linuxTestSuite) TestOTLPMetrics() { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + service := "telemetrygen-job" + serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) + numMetrics := 10 + + s.T().Log("Starting telemetrygen") + s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics), "--otlp-attributes", serviceAttribute}) + + s.T().Log("Waiting for metrics") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + serviceTag := "service:" + service + metrics, err := s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{serviceTag})) + assert.NoError(c, err) + assert.NotEmpty(c, metrics) + }, 2*time.Minute, 10*time.Second) +} + +func (s *linuxTestSuite) TestOTLPLogs() { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + service := "telemetrygen-job" + serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) + numLogs := 10 + logBody := "telemetrygen log" + + s.T().Log("Starting telemetrygen") + s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--otlp-attributes", serviceAttribute, "--body", logBody}) + + var logs []*aggregator.Log + var err error + s.T().Log("Waiting for logs") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + logs, err = s.Env().FakeIntake.Client().FilterLogs(service) + assert.NoError(c, err) + assert.NotEmpty(c, logs) + }, 2*time.Minute, 10*time.Second) + + require.NotEmpty(s.T(), logs) + for _, log := range logs { + assert.Contains(s.T(), log.Message, logBody) + } +} + +func (s *linuxTestSuite) TestOTelFlare() { + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + + s.T().Log("Starting flare") + agent := s.getAgentPod() + stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) + require.NoError(s.T(), err, "Failed to execute flare") + require.Empty(s.T(), stderr) + require.NotNil(s.T(), stdout) + + s.T().Log("Getting latest flare") + flare, err := s.Env().FakeIntake.Client().GetLatestFlare() + require.NoError(s.T(), err, "Failed to get latest flare") + otelFolder, otelFlareFolder := false, false + var otelResponse string + for _, filename := range flare.GetFilenames() { + if strings.Contains(filename, "/otel/") { + otelFolder = true + } + if strings.Contains(filename, "/otel/otel-flare/") { + otelFlareFolder = true + } + if strings.Contains(filename, "otel/otel-response.json") { + otelResponse = filename + } + } + assert.True(s.T(), otelFolder) + assert.True(s.T(), otelFlareFolder) + otelResponseContent, err := flare.GetFileContent(otelResponse) + require.NoError(s.T(), err) + expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} + for _, expected := range expectedContents { + assert.Contains(s.T(), otelResponseContent, expected) + } +} + +func (s *linuxTestSuite) getAgentPod() corev1.Pod { + res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), + }) + require.NoError(s.T(), err) + require.NotEmpty(s.T(), res.Items) + return res.Items[0] +} + +func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry string, options []string) { + var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 + var backOffLimit int32 = 4 + + otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) + jobSpec := &batchv1.Job{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("telemetrygen-job-%v", telemetry), + Namespace: "datadog", + }, + Spec: batchv1.JobSpec{ + TTLSecondsAfterFinished: &ttlSecondsAfterFinished, + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "telemetrygen-job", + Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest", + Command: append([]string{"/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure"}, options...), + }, + }, + RestartPolicy: corev1.RestartPolicyNever, + }, + }, + BackoffLimit: &backOffLimit, + }, + } + + _, err := s.Env().KubernetesCluster.Client().BatchV1().Jobs("datadog").Create(ctx, jobSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start job") +} From 3d9bba6fc9c6a3b6f419c24a109d440de6d27049 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 5 Sep 2024 14:58:22 -0400 Subject: [PATCH 04/47] Move --- .../tests/otel/{otel_test.go => otel-agent/pipelines_test.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/new-e2e/tests/otel/{otel_test.go => otel-agent/pipelines_test.go} (100%) diff --git a/test/new-e2e/tests/otel/otel_test.go b/test/new-e2e/tests/otel/otel-agent/pipelines_test.go similarity index 100% rename from test/new-e2e/tests/otel/otel_test.go rename to test/new-e2e/tests/otel/otel-agent/pipelines_test.go From 6488a48373c8d5f9af12c7f7cd3833fa681052c4 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 5 Sep 2024 14:58:59 -0400 Subject: [PATCH 05/47] Add test back --- .../tests/otel/otel-agent/pipelines_test.go | 186 ++++++++++++++++-- 1 file changed, 167 insertions(+), 19 deletions(-) diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go b/test/new-e2e/tests/otel/otel-agent/pipelines_test.go index d67c79aefcd90..d082c57c226d6 100644 --- a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go +++ b/test/new-e2e/tests/otel/otel-agent/pipelines_test.go @@ -3,9 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package localkubernetes contains the provisioner for the local Kubernetes based environments - -package otel +// Package otelagent contains e2e otel agent tests +package otelagent import ( "context" @@ -23,6 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" + "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" @@ -30,6 +30,14 @@ import ( awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" ) +const ( + service = "telemetrygen-job" + env = "e2e" + version = "1.0" + customAttribute = "custom.attribute" + customAttributeValue = "true" +) + type linuxTestSuite struct { e2e.BaseSuite[environments.Kubernetes] } @@ -49,11 +57,10 @@ func (s *linuxTestSuite) TestOTelAgentInstalled() { func (s *linuxTestSuite) TestOTLPTraces() { ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" numTraces := 10 s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "traces", []string{"--service", service, "--traces", fmt.Sprint(numTraces)}) + s.createTelemetrygenJob(ctx, "traces", []string{"--traces", fmt.Sprint(numTraces)}) var traces []*aggregator.TracePayload var err error @@ -63,56 +70,124 @@ func (s *linuxTestSuite) TestOTLPTraces() { assert.NoError(c, err) assert.NotEmpty(c, traces) }, 2*time.Minute, 10*time.Second) - require.NotEmpty(s.T(), traces) + s.T().Log("Got traces", traces) trace := traces[0] - assert.Equal(s.T(), "none", trace.Env) require.NotEmpty(s.T(), trace.TracerPayloads) + + // Verify tags on traces and spans tp := trace.TracerPayloads[0] + ctags, ok := getContainerTags(s.T(), tp) + require.True(s.T(), ok) + assert.Equal(s.T(), env, tp.Env) + assert.Equal(s.T(), version, tp.AppVersion) require.NotEmpty(s.T(), tp.Chunks) require.NotEmpty(s.T(), tp.Chunks[0].Spans) spans := tp.Chunks[0].Spans for _, sp := range spans { assert.Equal(s.T(), service, sp.Service) + assert.Equal(s.T(), env, sp.Meta["env"]) + assert.Equal(s.T(), version, sp.Meta["version"]) + assert.Equal(s.T(), customAttributeValue, sp.Meta[customAttribute]) assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) + assert.Equal(s.T(), sp.Meta["k8s.node.name"], tp.Hostname) + s.T().Log("k8s.node.name", sp.Meta["k8s.node.name"]) + s.T().Log("tp.Hostname", tp.Hostname) + + // Verify container tags from infraattributes processor + assert.NotNil(s.T(), ctags["kube_container_name"]) + assert.NotNil(s.T(), ctags["kube_namespace"]) + assert.NotNil(s.T(), ctags["pod_name"]) + assert.Equal(s.T(), sp.Meta["k8s.container.name"], ctags["kube_container_name"]) + assert.Equal(s.T(), sp.Meta["k8s.namespace.name"], ctags["kube_namespace"]) + assert.Equal(s.T(), sp.Meta["k8s.pod.name"], ctags["pod_name"]) } + + s.T().Log("Waiting for APM stats") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + stats, err := s.Env().FakeIntake.Client().GetAPMStats() + assert.NoError(c, err) + assert.NotEmpty(c, stats) + s.T().Log("Got APM stats", stats) + hasStatsForService := false + for _, payload := range stats { + for _, csp := range payload.StatsPayload.Stats { + for _, bucket := range csp.Stats { + for _, cgs := range bucket.Stats { + if cgs.Service == service { + hasStatsForService = true + assert.EqualValues(c, cgs.Hits, numTraces) + assert.EqualValues(c, cgs.TopLevelHits, numTraces) + } + } + } + } + } + assert.True(c, hasStatsForService) + }, 2*time.Minute, 10*time.Second) } func (s *linuxTestSuite) TestOTLPMetrics() { ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) numMetrics := 10 s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics), "--otlp-attributes", serviceAttribute}) + s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) + var metrics []*aggregator.MetricSeries + var err error s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - serviceTag := "service:" + service - metrics, err := s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{serviceTag})) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) assert.NoError(c, err) assert.NotEmpty(c, metrics) + s.T().Log("Got metrics", metrics) }, 2*time.Minute, 10*time.Second) + + for _, metricSeries := range metrics { + tags := getTagMapFromSlice(s.T(), metricSeries.Tags) + assert.Equal(s.T(), service, tags["service"]) + assert.Equal(s.T(), env, tags["env"]) + assert.Equal(s.T(), version, tags["version"]) + assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) + + // Verify container tags from infraattributes processor + assert.NotNil(s.T(), tags["kube_container_name"]) + assert.NotNil(s.T(), tags["kube_namespace"]) + assert.NotNil(s.T(), tags["pod_name"]) + assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) + assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) + assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) + + hasHostResource := false + for _, resource := range metricSeries.Resources { + if resource.Type == "host" { + assert.Equal(s.T(), tags["k8s.node.name"], resource.Name) + s.T().Log("k8s.node.name", tags["k8s.node.name"]) + s.T().Log("resource.Name", resource.Name) + hasHostResource = true + } + } + assert.True(s.T(), hasHostResource) + } } func (s *linuxTestSuite) TestOTLPLogs() { ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) numLogs := 10 logBody := "telemetrygen log" s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--otlp-attributes", serviceAttribute, "--body", logBody}) + ddtags := fmt.Sprintf("ddtags=\"k8s.namespace.name:$(OTEL_K8S_NAMESPACE),k8s.node.name:$(OTEL_K8S_NODE_NAME),k8s.pod.name:$(OTEL_K8S_POD_NAME),k8s.container.name:telemetrygen-job,%v:%v\"", customAttribute, customAttributeValue) + s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) var logs []*aggregator.Log var err error s.T().Log("Waiting for logs") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - logs, err = s.Env().FakeIntake.Client().FilterLogs(service) + logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) assert.NoError(c, err) assert.NotEmpty(c, logs) }, 2*time.Minute, 10*time.Second) @@ -120,7 +195,29 @@ func (s *linuxTestSuite) TestOTLPLogs() { require.NotEmpty(s.T(), logs) for _, log := range logs { assert.Contains(s.T(), log.Message, logBody) + s.T().Log("log.Tags", log.Tags) + tags := getTagMapFromSlice(s.T(), log.Tags) + s.T().Log("tags", tags) + assert.Equal(s.T(), service, tags["service"]) + assert.Equal(s.T(), env, tags["env"]) + assert.Equal(s.T(), version, tags["version"]) + assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) + assert.Equal(s.T(), tags["k8s.node.name"], log.HostName) + s.T().Log("k8s.node.name", tags["k8s.node.name"]) + s.T().Log("log.HostName", log.HostName) + + // Verify container tags from infraattributes processor + assert.NotNil(s.T(), tags["kube_container_name"]) + assert.NotNil(s.T(), tags["kube_namespace"]) + assert.NotNil(s.T(), tags["pod_name"]) + assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) + assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) + assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) + s.T().Log("source", log.Source) + s.T().Log("status", log.Status) } + + time.Sleep(30 * time.Second) } func (s *linuxTestSuite) TestOTelFlare() { @@ -184,9 +281,33 @@ func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry st Spec: corev1.PodSpec{ Containers: []corev1.Container{ { - Name: "telemetrygen-job", - Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest", - Command: append([]string{"/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure"}, options...), + Env: []corev1.EnvVar{{ + Name: "OTEL_SERVICE_NAME", + Value: service, + }, { + Name: "OTEL_K8S_NAMESPACE", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, + }, { + Name: "OTEL_K8S_NODE_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, + }, { + Name: "OTEL_K8S_POD_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }}, + Name: "telemetrygen-job", + Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.107.0", + Command: append([]string{ + "/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure", + "--telemetry-attributes", fmt.Sprintf("%v=%v", customAttribute, customAttributeValue), + "--otlp-attributes", "service.name=\"$(OTEL_SERVICE_NAME)\"", + "--otlp-attributes", "host.name=\"$(OTEL_K8S_NODE_NAME)\"", + "--otlp-attributes", fmt.Sprintf("deployment.environment=\"%v\"", env), + "--otlp-attributes", fmt.Sprintf("service.version=\"%v\"", version), + "--otlp-attributes", "k8s.namespace.name=\"$(OTEL_K8S_NAMESPACE)\"", + "--otlp-attributes", "k8s.node.name=\"$(OTEL_K8S_NODE_NAME)\"", + "--otlp-attributes", "k8s.pod.name=\"$(OTEL_K8S_POD_NAME)\"", + "--otlp-attributes", "k8s.container.name=\"telemetrygen-job\"", + }, options...), }, }, RestartPolicy: corev1.RestartPolicyNever, @@ -199,3 +320,30 @@ func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry st _, err := s.Env().KubernetesCluster.Client().BatchV1().Jobs("datadog").Create(ctx, jobSpec, metav1.CreateOptions{}) require.NoError(s.T(), err, "Could not properly start job") } + +func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { + ctags, ok := tp.Tags["_dd.tags.container"] + if !ok { + return nil, false + } + splits := strings.Split(ctags, ",") + m := make(map[string]string) + for _, s := range splits { + kv := strings.SplitN(s, ":", 2) + if !assert.Len(t, kv, 2, "malformed container tag: %v", s) { + continue + } + m[kv[0]] = kv[1] + } + return m, true +} + +func getTagMapFromSlice(t *testing.T, tagSlice []string) map[string]string { + m := make(map[string]string) + for _, s := range tagSlice { + kv := strings.SplitN(s, ":", 2) + require.Len(t, kv, 2, "malformed tag: %v", s) + m[kv[0]] = kv[1] + } + return m +} From 1ef009d88e033bf5b3c20ca2c743cfc40bc7c866 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 14:38:38 -0400 Subject: [PATCH 06/47] Refactor test structure --- .../tests/otel/otel-agent/config/complete.yml | 70 ++++++++ .../{collector.yml => config/minimal.yml} | 0 .../tests/otel/otel-agent/config/sampling.yml | 51 ++++++ .../tests/otel/otel-agent/config_test.go | 69 ++++++++ .../otel/otel-agent/pipelines_minimal_test.go | 47 +++++ .../otel-agent/pipelines_sampling_test.go | 35 ++++ .../otlp-ingest/pipelines_sampling_test.go | 47 +++++ .../tests/otel/otlp-ingest/pipelines_test.go | 124 ++------------ .../pipelines_utils.go} | 161 +++++++++--------- 9 files changed, 411 insertions(+), 193 deletions(-) create mode 100644 test/new-e2e/tests/otel/otel-agent/config/complete.yml rename test/new-e2e/tests/otel/otel-agent/{collector.yml => config/minimal.yml} (100%) create mode 100644 test/new-e2e/tests/otel/otel-agent/config/sampling.yml create mode 100644 test/new-e2e/tests/otel/otel-agent/config_test.go create mode 100644 test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go create mode 100644 test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go create mode 100644 test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go rename test/new-e2e/tests/otel/{otel-agent/pipelines_test.go => utils/pipelines_utils.go} (69%) diff --git a/test/new-e2e/tests/otel/otel-agent/config/complete.yml b/test/new-e2e/tests/otel/otel-agent/config/complete.yml new file mode 100644 index 0000000000000..45ee7d26db613 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/config/complete.yml @@ -0,0 +1,70 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + prometheus/dd-autoconfigured: + config: + scrape_configs: + - job_name: 'datadog-agent' + scrape_interval: 10s + static_configs: + - targets: [ '0.0.0.0:8888' ] +exporters: + datadog: + traces: + span_name_as_resource_name: true + metrics: + resource_attributes_as_tags: true + hostname: "otelcol-docker" + api: + key: ${DD_API_KEY} + debug: + verbosity: detailed +processors: + batch: + infraattributes/dd-autoconfigured: +connectors: + # Use datadog connector to compute stats for pre-sampled traces + datadog/connector: + traces: + span_name_as_resource_name: true + compute_stats_by_span_kind: true + compute_top_level_by_span_kind: true + peer_tags_aggregation: true +extensions: + pprof/dd-autoconfigured: + health_check/dd-autoconfigured: + zpages/dd-autoconfigured: + endpoint: "localhost:55679" + ddflare/dd-autoconfigured: +service: + telemetry: + logs: + level: debug + extensions: + [ + pprof/dd-autoconfigured, + zpages/dd-autoconfigured, + health_check/dd-autoconfigured, + ddflare/dd-autoconfigured, + ] + pipelines: + traces: + receivers: [otlp] + processors: [batch, infraattributes/dd-autoconfigured] + exporters: [datadog/connector] + traces/send: + receivers: [otlp] + processors: [batch, infraattributes/dd-autoconfigured] + exporters: [datadog] + metrics: + receivers: [otlp, datadog/connector, prometheus/dd-autoconfigured] + processors: [batch, infraattributes/dd-autoconfigured] + exporters: [datadog] + logs: + receivers: [otlp] + processors: [batch, infraattributes/dd-autoconfigured] + exporters: [datadog, debug] diff --git a/test/new-e2e/tests/otel/otel-agent/collector.yml b/test/new-e2e/tests/otel/otel-agent/config/minimal.yml similarity index 100% rename from test/new-e2e/tests/otel/otel-agent/collector.yml rename to test/new-e2e/tests/otel/otel-agent/config/minimal.yml diff --git a/test/new-e2e/tests/otel/otel-agent/config/sampling.yml b/test/new-e2e/tests/otel/otel-agent/config/sampling.yml new file mode 100644 index 0000000000000..e3c4311d14472 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/config/sampling.yml @@ -0,0 +1,51 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 +exporters: + datadog: + traces: + span_name_as_resource_name: true + metrics: + resource_attributes_as_tags: true + hostname: "otelcol-docker" + api: + key: ${DD_API_KEY} + debug: + verbosity: detailed +processors: + batch: + probabilistic_sampler: + sampling_percentage: 50 +connectors: + # Use datadog connector to compute stats for pre-sampled traces + datadog/connector: + traces: + span_name_as_resource_name: true + compute_stats_by_span_kind: true + compute_top_level_by_span_kind: true + peer_tags_aggregation: true +service: + telemetry: + logs: + level: debug + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [datadog/connector] + traces/send: + receivers: [datadog/connector] + processors: [batch, probabilistic_sampler] + exporters: [datadog] + metrics: + receivers: [otlp, datadog/connector] + processors: [batch] + exporters: [datadog] + logs: + receivers: [otlp] + processors: [batch] + exporters: [datadog, debug] diff --git a/test/new-e2e/tests/otel/otel-agent/config_test.go b/test/new-e2e/tests/otel/otel-agent/config_test.go new file mode 100644 index 0000000000000..3c9f95c5fe82d --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/config_test.go @@ -0,0 +1,69 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + "context" + _ "embed" + "strings" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" +) + +func (s *minimalTestSuite) TestOTelAgentInstalled() { + agent := s.getAgentPod() + assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") +} + +func (s *minimalTestSuite) TestOTelFlare() { + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + + s.T().Log("Starting flare") + agent := s.getAgentPod() + stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) + require.NoError(s.T(), err, "Failed to execute flare") + require.Empty(s.T(), stderr) + require.NotNil(s.T(), stdout) + + s.T().Log("Getting latest flare") + flare, err := s.Env().FakeIntake.Client().GetLatestFlare() + require.NoError(s.T(), err, "Failed to get latest flare") + otelFolder, otelFlareFolder := false, false + var otelResponse string + for _, filename := range flare.GetFilenames() { + if strings.Contains(filename, "/otel/") { + otelFolder = true + } + if strings.Contains(filename, "/otel/otel-flare/") { + otelFlareFolder = true + } + if strings.Contains(filename, "otel/otel-response.json") { + otelResponse = filename + } + } + assert.True(s.T(), otelFolder) + assert.True(s.T(), otelFlareFolder) + otelResponseContent, err := flare.GetFileContent(otelResponse) + require.NoError(s.T(), err) + expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} + for _, expected := range expectedContents { + assert.Contains(s.T(), otelResponseContent, expected) + } +} + +func (s *minimalTestSuite) getAgentPod() corev1.Pod { + res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), + }) + require.NoError(s.T(), err) + require.NotEmpty(s.T(), res.Items) + return res.Items[0] +} diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go b/test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go new file mode 100644 index 0000000000000..bfd3630ab56e6 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go @@ -0,0 +1,47 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type minimalTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed config/minimal.yml +var minimalConfig string + +func TestPipelinesMinimal(t *testing.T) { + t.Parallel() + e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) +} + +func (s *minimalTestSuite) TestOTLPTraces() { + utils.TestTraces(s) +} + +func (s *minimalTestSuite) TestOTLPMetrics() { + utils.TestMetrics(s) +} + +func (s *minimalTestSuite) TestOTLPLogs() { + utils.TestLogs(s) +} + +func (s *minimalTestSuite) TestHosts() { + utils.TestHosts(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go new file mode 100644 index 0000000000000..836695516328e --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go @@ -0,0 +1,35 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type samplingTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed config/sampling.yml +var samplingConfig string + +func TestPipelinesSampling(t *testing.T) { + t.Parallel() + e2e.Run(t, &samplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(samplingConfig))))) +} + +func (s *samplingTestSuite) TestSampling() { + utils.TestSampling(s) +} diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go new file mode 100644 index 0000000000000..8a02d74e11ce4 --- /dev/null +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go @@ -0,0 +1,47 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e OTLP Ingest tests +package otlpingest + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type otlpIngestSamplingTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +func TestOTLPIngestSampling(t *testing.T) { + values := ` +datadog: + otlp: + receiver: + protocols: + grpc: + enabled: true + logs: + enabled: true + metrics: + resource_attributes_as_tags: true + traces: + probabilistic_sampler: + sampling_percentage: 50 +` + t.Parallel() + e2e.Run(t, &otlpIngestSamplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) +} + +func (s *otlpIngestSamplingTestSuite) TestSampling() { + utils.TestSampling(s) +} diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index f15c74e858220..a95c1b2a05cb3 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -3,35 +3,26 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package localkubernetes contains the provisioner for the local Kubernetes based environments - -package otel +// Package otelagent contains e2e OTLP Ingest tests +package otlpingest import ( - "context" _ "embed" - "fmt" "testing" - "time" "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" - "github.com/stretchr/testify/assert" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" - fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) -type otelIngestTestSuite struct { +type otlpIngestTestSuite struct { e2e.BaseSuite[environments.Kubernetes] } -func TestOTelIngest(t *testing.T) { +func TestOTLPIngest(t *testing.T) { values := ` datadog: otlp: @@ -41,108 +32,25 @@ datadog: enabled: true logs: enabled: true + metrics: + resource_attributes_as_tags: true ` t.Parallel() - e2e.Run(t, &otelIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) + e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) } -func (s *otelIngestTestSuite) TestOTLPTraces() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - numTraces := 10 - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "traces", []string{"--service", service, "--traces", fmt.Sprint(numTraces)}) - - s.T().Log("Waiting for traces") - s.EventuallyWithT(func(c *assert.CollectT) { - traces, err := s.Env().FakeIntake.Client().GetTraces() - assert.NoError(c, err) - assert.NotEmpty(c, traces) - trace := traces[0] - assert.Equal(c, "none", trace.Env) - assert.NotEmpty(c, trace.TracerPayloads) - tp := trace.TracerPayloads[0] - assert.NotEmpty(c, tp.Chunks) - assert.NotEmpty(c, tp.Chunks[0].Spans) - spans := tp.Chunks[0].Spans - for _, sp := range spans { - assert.Equal(c, service, sp.Service) - assert.Equal(c, "telemetrygen", sp.Meta["otel.library.name"]) - } - }, 2*time.Minute, 10*time.Second) +func (s *otlpIngestTestSuite) TestOTLPTraces() { + utils.TestTraces(s) } -func (s *otelIngestTestSuite) TestOTLPMetrics() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) - numMetrics := 10 - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics), "--otlp-attributes", serviceAttribute}) - - s.T().Log("Waiting for metrics") - s.EventuallyWithT(func(c *assert.CollectT) { - serviceTag := "service:" + service - metrics, err := s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{serviceTag})) - assert.NoError(c, err) - assert.NotEmpty(c, metrics) - }, 2*time.Minute, 10*time.Second) +func (s *otlpIngestTestSuite) TestOTLPMetrics() { + utils.TestMetrics(s) } -func (s *otelIngestTestSuite) TestOTLPLogs() { - ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - service := "telemetrygen-job" - serviceAttribute := fmt.Sprintf("service.name=\"%v\"", service) - numLogs := 10 - logBody := "telemetrygen log" - - s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--otlp-attributes", serviceAttribute, "--body", logBody}) - - s.T().Log("Waiting for logs") - s.EventuallyWithT(func(c *assert.CollectT) { - logs, err := s.Env().FakeIntake.Client().FilterLogs(service) - assert.NoError(c, err) - assert.NotEmpty(c, logs) - for _, log := range logs { - assert.Contains(c, log.Message, logBody) - } - }, 2*time.Minute, 10*time.Second) +func (s *otlpIngestTestSuite) TestOTLPLogs() { + utils.TestLogs(s) } -func (s *otelIngestTestSuite) createTelemetrygenJob(ctx context.Context, telemetry string, options []string) { - var ttlSecondsAfterFinished int32 = 600 //nolint:revive // We want to see this is explicitly set to 0 - var backOffLimit int32 = 4 - - otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) - jobSpec := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("telemetrygen-job-%v", telemetry), - Namespace: "datadog", - }, - Spec: batchv1.JobSpec{ - TTLSecondsAfterFinished: &ttlSecondsAfterFinished, - Template: corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ - { - Name: "telemetrygen-job", - Image: "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest", - Command: append([]string{"/telemetrygen", telemetry, "--otlp-endpoint", otlpEndpoint, "--otlp-insecure"}, options...), - }, - }, - RestartPolicy: corev1.RestartPolicyNever, - }, - }, - BackoffLimit: &backOffLimit, - }, - } - - _, err := s.Env().KubernetesCluster.Client().BatchV1().Jobs("datadog").Create(ctx, jobSpec, metav1.CreateOptions{}) - assert.NoError(s.T(), err, "Could not properly start job") +func (s *otlpIngestTestSuite) TestHosts() { + utils.TestHosts(s) } diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go similarity index 69% rename from test/new-e2e/tests/otel/otel-agent/pipelines_test.go rename to test/new-e2e/tests/otel/utils/pipelines_utils.go index d082c57c226d6..3fc31bf535817 100644 --- a/test/new-e2e/tests/otel/otel-agent/pipelines_test.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -1,33 +1,22 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -// Package otelagent contains e2e otel agent tests -package otelagent +package utils import ( "context" - _ "embed" "fmt" "strings" "testing" "time" - "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" ) const ( @@ -38,29 +27,18 @@ const ( customAttributeValue = "true" ) -type linuxTestSuite struct { - e2e.BaseSuite[environments.Kubernetes] -} - -//go:embed collector.yml -var collectorConfig string - -func TestOTel(t *testing.T) { - e2e.Run(t, &linuxTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(collectorConfig))))) -} - -func (s *linuxTestSuite) TestOTelAgentInstalled() { - agent := s.getAgentPod() - assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") +type OTelTestSuite interface { + T() *testing.T + Env() *environments.Kubernetes } -func (s *linuxTestSuite) TestOTLPTraces() { +func TestTraces(s OTelTestSuite) { ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() numTraces := 10 s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "traces", []string{"--traces", fmt.Sprint(numTraces)}) + createTelemetrygenJob(ctx, s, "traces", []string{"--traces", fmt.Sprint(numTraces)}) var traces []*aggregator.TracePayload var err error @@ -72,6 +50,7 @@ func (s *linuxTestSuite) TestOTLPTraces() { }, 2*time.Minute, 10*time.Second) require.NotEmpty(s.T(), traces) s.T().Log("Got traces", traces) + s.T().Log("num traces", len(traces)) trace := traces[0] require.NotEmpty(s.T(), trace.TracerPayloads) @@ -91,8 +70,6 @@ func (s *linuxTestSuite) TestOTLPTraces() { assert.Equal(s.T(), customAttributeValue, sp.Meta[customAttribute]) assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) assert.Equal(s.T(), sp.Meta["k8s.node.name"], tp.Hostname) - s.T().Log("k8s.node.name", sp.Meta["k8s.node.name"]) - s.T().Log("tp.Hostname", tp.Hostname) // Verify container tags from infraattributes processor assert.NotNil(s.T(), ctags["kube_container_name"]) @@ -102,13 +79,17 @@ func (s *linuxTestSuite) TestOTLPTraces() { assert.Equal(s.T(), sp.Meta["k8s.namespace.name"], ctags["kube_namespace"]) assert.Equal(s.T(), sp.Meta["k8s.pod.name"], ctags["pod_name"]) } + TestAPMStats(s, numTraces) +} +func TestAPMStats(s OTelTestSuite, numTraces int) { s.T().Log("Waiting for APM stats") + var stats []*aggregator.APMStatsPayload + var err error require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - stats, err := s.Env().FakeIntake.Client().GetAPMStats() + stats, err = s.Env().FakeIntake.Client().GetAPMStats() assert.NoError(c, err) assert.NotEmpty(c, stats) - s.T().Log("Got APM stats", stats) hasStatsForService := false for _, payload := range stats { for _, csp := range payload.StatsPayload.Stats { @@ -125,15 +106,16 @@ func (s *linuxTestSuite) TestOTLPTraces() { } assert.True(c, hasStatsForService) }, 2*time.Minute, 10*time.Second) + s.T().Log("Got APM stats", stats) } -func (s *linuxTestSuite) TestOTLPMetrics() { +func TestMetrics(s OTelTestSuite) { ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() numMetrics := 10 s.T().Log("Starting telemetrygen") - s.createTelemetrygenJob(ctx, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) + createTelemetrygenJob(ctx, s, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) var metrics []*aggregator.MetricSeries var err error @@ -142,8 +124,8 @@ func (s *linuxTestSuite) TestOTLPMetrics() { metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) assert.NoError(c, err) assert.NotEmpty(c, metrics) - s.T().Log("Got metrics", metrics) }, 2*time.Minute, 10*time.Second) + s.T().Log("Got metrics", metrics) for _, metricSeries := range metrics { tags := getTagMapFromSlice(s.T(), metricSeries.Tags) @@ -164,8 +146,6 @@ func (s *linuxTestSuite) TestOTLPMetrics() { for _, resource := range metricSeries.Resources { if resource.Type == "host" { assert.Equal(s.T(), tags["k8s.node.name"], resource.Name) - s.T().Log("k8s.node.name", tags["k8s.node.name"]) - s.T().Log("resource.Name", resource.Name) hasHostResource = true } } @@ -173,7 +153,7 @@ func (s *linuxTestSuite) TestOTLPMetrics() { } } -func (s *linuxTestSuite) TestOTLPLogs() { +func TestLogs(s OTelTestSuite) { ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() numLogs := 10 @@ -181,7 +161,7 @@ func (s *linuxTestSuite) TestOTLPLogs() { s.T().Log("Starting telemetrygen") ddtags := fmt.Sprintf("ddtags=\"k8s.namespace.name:$(OTEL_K8S_NAMESPACE),k8s.node.name:$(OTEL_K8S_NODE_NAME),k8s.pod.name:$(OTEL_K8S_POD_NAME),k8s.container.name:telemetrygen-job,%v:%v\"", customAttribute, customAttributeValue) - s.createTelemetrygenJob(ctx, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) + createTelemetrygenJob(ctx, s, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) var logs []*aggregator.Log var err error @@ -191,20 +171,17 @@ func (s *linuxTestSuite) TestOTLPLogs() { assert.NoError(c, err) assert.NotEmpty(c, logs) }, 2*time.Minute, 10*time.Second) + s.T().Log("Got logs", logs) require.NotEmpty(s.T(), logs) for _, log := range logs { assert.Contains(s.T(), log.Message, logBody) - s.T().Log("log.Tags", log.Tags) tags := getTagMapFromSlice(s.T(), log.Tags) - s.T().Log("tags", tags) assert.Equal(s.T(), service, tags["service"]) assert.Equal(s.T(), env, tags["env"]) assert.Equal(s.T(), version, tags["version"]) assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) assert.Equal(s.T(), tags["k8s.node.name"], log.HostName) - s.T().Log("k8s.node.name", tags["k8s.node.name"]) - s.T().Log("log.HostName", log.HostName) // Verify container tags from infraattributes processor assert.NotNil(s.T(), tags["kube_container_name"]) @@ -213,59 +190,73 @@ func (s *linuxTestSuite) TestOTLPLogs() { assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) - s.T().Log("source", log.Source) - s.T().Log("status", log.Status) } - - time.Sleep(30 * time.Second) } -func (s *linuxTestSuite) TestOTelFlare() { +func TestHosts(s OTelTestSuite) { + ctx := context.Background() s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + numTelemetry := 10 + logBody := "telemetrygen log" - s.T().Log("Starting flare") - agent := s.getAgentPod() - stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) - require.NoError(s.T(), err, "Failed to execute flare") - require.Empty(s.T(), stderr) - require.NotNil(s.T(), stdout) - - s.T().Log("Getting latest flare") - flare, err := s.Env().FakeIntake.Client().GetLatestFlare() - require.NoError(s.T(), err, "Failed to get latest flare") - otelFolder, otelFlareFolder := false, false - var otelResponse string - for _, filename := range flare.GetFilenames() { - if strings.Contains(filename, "/otel/") { - otelFolder = true - } - if strings.Contains(filename, "/otel/otel-flare/") { - otelFlareFolder = true - } - if strings.Contains(filename, "otel/otel-response.json") { - otelResponse = filename + s.T().Log("Starting telemetrygen traces") + createTelemetrygenJob(ctx, s, "traces", []string{"--traces", fmt.Sprint(numTelemetry)}) + s.T().Log("Starting telemetrygen metrics") + createTelemetrygenJob(ctx, s, "metrics", []string{"--metrics", fmt.Sprint(numTelemetry)}) + s.T().Log("Starting telemetrygen logs") + createTelemetrygenJob(ctx, s, "logs", []string{"--logs", fmt.Sprint(numTelemetry), "--body", logBody}) + + var traces []*aggregator.TracePayload + var metrics []*aggregator.MetricSeries + var logs []*aggregator.Log + var err error + s.T().Log("Waiting for telemetry") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + traces, err = s.Env().FakeIntake.Client().GetTraces() + assert.NoError(c, err) + assert.NotEmpty(c, traces) + + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) + assert.NoError(c, err) + assert.NotEmpty(c, metrics) + + logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) + assert.NoError(c, err) + assert.NotEmpty(c, logs) + }, 2*time.Minute, 10*time.Second) + s.T().Log("Got telemetry") + trace := traces[0] + require.NotEmpty(s.T(), trace.TracerPayloads) + tp := trace.TracerPayloads[0] + traceHostname := tp.Hostname + + var metricHostname string + metric := metrics[0] + for _, resource := range metric.Resources { + if resource.Type == "host" { + metricHostname = resource.Name } } - assert.True(s.T(), otelFolder) - assert.True(s.T(), otelFlareFolder) - otelResponseContent, err := flare.GetFileContent(otelResponse) - require.NoError(s.T(), err) - expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} - for _, expected := range expectedContents { - assert.Contains(s.T(), otelResponseContent, expected) - } + + logHostname := logs[0].HostName + + assert.Equal(s.T(), traceHostname, metricHostname) + assert.Equal(s.T(), traceHostname, logHostname) + assert.Equal(s.T(), logHostname, metricHostname) } -func (s *linuxTestSuite) getAgentPod() corev1.Pod { - res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), - }) - require.NoError(s.T(), err) - require.NotEmpty(s.T(), res.Items) - return res.Items[0] +func TestSampling(s OTelTestSuite) { + ctx := context.Background() + s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + numTraces := 10 + + s.T().Log("Starting telemetrygen") + createTelemetrygenJob(ctx, s, "traces", []string{"--traces", fmt.Sprint(numTraces)}) + + TestAPMStats(s, numTraces) } -func (s *linuxTestSuite) createTelemetrygenJob(ctx context.Context, telemetry string, options []string) { +func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry string, options []string) { var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 var backOffLimit int32 = 4 From af8fd853a9b0983956f06085f4a47a393aa7a619 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 14:43:02 -0400 Subject: [PATCH 07/47] Fix tabs --- .../tests/otel/otlp-ingest/pipelines_sampling_test.go | 10 +++++----- test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go index 8a02d74e11ce4..9298dde798bc7 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go @@ -32,11 +32,11 @@ datadog: enabled: true logs: enabled: true - metrics: - resource_attributes_as_tags: true - traces: - probabilistic_sampler: - sampling_percentage: 50 + metrics: + resource_attributes_as_tags: true + traces: + probabilistic_sampler: + sampling_percentage: 50 ` t.Parallel() e2e.Run(t, &otlpIngestSamplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index a95c1b2a05cb3..dfe8064f5ad81 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -32,8 +32,8 @@ datadog: enabled: true logs: enabled: true - metrics: - resource_attributes_as_tags: true + metrics: + resource_attributes_as_tags: true ` t.Parallel() e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) From e907b7699a0ddf7c9b154010a82e01ba619c24fc Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 14:59:49 -0400 Subject: [PATCH 08/47] Fix lint --- .../tests/otel/otel-agent/config/complete.yml | 7 +--- .../tests/otel/otel-agent/config/minimal.yml | 7 +--- .../tests/otel/otel-agent/config/sampling.yml | 7 +--- .../tests/otel/utils/pipelines_utils.go | 32 +++++++++++++------ 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/test/new-e2e/tests/otel/otel-agent/config/complete.yml b/test/new-e2e/tests/otel/otel-agent/config/complete.yml index 45ee7d26db613..f8a2b0265b9c9 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/complete.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/complete.yml @@ -21,8 +21,6 @@ exporters: hostname: "otelcol-docker" api: key: ${DD_API_KEY} - debug: - verbosity: detailed processors: batch: infraattributes/dd-autoconfigured: @@ -41,9 +39,6 @@ extensions: endpoint: "localhost:55679" ddflare/dd-autoconfigured: service: - telemetry: - logs: - level: debug extensions: [ pprof/dd-autoconfigured, @@ -67,4 +62,4 @@ service: logs: receivers: [otlp] processors: [batch, infraattributes/dd-autoconfigured] - exporters: [datadog, debug] + exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/config/minimal.yml b/test/new-e2e/tests/otel/otel-agent/config/minimal.yml index df99ae63b55b1..4815dd394401f 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/minimal.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/minimal.yml @@ -14,8 +14,6 @@ exporters: hostname: "otelcol-docker" api: key: ${DD_API_KEY} - debug: - verbosity: detailed processors: batch: connectors: @@ -27,9 +25,6 @@ connectors: compute_top_level_by_span_kind: true peer_tags_aggregation: true service: - telemetry: - logs: - level: debug pipelines: traces: receivers: [otlp] @@ -46,4 +41,4 @@ service: logs: receivers: [otlp] processors: [batch] - exporters: [datadog, debug] + exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/config/sampling.yml b/test/new-e2e/tests/otel/otel-agent/config/sampling.yml index e3c4311d14472..33a84ae3d068f 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/sampling.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/sampling.yml @@ -14,8 +14,6 @@ exporters: hostname: "otelcol-docker" api: key: ${DD_API_KEY} - debug: - verbosity: detailed processors: batch: probabilistic_sampler: @@ -29,9 +27,6 @@ connectors: compute_top_level_by_span_kind: true peer_tags_aggregation: true service: - telemetry: - logs: - level: debug pipelines: traces: receivers: [otlp] @@ -48,4 +43,4 @@ service: logs: receivers: [otlp] processors: [batch] - exporters: [datadog, debug] + exporters: [datadog] diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 3fc31bf535817..7895762c2ae1d 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -1,3 +1,9 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package utils contains util functions for OTel e2e tests package utils import ( @@ -27,21 +33,23 @@ const ( customAttributeValue = "true" ) +// OTelTestSuite is an interface for the OTel e2e test suite. type OTelTestSuite interface { T() *testing.T Env() *environments.Kubernetes } +// TestTraces tests that OTLP traces are received through OTel pipelines as expected func TestTraces(s OTelTestSuite) { ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) numTraces := 10 s.T().Log("Starting telemetrygen") createTelemetrygenJob(ctx, s, "traces", []string{"--traces", fmt.Sprint(numTraces)}) var traces []*aggregator.TracePayload - var err error s.T().Log("Waiting for traces") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { traces, err = s.Env().FakeIntake.Client().GetTraces() @@ -82,6 +90,7 @@ func TestTraces(s OTelTestSuite) { TestAPMStats(s, numTraces) } +// TestAPMStats checks that APM stats are received with the correct number of hits per traces given func TestAPMStats(s OTelTestSuite, numTraces int) { s.T().Log("Waiting for APM stats") var stats []*aggregator.APMStatsPayload @@ -109,16 +118,17 @@ func TestAPMStats(s OTelTestSuite, numTraces int) { s.T().Log("Got APM stats", stats) } +// TestMetrics tests that OTLP metrics are received through OTel pipelines as expected func TestMetrics(s OTelTestSuite) { ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) numMetrics := 10 s.T().Log("Starting telemetrygen") createTelemetrygenJob(ctx, s, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) var metrics []*aggregator.MetricSeries - var err error s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) @@ -153,9 +163,11 @@ func TestMetrics(s OTelTestSuite) { } } +// TestLogs tests that OTLP logs are received through OTel pipelines as expected func TestLogs(s OTelTestSuite) { ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) numLogs := 10 logBody := "telemetrygen log" @@ -164,7 +176,6 @@ func TestLogs(s OTelTestSuite) { createTelemetrygenJob(ctx, s, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) var logs []*aggregator.Log - var err error s.T().Log("Waiting for logs") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) @@ -193,9 +204,11 @@ func TestLogs(s OTelTestSuite) { } } +// TestHosts verifies that OTLP traces, metrics, and logs have consistent hostnames func TestHosts(s OTelTestSuite) { ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) numTelemetry := 10 logBody := "telemetrygen log" @@ -209,7 +222,6 @@ func TestHosts(s OTelTestSuite) { var traces []*aggregator.TracePayload var metrics []*aggregator.MetricSeries var logs []*aggregator.Log - var err error s.T().Log("Waiting for telemetry") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { traces, err = s.Env().FakeIntake.Client().GetTraces() @@ -245,9 +257,11 @@ func TestHosts(s OTelTestSuite) { assert.Equal(s.T(), logHostname, metricHostname) } +// TestSampling tests that APM stats are correct when using probabilistic sampling func TestSampling(s OTelTestSuite) { ctx := context.Background() - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) numTraces := 10 s.T().Log("Starting telemetrygen") From 730425545284e8a6416711b52c1d1fea23aad680 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 16:25:14 -0400 Subject: [PATCH 09/47] Clean up code --- .../tests/otel/otel-agent/complete_test.go | 59 +++++++++++++++++++ ...elines_minimal_test.go => minimal_test.go} | 10 +++- ...ines_sampling_test.go => sampling_test.go} | 2 +- .../otlp-ingest/pipelines_sampling_test.go | 17 ++++-- .../tests/otel/otlp-ingest/pipelines_test.go | 8 ++- .../config_test.go => utils/config_utils.go} | 17 +++--- 6 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 test/new-e2e/tests/otel/otel-agent/complete_test.go rename test/new-e2e/tests/otel/otel-agent/{pipelines_minimal_test.go => minimal_test.go} (87%) rename test/new-e2e/tests/otel/otel-agent/{pipelines_sampling_test.go => sampling_test.go} (96%) rename test/new-e2e/tests/otel/{otel-agent/config_test.go => utils/config_utils.go} (84%) diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go new file mode 100644 index 0000000000000..ce972fad2a25a --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -0,0 +1,59 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type completeTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed config/minimal.yml +var completeConfig string + +func TestOTelAgentComplete(t *testing.T) { + values := ` +agents: + containers: + agent: + env: + - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED + value: false + otelAgent: + env: + - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED + value: false +` + t.Parallel() + e2e.Run(t, &completeTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) +} + +func (s *completeTestSuite) TestOTLPTraces() { + utils.TestTraces(s) +} + +func (s *completeTestSuite) TestOTLPMetrics() { + utils.TestMetrics(s) +} + +func (s *completeTestSuite) TestOTLPLogs() { + utils.TestLogs(s) +} + +func (s *completeTestSuite) TestHosts() { + utils.TestHosts(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go b/test/new-e2e/tests/otel/otel-agent/minimal_test.go similarity index 87% rename from test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go rename to test/new-e2e/tests/otel/otel-agent/minimal_test.go index bfd3630ab56e6..e98b02957162c 100644 --- a/test/new-e2e/tests/otel/otel-agent/pipelines_minimal_test.go +++ b/test/new-e2e/tests/otel/otel-agent/minimal_test.go @@ -25,7 +25,7 @@ type minimalTestSuite struct { //go:embed config/minimal.yml var minimalConfig string -func TestPipelinesMinimal(t *testing.T) { +func TestOTelAgentMinimal(t *testing.T) { t.Parallel() e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) } @@ -45,3 +45,11 @@ func (s *minimalTestSuite) TestOTLPLogs() { func (s *minimalTestSuite) TestHosts() { utils.TestHosts(s) } + +func (s *minimalTestSuite) TestOTelAgentInstalled() { + utils.TestOTelAgentInstalled(s) +} + +func (s *minimalTestSuite) TestOTelFlare() { + utils.TestOTelFlare(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otel-agent/sampling_test.go similarity index 96% rename from test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go rename to test/new-e2e/tests/otel/otel-agent/sampling_test.go index 836695516328e..7e4c50166ada1 100644 --- a/test/new-e2e/tests/otel/otel-agent/pipelines_sampling_test.go +++ b/test/new-e2e/tests/otel/otel-agent/sampling_test.go @@ -25,7 +25,7 @@ type samplingTestSuite struct { //go:embed config/sampling.yml var samplingConfig string -func TestPipelinesSampling(t *testing.T) { +func TestOTelAgentSampling(t *testing.T) { t.Parallel() e2e.Run(t, &samplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(samplingConfig))))) } diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go index 9298dde798bc7..22132cdc96e00 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go @@ -32,11 +32,18 @@ datadog: enabled: true logs: enabled: true - metrics: - resource_attributes_as_tags: true - traces: - probabilistic_sampler: - sampling_percentage: 50 +agents: + containers: + agent: + env: + - name: DD_OTLP_CONFIG_METRICS_RESOURCE_ATTRIBUTES_AS_TAGS + value: true + - name: DD_OTLP_CONFIG_TRACES_PROBABILISTIC_SAMPLER_SAMPLING_PERCENTAGE + value: 50 + traceAgent: + env: + - name: DD_OTLP_CONFIG_TRACES_PROBABILISTIC_SAMPLER_SAMPLING_PERCENTAGE + value: 50 ` t.Parallel() e2e.Run(t, &otlpIngestSamplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index dfe8064f5ad81..e2fddf8522589 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -32,8 +32,12 @@ datadog: enabled: true logs: enabled: true - metrics: - resource_attributes_as_tags: true +agents: + containers: + agent: + env: + - name: DD_OTLP_CONFIG_METRICS_RESOURCE_ATTRIBUTES_AS_TAGS + value: true ` t.Parallel() e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) diff --git a/test/new-e2e/tests/otel/otel-agent/config_test.go b/test/new-e2e/tests/otel/utils/config_utils.go similarity index 84% rename from test/new-e2e/tests/otel/otel-agent/config_test.go rename to test/new-e2e/tests/otel/utils/config_utils.go index 3c9f95c5fe82d..44cffac562ac3 100644 --- a/test/new-e2e/tests/otel/otel-agent/config_test.go +++ b/test/new-e2e/tests/otel/utils/config_utils.go @@ -3,12 +3,11 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package otelagent contains e2e otel agent tests -package otelagent +// Package utils contains util functions for OTel e2e tests +package utils import ( "context" - _ "embed" "strings" "github.com/stretchr/testify/assert" @@ -18,16 +17,18 @@ import ( "k8s.io/apimachinery/pkg/fields" ) -func (s *minimalTestSuite) TestOTelAgentInstalled() { - agent := s.getAgentPod() +// TestOTelAgentInstalled checks that the OTel Agent is installed in the test suite +func TestOTelAgentInstalled(s OTelTestSuite) { + agent := getAgentPod(s) assert.Contains(s.T(), agent.ObjectMeta.String(), "otel-agent") } -func (s *minimalTestSuite) TestOTelFlare() { +// TestOTelFlare tests that the OTel Agent flare functionality works as expected +func TestOTelFlare(s OTelTestSuite) { s.Env().FakeIntake.Client().FlushServerAndResetAggregators() s.T().Log("Starting flare") - agent := s.getAgentPod() + agent := getAgentPod(s) stdout, stderr, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agent.Name, "agent", []string{"agent", "flare", "--email", "e2e@test.com", "--send"}) require.NoError(s.T(), err, "Failed to execute flare") require.Empty(s.T(), stderr) @@ -59,7 +60,7 @@ func (s *minimalTestSuite) TestOTelFlare() { } } -func (s *minimalTestSuite) getAgentPod() corev1.Pod { +func getAgentPod(s OTelTestSuite) corev1.Pod { res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), }) From 393ca558f6a94269042818feeb9845a021425bda Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 16:46:57 -0400 Subject: [PATCH 10/47] Add prometheus test --- .../tests/otel/otel-agent/complete_test.go | 4 ++++ .../tests/otel/otel-agent/minimal_test.go | 4 ++++ test/new-e2e/tests/otel/utils/config_utils.go | 3 ++- .../tests/otel/utils/pipelines_utils.go | 21 +++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index ce972fad2a25a..51e6eaf7f9ac1 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -57,3 +57,7 @@ func (s *completeTestSuite) TestOTLPLogs() { func (s *completeTestSuite) TestHosts() { utils.TestHosts(s) } + +func (s *completeTestSuite) TestPrometheusMetrics() { + utils.TestPrometheusMetrics(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/minimal_test.go b/test/new-e2e/tests/otel/otel-agent/minimal_test.go index e98b02957162c..a1f9167f5623b 100644 --- a/test/new-e2e/tests/otel/otel-agent/minimal_test.go +++ b/test/new-e2e/tests/otel/otel-agent/minimal_test.go @@ -46,6 +46,10 @@ func (s *minimalTestSuite) TestHosts() { utils.TestHosts(s) } +func (s *minimalTestSuite) TestPrometheusMetrics() { + utils.TestPrometheusMetrics(s) +} + func (s *minimalTestSuite) TestOTelAgentInstalled() { utils.TestOTelAgentInstalled(s) } diff --git a/test/new-e2e/tests/otel/utils/config_utils.go b/test/new-e2e/tests/otel/utils/config_utils.go index 44cffac562ac3..4a292eaff129b 100644 --- a/test/new-e2e/tests/otel/utils/config_utils.go +++ b/test/new-e2e/tests/otel/utils/config_utils.go @@ -25,7 +25,8 @@ func TestOTelAgentInstalled(s OTelTestSuite) { // TestOTelFlare tests that the OTel Agent flare functionality works as expected func TestOTelFlare(s OTelTestSuite) { - s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) s.T().Log("Starting flare") agent := getAgentPod(s) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 7895762c2ae1d..8e294a75b1ccb 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -270,6 +270,27 @@ func TestSampling(s OTelTestSuite) { TestAPMStats(s, numTraces) } +// TestPrometheusMetrics tests that expected prometheus metrics are scraped +func TestPrometheusMetrics(s OTelTestSuite) { + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) + + var otelcolMetrics []*aggregator.MetricSeries + var traceAgentMetrics []*aggregator.MetricSeries + s.T().Log("Waiting for metrics") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + otelcolMetrics, err = s.Env().FakeIntake.Client().FilterMetrics("otelcol_process_uptime") + assert.NoError(c, err) + assert.NotEmpty(c, otelcolMetrics) + + traceAgentMetrics, err = s.Env().FakeIntake.Client().FilterMetrics("otelcol_datadog_trace_agent_trace_writer_spans") + assert.NoError(c, err) + assert.NotEmpty(c, traceAgentMetrics) + }, 2*time.Minute, 10*time.Second) + s.T().Log("Got otelcol_process_uptime", otelcolMetrics) + s.T().Log("Got otelcol_datadog_trace_agent_trace_writer_spans", traceAgentMetrics) +} + func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry string, options []string) { var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 var backOffLimit int32 = 4 From 9e8cf2eb1c1b8d97744bdbc527a043bda92f0d7a Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 16:48:27 -0400 Subject: [PATCH 11/47] Fix package comment --- test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go | 2 +- test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go index 22132cdc96e00..6b519ff57d6e5 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package otelagent contains e2e OTLP Ingest tests +// Package otlpingest contains e2e OTLP Ingest tests package otlpingest import ( diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index e2fddf8522589..edadbeba8cd8c 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package otelagent contains e2e OTLP Ingest tests +// Package otlpingest contains e2e OTLP Ingest tests package otlpingest import ( From 1a0cc2a50b5c56570c035e356ce35d82478f0a65 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 10 Sep 2024 16:51:07 -0400 Subject: [PATCH 12/47] Fix config --- test/new-e2e/tests/otel/otel-agent/complete_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index 51e6eaf7f9ac1..7aa926f6465cc 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -22,7 +22,7 @@ type completeTestSuite struct { e2e.BaseSuite[environments.Kubernetes] } -//go:embed config/minimal.yml +//go:embed config/complete.yml var completeConfig string func TestOTelAgentComplete(t *testing.T) { From 6cdef1bcee4ec9c756c404af8c98023f309c3134 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 11 Sep 2024 13:12:22 -0400 Subject: [PATCH 13/47] Fix helm values --- .../tests/otel/otel-agent/complete_test.go | 6 +--- .../tests/otel/otel-agent/config/complete.yml | 30 +++++++++---------- .../otlp-ingest/pipelines_sampling_test.go | 6 ++-- .../tests/otel/otlp-ingest/pipelines_test.go | 2 +- test/new-e2e/tests/otel/utils/config_utils.go | 1 + 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index 7aa926f6465cc..9e555a0dfa49f 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -29,14 +29,10 @@ func TestOTelAgentComplete(t *testing.T) { values := ` agents: containers: - agent: - env: - - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED - value: false otelAgent: env: - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED - value: false + value: 'false' ` t.Parallel() e2e.Run(t, &completeTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) diff --git a/test/new-e2e/tests/otel/otel-agent/config/complete.yml b/test/new-e2e/tests/otel/otel-agent/config/complete.yml index f8a2b0265b9c9..5edc6e01b056e 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/complete.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/complete.yml @@ -5,7 +5,7 @@ receivers: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 - prometheus/dd-autoconfigured: + prometheus: config: scrape_configs: - job_name: 'datadog-agent' @@ -23,7 +23,7 @@ exporters: key: ${DD_API_KEY} processors: batch: - infraattributes/dd-autoconfigured: + infraattributes: connectors: # Use datadog connector to compute stats for pre-sampled traces datadog/connector: @@ -33,33 +33,33 @@ connectors: compute_top_level_by_span_kind: true peer_tags_aggregation: true extensions: - pprof/dd-autoconfigured: - health_check/dd-autoconfigured: - zpages/dd-autoconfigured: + pprof: + health_check: + zpages: endpoint: "localhost:55679" - ddflare/dd-autoconfigured: + ddflare: service: extensions: [ - pprof/dd-autoconfigured, - zpages/dd-autoconfigured, - health_check/dd-autoconfigured, - ddflare/dd-autoconfigured, + pprof, + zpages, + health_check, + ddflare, ] pipelines: traces: receivers: [otlp] - processors: [batch, infraattributes/dd-autoconfigured] + processors: [batch, infraattributes] exporters: [datadog/connector] traces/send: receivers: [otlp] - processors: [batch, infraattributes/dd-autoconfigured] + processors: [batch, infraattributes] exporters: [datadog] metrics: - receivers: [otlp, datadog/connector, prometheus/dd-autoconfigured] - processors: [batch, infraattributes/dd-autoconfigured] + receivers: [otlp, datadog/connector, prometheus] + processors: [batch, infraattributes] exporters: [datadog] logs: receivers: [otlp] - processors: [batch, infraattributes/dd-autoconfigured] + processors: [batch, infraattributes] exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go index 6b519ff57d6e5..861dcb7132a81 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_sampling_test.go @@ -37,13 +37,13 @@ agents: agent: env: - name: DD_OTLP_CONFIG_METRICS_RESOURCE_ATTRIBUTES_AS_TAGS - value: true + value: 'true' - name: DD_OTLP_CONFIG_TRACES_PROBABILISTIC_SAMPLER_SAMPLING_PERCENTAGE - value: 50 + value: '50' traceAgent: env: - name: DD_OTLP_CONFIG_TRACES_PROBABILISTIC_SAMPLER_SAMPLING_PERCENTAGE - value: 50 + value: '50' ` t.Parallel() e2e.Run(t, &otlpIngestSamplingTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index edadbeba8cd8c..a714c8a50109b 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -37,7 +37,7 @@ agents: agent: env: - name: DD_OTLP_CONFIG_METRICS_RESOURCE_ATTRIBUTES_AS_TAGS - value: true + value: 'true' ` t.Parallel() e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) diff --git a/test/new-e2e/tests/otel/utils/config_utils.go b/test/new-e2e/tests/otel/utils/config_utils.go index 4a292eaff129b..8ef614c8fcebd 100644 --- a/test/new-e2e/tests/otel/utils/config_utils.go +++ b/test/new-e2e/tests/otel/utils/config_utils.go @@ -54,6 +54,7 @@ func TestOTelFlare(s OTelTestSuite) { assert.True(s.T(), otelFolder) assert.True(s.T(), otelFlareFolder) otelResponseContent, err := flare.GetFileContent(otelResponse) + s.T().Log("Got flare otel-response.json", otelResponseContent) require.NoError(s.T(), err) expectedContents := []string{"otel-agent", "ddflare/dd-autoconfigured:", "health_check/dd-autoconfigured:", "pprof/dd-autoconfigured:", "zpages/dd-autoconfigured:", "infraattributes/dd-autoconfigured:", "prometheus/dd-autoconfigured:", "key: '[REDACTED]'"} for _, expected := range expectedContents { From 12454772eeacc89ffa82ef16d20e1a9a8fcf0345 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 12 Sep 2024 11:22:01 -0400 Subject: [PATCH 14/47] Move batch --- test/new-e2e/tests/otel/otel-agent/config/sampling.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new-e2e/tests/otel/otel-agent/config/sampling.yml b/test/new-e2e/tests/otel/otel-agent/config/sampling.yml index 33a84ae3d068f..8649ca48032c7 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/sampling.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/sampling.yml @@ -34,7 +34,7 @@ service: exporters: [datadog/connector] traces/send: receivers: [datadog/connector] - processors: [batch, probabilistic_sampler] + processors: [probabilistic_sampler, batch] exporters: [datadog] metrics: receivers: [otlp, datadog/connector] From cfc84e705ec164b5164e280577c2fe1c605d7c72 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 18 Sep 2024 16:13:22 -0400 Subject: [PATCH 15/47] Add temp tests --- .../tests/otel/otel-agent/config/ia.yml | 64 +++++++ .../infraattributes_disabled_test.go | 51 ++++++ .../otel/otel-agent/infraattributes_test.go | 39 ++++ .../tests/otel/utils/pipelines_utils.go | 172 ++++++++++++++++++ 4 files changed, 326 insertions(+) create mode 100644 test/new-e2e/tests/otel/otel-agent/config/ia.yml create mode 100644 test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go create mode 100644 test/new-e2e/tests/otel/otel-agent/infraattributes_test.go diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia.yml b/test/new-e2e/tests/otel/otel-agent/config/ia.yml new file mode 100644 index 0000000000000..68dfabb111b51 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/config/ia.yml @@ -0,0 +1,64 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + prometheus: + config: + scrape_configs: + - job_name: 'datadog-agent' + scrape_interval: 10s + static_configs: + - targets: [ '0.0.0.0:8888' ] +exporters: + datadog: + traces: + span_name_as_resource_name: true + metrics: + resource_attributes_as_tags: true + hostname: "otelcol-docker" + api: + key: ${DD_API_KEY} +processors: + batch: +connectors: + # Use datadog connector to compute stats for pre-sampled traces + datadog/connector: + traces: + span_name_as_resource_name: true + compute_stats_by_span_kind: true + compute_top_level_by_span_kind: true + peer_tags_aggregation: true +extensions: + pprof: + health_check: + zpages: + endpoint: "localhost:55679" + ddflare: +service: + extensions: + [ + pprof, + zpages, + health_check, + ddflare, + ] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [datadog/connector] + traces/send: + receivers: [otlp] + processors: [batch] + exporters: [datadog] + metrics: + receivers: [otlp, datadog/connector, prometheus] + processors: [batch] + exporters: [datadog] + logs: + receivers: [otlp] + processors: [batch] + exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go new file mode 100644 index 0000000000000..e471005bafeee --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go @@ -0,0 +1,51 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type iaDisabledTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed config/ia.yml +var iaDisabledConfig string + +func TestOTelAgentIADisabled(t *testing.T) { + values := ` +agents: + containers: + agent: + env: + - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED + value: 'false' + otelAgent: + env: + - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED + value: 'false' +` + t.Parallel() + e2e.Run(t, &iaDisabledTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) +} + +func (s *iaDisabledTestSuite) TestOTLPMetrics() { + utils.TestContainerMetrics(s) +} + +func (s *iaDisabledTestSuite) TestOTelFlare() { + utils.TestOTelFlare(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go new file mode 100644 index 0000000000000..cae5a583dfc3c --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -0,0 +1,39 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type iaTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed config/ia.yml +var iaConfig string + +func TestOTelAgentIA(t *testing.T) { + t.Parallel() + e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) +} + +func (s *iaTestSuite) TestOTLPMetrics() { + utils.TestContainerMetrics(s) +} + +func (s *iaTestSuite) TestOTelFlare() { + utils.TestOTelFlare(s) +} diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 8e294a75b1ccb..8d991703bf969 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -15,9 +15,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" @@ -347,6 +350,175 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin require.NoError(s.T(), err, "Could not properly start job") } +func createApp(ctx context.Context, s OTelTestSuite) { + var replicas int32 = 1 + + otlpEndpoint := fmt.Sprintf("otlp://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) + serviceSpec := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "manual-container-metrics-app", + Labels: map[string]string{ + "helm.sh/chart": "manual-container-metrics-app-0.1.0", + "app.kubernetes.io/name": "manual-container-metrics-app", + "app.kubernetes.io/instance": "manual-container-metrics-app", + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", + }, + Annotations: map[string]string{ + "openshift.io/deployment.name": "openshift", + }, + }, + Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + Ports: []corev1.ServicePort{ + { + Port: 3000, + TargetPort: intstr.IntOrString{ + StrVal: "http", + }, + Protocol: "TCP", + Name: "http", + }, + }, + Selector: map[string]string{ + "app.kubernetes.io/name": "manual-container-metrics-app", + "app.kubernetes.io/instance": "manual-container-metrics-app", + }, + }, + } + deploymentSpec := &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "manual-container-metrics-app", + Labels: map[string]string{ + "helm.sh/chart": "manual-container-metrics-app-0.1.0", + "app.kubernetes.io/name": "manual-container-metrics-app", + "app.kubernetes.io/instance": "manual-container-metrics-app", + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", + }, + Annotations: map[string]string{ + "openshift.io/deployment.name": "openshift", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app.kubernetes.io/name": "manual-container-metrics-app", + "app.kubernetes.io/instance": "manual-container-metrics-app", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app.kubernetes.io/name": "manual-container-metrics-app", + "app.kubernetes.io/instance": "manual-container-metrics-app", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{{ + Name: "manual-container-metrics-app", + Image: "datadog/opentelemetry-examples:manual-container-metrics-app-v1.0.5", + ImagePullPolicy: "IfNotPresent", + Ports: []corev1.ContainerPort{{ + Name: "http", + ContainerPort: 3000, + Protocol: "TCP", + }}, + LivenessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/liveness", + Port: intstr.FromString("http"), + }, + }, + }, + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/readiness", + Port: intstr.FromString("http"), + }, + }, + }, + Env: []corev1.EnvVar{{ + Name: "OTEL_SERVICE_NAME", + Value: "manual-container-metrics-app", + }, { + Name: "OTEL_CONTAINER_NAME", + Value: "manual-container-metrics-app", + }, { + Name: "OTEL_K8S_CONTAINER_ID", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, + }, { + Name: "OTEL_K8S_NAMESPACE", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, + }, { + Name: "OTEL_K8S_NODE_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, + }, { + Name: "OTEL_K8S_POD_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, { + Name: "OTEL_EXPORTER_OTLP_ENDPOINT", + Value: otlpEndpoint, + }, { + Name: "OTEL_EXPORTER_OTLP_PROTOCOL", + Value: "grpc", + }, { + Name: "OTEL_RESOURCE_ATTRIBUTES", + Value: "service.name=$(OTEL_SERVICE_NAME)," + + //"k8s.namespace.name=$(OTEL_K8S_NAMESPACE)," + + //"k8s.node.name=$(OTEL_K8S_NODE_NAME)," + + //"k8s.pod.name=$(OTEL_K8S_POD_NAME)," + + //"k8s.container.name=manual-container-metrics-app," + + "host.name=$(OTEL_K8S_NODE_NAME)," + + "deployment.environment=$(OTEL_K8S_NAMESPACE)," + + //"container.name=$(OTEL_CONTAINER_NAME)," + + "container.id=$(OTEL_K8S_CONTAINER_ID)", + }}, + Resources: corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("1Gi"), + }, + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("1"), + corev1.ResourceMemory: resource.MustParse("1Gi"), + }, + }, + }, + }, + }, + }, + }, + } + + _, err := s.Env().KubernetesCluster.Client().CoreV1().Services("datadog").Create(ctx, serviceSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start service") + _, err = s.Env().KubernetesCluster.Client().AppsV1().Deployments("datadog").Create(ctx, deploymentSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start deployment") +} + +// TestContainerMetrics tests that OTLP metrics are received through OTel pipelines as expected +func TestContainerMetrics(s OTelTestSuite) { + ctx := context.Background() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) + + s.T().Log("Starting app") + createApp(ctx, s) + + var metrics []*aggregator.MetricSeries + s.T().Log("Waiting for metrics") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("container.cpu.usage", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service:manual-container-metrics-app"})) + assert.NoError(c, err) + assert.NotEmpty(c, metrics) + }, 5*time.Minute, 10*time.Second) + s.T().Log("Got metrics", metrics) +} + func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { ctags, ok := tp.Tags["_dd.tags.container"] if !ok { From c559ae63ed65fef661209030febf75a90078395f Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 18 Sep 2024 16:29:27 -0400 Subject: [PATCH 16/47] Fix config --- .../tests/otel/otel-agent/infraattributes_disabled_test.go | 2 +- test/new-e2e/tests/otel/otel-agent/infraattributes_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go index e471005bafeee..413d03a5350d6 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go @@ -39,7 +39,7 @@ agents: value: 'false' ` t.Parallel() - e2e.Run(t, &iaDisabledTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) + e2e.Run(t, &iaDisabledTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaDisabledConfig))))) } func (s *iaDisabledTestSuite) TestOTLPMetrics() { diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go index cae5a583dfc3c..b97d58cdb3374 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -27,7 +27,7 @@ var iaConfig string func TestOTelAgentIA(t *testing.T) { t.Parallel() - e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) + e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } func (s *iaTestSuite) TestOTLPMetrics() { From 8ff38a161f17165e0a2b88208a011ccc674bec3b Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Fri, 20 Sep 2024 12:53:22 -0400 Subject: [PATCH 17/47] Remove resources --- test/new-e2e/tests/otel/utils/pipelines_utils.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 8d991703bf969..2f17b2dc7e954 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -18,7 +18,6 @@ import ( appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -477,16 +476,6 @@ func createApp(ctx context.Context, s OTelTestSuite) { //"container.name=$(OTEL_CONTAINER_NAME)," + "container.id=$(OTEL_K8S_CONTAINER_ID)", }}, - Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("1Gi"), - }, - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("1Gi"), - }, - }, }, }, }, From b4dd2f039c231a92f08afcb890cdbbde38e6d67a Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Mon, 23 Sep 2024 17:23:34 -0400 Subject: [PATCH 18/47] test --- .../processor/infraattributesprocessor/metrics.go | 11 +++++++++-- test/new-e2e/tests/otel/utils/pipelines_utils.go | 8 ++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go index e7a8cb3d7a700..cf6b3540b5e24 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go @@ -93,6 +93,9 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md for i := 0; i < rms.Len(); i++ { resourceAttributes := rms.At(i).Resource().Attributes() entityIDs := entityIDsFromAttributes(resourceAttributes, iamp.generateID) + for i2, e := range entityIDs { + md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_id.%v", i2), e.String()) + } tagMap := make(map[string]string) // Get all unique tags from resource attributes and global tags @@ -102,28 +105,32 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md iamp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) continue } - for _, tag := range entityTags { + + for i2, tag := range entityTags { k, v := splitTag(tag) _, hasTag := tagMap[k] if k != "" && v != "" && !hasTag { tagMap[k] = v } + md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_tag.%v", i2), tag) } } globalTags, err := iamp.tagger.GlobalTags(iamp.cardinality) if err != nil { iamp.logger.Error("Cannot get global tags", zap.Error(err)) } - for _, tag := range globalTags { + for i2, tag := range globalTags { k, v := splitTag(tag) _, hasTag := tagMap[k] if k != "" && v != "" && !hasTag { tagMap[k] = v } + md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("global_tag.%v", i2), tag) } // Add all tags as resource attributes for k, v := range tagMap { + md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("tag_map.%v", k), v) resourceAttributes.PutStr(k, v) } } diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 2f17b2dc7e954..ab89d2213341a 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -312,6 +312,9 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin Env: []corev1.EnvVar{{ Name: "OTEL_SERVICE_NAME", Value: service, + }, { + Name: "OTEL_K8S_POD_ID", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, }, { Name: "OTEL_K8S_NAMESPACE", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, @@ -334,6 +337,7 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin "--otlp-attributes", "k8s.namespace.name=\"$(OTEL_K8S_NAMESPACE)\"", "--otlp-attributes", "k8s.node.name=\"$(OTEL_K8S_NODE_NAME)\"", "--otlp-attributes", "k8s.pod.name=\"$(OTEL_K8S_POD_NAME)\"", + "--otlp-attributes", "k8s.pod.uid=\"$(OTEL_K8S_POD_ID)\"", "--otlp-attributes", "k8s.container.name=\"telemetrygen-job\"", }, options...), }, @@ -474,7 +478,7 @@ func createApp(ctx context.Context, s OTelTestSuite) { "host.name=$(OTEL_K8S_NODE_NAME)," + "deployment.environment=$(OTEL_K8S_NAMESPACE)," + //"container.name=$(OTEL_CONTAINER_NAME)," + - "container.id=$(OTEL_K8S_CONTAINER_ID)", + "k8s.pod.uid=$(OTEL_K8S_CONTAINER_ID)", }}, }, }, @@ -501,7 +505,7 @@ func TestContainerMetrics(s OTelTestSuite) { var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("container.cpu.usage", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service:manual-container-metrics-app"})) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("container.cpu.usage", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:manual-container-metrics-app"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) }, 5*time.Minute, 10*time.Second) From 0e4ad1f871f31e681d38ebf444486418cdd1d1d5 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 24 Sep 2024 10:09:20 -0400 Subject: [PATCH 19/47] logs --- .../processor/infraattributesprocessor/metrics.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go index cf6b3540b5e24..08b99c862cb0a 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go @@ -95,14 +95,17 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md entityIDs := entityIDsFromAttributes(resourceAttributes, iamp.generateID) for i2, e := range entityIDs { md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_id.%v", i2), e.String()) + fmt.Printf("entity_id.%v:%v\n", i2, e.String()) } tagMap := make(map[string]string) // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { - entityTags, err := iamp.tagger.Tag(entityID.String(), iamp.cardinality) + entityTags, err := iamp.tagger.Tag(entityID.String(), types.HighCardinality) if err != nil { + md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_error.%v", entityID.String()), err.Error()) iamp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) + fmt.Printf("entity_error.%v:%v\n", entityID.String(), err.Error()) continue } @@ -113,6 +116,7 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md tagMap[k] = v } md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_tag.%v", i2), tag) + fmt.Printf("entity_tag.%v:%v\n", i2, tag) } } globalTags, err := iamp.tagger.GlobalTags(iamp.cardinality) @@ -126,11 +130,13 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md tagMap[k] = v } md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("global_tag.%v", i2), tag) + fmt.Printf("global_tag.%v:%v\n", i2, tag) } // Add all tags as resource attributes for k, v := range tagMap { md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("tag_map.%v", k), v) + fmt.Printf("tag_map.%v:%v\n", k, v) resourceAttributes.PutStr(k, v) } } From bb09c039760249ef3f9b2f6293b4b7ef6972e1f8 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 24 Sep 2024 11:13:10 -0400 Subject: [PATCH 20/47] tagger logs --- comp/core/tagger/taggerimpl/local/tagger.go | 9 +++++++++ comp/core/tagger/taggerimpl/tagger.go | 7 +++++++ comp/core/tagger/taggerimpl/tagstore/tagstore.go | 2 ++ 3 files changed, 18 insertions(+) diff --git a/comp/core/tagger/taggerimpl/local/tagger.go b/comp/core/tagger/taggerimpl/local/tagger.go index 5a0d1dbf31afd..57b4c854e0a67 100644 --- a/comp/core/tagger/taggerimpl/local/tagger.go +++ b/comp/core/tagger/taggerimpl/local/tagger.go @@ -76,12 +76,14 @@ func (t *Tagger) Stop() error { // getTags returns a read only list of tags for a given entity. func (t *Tagger) getTags(entityID types.EntityID, cardinality types.TagCardinality) (tagset.HashedTags, error) { + fmt.Printf("---- getTags: entityID.String():%v, entityID.GetID():%v, cardinality:%v ----\n", entityID.String(), entityID.GetID(), cardinality) if entityID.GetID() == "" { t.telemetryStore.QueriesByCardinality(cardinality).EmptyEntityID.Inc() return tagset.HashedTags{}, fmt.Errorf("empty entity ID") } cachedTags := t.tagStore.LookupHashed(entityID, cardinality) + fmt.Printf("---- cachedTags.Get():%v ----\n", cachedTags.Get()) t.telemetryStore.QueriesByCardinality(cardinality).Success.Inc() return cachedTags, nil @@ -97,11 +99,18 @@ func (t *Tagger) AccumulateTagsFor(entityID string, cardinality types.TagCardina // Tag returns a copy of the tags for a given entity func (t *Tagger) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { + fmt.Printf("---- Tag: entityID:%v, cardinality:%v ----\n", entityID, cardinality) + list := t.List() + for k, v := range list.Entities { + fmt.Printf("---- Entities: entity:%v, tags:%v ----\n", k, v.Tags) + } id, _ := types.NewEntityIDFromString(entityID) tags, err := t.getTags(id, cardinality) if err != nil { + fmt.Printf("---- err:%v ----\n", err.Error()) return nil, err } + fmt.Printf("---- tags.Copy():%v ----\n", tags.Copy()) return tags.Copy(), nil } diff --git a/comp/core/tagger/taggerimpl/tagger.go b/comp/core/tagger/taggerimpl/tagger.go index 87bd87086b736..dab318534d3fc 100644 --- a/comp/core/tagger/taggerimpl/tagger.go +++ b/comp/core/tagger/taggerimpl/tagger.go @@ -9,6 +9,7 @@ package taggerimpl import ( "context" "encoding/json" + "fmt" "net/http" "reflect" "strconv" @@ -260,6 +261,11 @@ func (t *TaggerClient) GetEntity(entityID string) (*types.Entity, error) { // It can return tags at high cardinality (with tags about individual containers), // or at orchestrator cardinality (pod/task level). func (t *TaggerClient) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { + list := t.defaultTagger.List() + for k, v := range list.Entities { + fmt.Printf("---- default tagger entities: entity:%v, tags:%v ----\n", k, v.Tags) + } + // TODO: defer unlock once performance overhead of defer is negligible t.mux.RLock() if t.captureTagger != nil { @@ -336,6 +342,7 @@ func (t *TaggerClient) AgentTags(cardinality types.TagCardinality) ([]string, er // GlobalTags queries global tags that should apply to all data coming from the // agent. func (t *TaggerClient) GlobalTags(cardinality types.TagCardinality) ([]string, error) { + fmt.Printf("---- taggercommon.GetGlobalEntityID().String():%v ----\n", taggercommon.GetGlobalEntityID().String()) t.mux.RLock() if t.captureTagger != nil { tags, err := t.captureTagger.Tag(taggercommon.GetGlobalEntityID().String(), cardinality) diff --git a/comp/core/tagger/taggerimpl/tagstore/tagstore.go b/comp/core/tagger/taggerimpl/tagstore/tagstore.go index 020128c06b2df..95e7c9870af5f 100644 --- a/comp/core/tagger/taggerimpl/tagstore/tagstore.go +++ b/comp/core/tagger/taggerimpl/tagstore/tagstore.go @@ -10,6 +10,7 @@ package tagstore import ( "context" "errors" + "fmt" "reflect" "sync" "time" @@ -252,6 +253,7 @@ func (s *TagStore) LookupHashed(entityID types.EntityID, cardinality types.TagCa s.RLock() defer s.RUnlock() storedTags, present := s.store.Get(entityID) + fmt.Printf("---- storedTags.tagsBySource():%v, present:%v ----\n", storedTags.tagsBySource(), present) if !present { return tagset.HashedTags{} From 44d704aca1129448f42e7c1ef5d2eed0792afc91 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 24 Sep 2024 11:58:17 -0400 Subject: [PATCH 21/47] tagger logs --- comp/core/tagger/taggerimpl/tagger.go | 12 ++++++++---- comp/core/tagger/taggerimpl/tagstore/tagstore.go | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/comp/core/tagger/taggerimpl/tagger.go b/comp/core/tagger/taggerimpl/tagger.go index dab318534d3fc..9de8b9bffefae 100644 --- a/comp/core/tagger/taggerimpl/tagger.go +++ b/comp/core/tagger/taggerimpl/tagger.go @@ -261,9 +261,11 @@ func (t *TaggerClient) GetEntity(entityID string) (*types.Entity, error) { // It can return tags at high cardinality (with tags about individual containers), // or at orchestrator cardinality (pod/task level). func (t *TaggerClient) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { - list := t.defaultTagger.List() - for k, v := range list.Entities { - fmt.Printf("---- default tagger entities: entity:%v, tags:%v ----\n", k, v.Tags) + if t.defaultTagger != nil { + list := t.defaultTagger.List() + for k, v := range list.Entities { + fmt.Printf("---- default tagger entities: entity:%v, tags:%v ----\n", k, v.Tags) + } } // TODO: defer unlock once performance overhead of defer is negligible @@ -342,7 +344,9 @@ func (t *TaggerClient) AgentTags(cardinality types.TagCardinality) ([]string, er // GlobalTags queries global tags that should apply to all data coming from the // agent. func (t *TaggerClient) GlobalTags(cardinality types.TagCardinality) ([]string, error) { - fmt.Printf("---- taggercommon.GetGlobalEntityID().String():%v ----\n", taggercommon.GetGlobalEntityID().String()) + if taggercommon.GetGlobalEntityID() != nil { + fmt.Printf("---- taggercommon.GetGlobalEntityID().String():%v ----\n", taggercommon.GetGlobalEntityID().String()) + } t.mux.RLock() if t.captureTagger != nil { tags, err := t.captureTagger.Tag(taggercommon.GetGlobalEntityID().String(), cardinality) diff --git a/comp/core/tagger/taggerimpl/tagstore/tagstore.go b/comp/core/tagger/taggerimpl/tagstore/tagstore.go index 95e7c9870af5f..731b6d74a3d6b 100644 --- a/comp/core/tagger/taggerimpl/tagstore/tagstore.go +++ b/comp/core/tagger/taggerimpl/tagstore/tagstore.go @@ -253,7 +253,9 @@ func (s *TagStore) LookupHashed(entityID types.EntityID, cardinality types.TagCa s.RLock() defer s.RUnlock() storedTags, present := s.store.Get(entityID) - fmt.Printf("---- storedTags.tagsBySource():%v, present:%v ----\n", storedTags.tagsBySource(), present) + if storedTags != nil { + fmt.Printf("---- storedTags.tagsBySource():%v, present:%v ----\n", storedTags.tagsBySource(), present) + } if !present { return tagset.HashedTags{} From ac65eaaa8e4d5a90861bb2ffebc0e1499255e1cb Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 24 Sep 2024 13:24:08 -0400 Subject: [PATCH 22/47] use remote tagger --- cmd/otel-agent/subcommands/run/command.go | 8 ++++++-- comp/core/tagger/taggerimpl/remote/tagger.go | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cmd/otel-agent/subcommands/run/command.go b/cmd/otel-agent/subcommands/run/command.go index 2373bc4453363..d7722d8eac404 100644 --- a/cmd/otel-agent/subcommands/run/command.go +++ b/cmd/otel-agent/subcommands/run/command.go @@ -14,6 +14,7 @@ import ( "github.com/spf13/cobra" "go.opentelemetry.io/collector/confmap" + "github.com/DataDog/datadog-agent/cmd/agent/common" agentConfig "github.com/DataDog/datadog-agent/cmd/otel-agent/config" "github.com/DataDog/datadog-agent/cmd/otel-agent/subcommands" "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl" @@ -116,7 +117,10 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, pkgconfigenv.DetectFeatures(c) return c, nil }), - workloadmetafx.Module(workloadmeta.NewParams()), + workloadmetafx.Module(workloadmeta.Params{ + AgentType: workloadmeta.NodeAgent, + InitHelper: common.GetWorkloadmetaInit(), + }), fx.Provide(func() []string { return append(params.ConfPaths, params.Sets...) }), @@ -165,7 +169,7 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, return configsyncimpl.NewParams(params.SyncTimeout, params.SyncDelay, true) }), - fx.Provide(tagger.NewTaggerParams), + fx.Provide(tagger.NewNodeRemoteTaggerParams), taggerimpl.Module(), telemetryimpl.Module(), fx.Provide(func(cfg traceconfig.Component) telemetry.TelemetryCollector { diff --git a/comp/core/tagger/taggerimpl/remote/tagger.go b/comp/core/tagger/taggerimpl/remote/tagger.go index e0a7d7ec01f17..a310d9aae6d02 100644 --- a/comp/core/tagger/taggerimpl/remote/tagger.go +++ b/comp/core/tagger/taggerimpl/remote/tagger.go @@ -198,11 +198,19 @@ func (t *Tagger) GetTaggerTelemetryStore() *telemetry.Store { // Tag returns tags for a given entity at the desired cardinality. func (t *Tagger) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { + fmt.Printf("---- Remote Tag: entityID:%v, cardinality:%v ----\n", entityID, cardinality) + list := t.List() + for k, v := range list.Entities { + fmt.Printf("---- Remote Entities: entity:%v, tags:%v ----\n", k, v.Tags) + } id, _ := types.NewEntityIDFromString(entityID) entity := t.store.getEntity(id) if entity != nil { + fmt.Printf("---- entity.LowCardinalityTags():%v ----\n", entity.LowCardinalityTags) + tgs := entity.GetTags(cardinality) + fmt.Printf("---- entity.GetTags():%v ----\n", tgs) t.telemetryStore.QueriesByCardinality(cardinality).Success.Inc() - return entity.GetTags(cardinality), nil + return tgs, nil } t.telemetryStore.QueriesByCardinality(cardinality).EmptyTags.Inc() From 7d148c886b6ca960c4aee55534b0028a11428b8b Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 24 Sep 2024 15:50:52 -0400 Subject: [PATCH 23/47] Add calendar app --- .../tests/otel/utils/pipelines_utils.go | 139 +++++++++++++++++- 1 file changed, 137 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index ab89d2213341a..b0f373650137d 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -353,6 +353,141 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin require.NoError(s.T(), err, "Could not properly start job") } +func createCalendarApp(ctx context.Context, s OTelTestSuite) { + var replicas int32 = 1 + + otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) + serviceSpec := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "calendar-java-otel", + Labels: map[string]string{ + "helm.sh/chart": "calendar-java-otel-0.1.0", + "app.kubernetes.io/name": "calendar-java-otel", + "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", + }, + Annotations: map[string]string{ + "openshift.io/deployment.name": "openshift", + }, + }, + Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + Ports: []corev1.ServicePort{ + { + Port: 9090, + TargetPort: intstr.IntOrString{ + StrVal: "http", + }, + Protocol: "TCP", + Name: "http", + }, + }, + Selector: map[string]string{ + "app.kubernetes.io/name": "calendar-java-otel", + "app.kubernetes.io/instance": "calendar-java-otel", + }, + }, + } + deploymentSpec := &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "calendar-java-otel", + Labels: map[string]string{ + "helm.sh/chart": "calendar-java-otel-0.1.0", + "app.kubernetes.io/name": "calendar-java-otel", + "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", + }, + Annotations: map[string]string{ + "openshift.io/deployment.name": "openshift", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app.kubernetes.io/name": "calendar-java-otel", + "app.kubernetes.io/instance": "calendar-java-otel", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app.kubernetes.io/name": "calendar-java-otel", + "app.kubernetes.io/instance": "calendar-java-otel", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{{ + Name: "calendar-java-otel", + Image: "datadog/opentelemetry-examples:calendar-java-20240826", + ImagePullPolicy: "IfNotPresent", + Ports: []corev1.ContainerPort{{ + Name: "http", + ContainerPort: 9090, + Protocol: "TCP", + }}, + LivenessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/calendar", + Port: intstr.FromString("http"), + }, + }, + }, + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/calendar", + Port: intstr.FromString("http"), + }, + }, + }, + Env: []corev1.EnvVar{{ + Name: "OTEL_SERVICE_NAME", + Value: "calendar-java-otel", + }, { + Name: "OTEL_CONTAINER_NAME", + Value: "calendar-java-otel", + }, { + Name: "OTEL_K8S_NAMESPACE", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, + }, { + Name: "OTEL_K8S_NODE_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, + }, { + Name: "OTEL_K8S_POD_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, { + Name: "OTEL_EXPORTER_OTLP_ENDPOINT", + Value: otlpEndpoint, + }, { + Name: "OTEL_EXPORTER_OTLP_PROTOCOL", + Value: "grpc", + }, { + Name: "OTEL_RESOURCE_ATTRIBUTES", + Value: "service.name=$(OTEL_SERVICE_NAME)," + + "k8s.namespace.name=$(OTEL_K8S_NAMESPACE)," + + "k8s.node.name=$(OTEL_K8S_NODE_NAME)," + + "k8s.pod.name=$(OTEL_K8S_POD_NAME)," + + "k8s.container.name=calendar-java-otel," + + "host.name=$(OTEL_K8S_NODE_NAME)," + + "deployment.environment=$(OTEL_K8S_NAMESPACE)", + }}, + }, + }, + }, + }, + }, + } + + _, err := s.Env().KubernetesCluster.Client().CoreV1().Services("datadog").Create(ctx, serviceSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start service") + _, err = s.Env().KubernetesCluster.Client().AppsV1().Deployments("datadog").Create(ctx, deploymentSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start deployment") +} + func createApp(ctx context.Context, s OTelTestSuite) { var replicas int32 = 1 @@ -500,12 +635,12 @@ func TestContainerMetrics(s OTelTestSuite) { require.NoError(s.T(), err) s.T().Log("Starting app") - createApp(ctx, s) + createCalendarApp(ctx, s) var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("container.cpu.usage", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:manual-container-metrics-app"})) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar.api.hits", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-java-otel"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) }, 5*time.Minute, 10*time.Second) From 6f28048d61f5711da928f1af6a8bce8fb1461ce1 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 24 Sep 2024 16:05:51 -0400 Subject: [PATCH 24/47] Fix lint --- .../tests/otel/utils/pipelines_utils.go | 140 ------------------ 1 file changed, 140 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index b0f373650137d..abfd9d78ad3f5 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -488,146 +488,6 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { require.NoError(s.T(), err, "Could not properly start deployment") } -func createApp(ctx context.Context, s OTelTestSuite) { - var replicas int32 = 1 - - otlpEndpoint := fmt.Sprintf("otlp://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) - serviceSpec := &corev1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: "manual-container-metrics-app", - Labels: map[string]string{ - "helm.sh/chart": "manual-container-metrics-app-0.1.0", - "app.kubernetes.io/name": "manual-container-metrics-app", - "app.kubernetes.io/instance": "manual-container-metrics-app", - "app.kubernetes.io/version": "1.16.0", - "app.kubernetes.io/managed-by": "Helm", - }, - Annotations: map[string]string{ - "openshift.io/deployment.name": "openshift", - }, - }, - Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, - Ports: []corev1.ServicePort{ - { - Port: 3000, - TargetPort: intstr.IntOrString{ - StrVal: "http", - }, - Protocol: "TCP", - Name: "http", - }, - }, - Selector: map[string]string{ - "app.kubernetes.io/name": "manual-container-metrics-app", - "app.kubernetes.io/instance": "manual-container-metrics-app", - }, - }, - } - deploymentSpec := &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "manual-container-metrics-app", - Labels: map[string]string{ - "helm.sh/chart": "manual-container-metrics-app-0.1.0", - "app.kubernetes.io/name": "manual-container-metrics-app", - "app.kubernetes.io/instance": "manual-container-metrics-app", - "app.kubernetes.io/version": "1.16.0", - "app.kubernetes.io/managed-by": "Helm", - }, - Annotations: map[string]string{ - "openshift.io/deployment.name": "openshift", - }, - }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app.kubernetes.io/name": "manual-container-metrics-app", - "app.kubernetes.io/instance": "manual-container-metrics-app", - }, - }, - Template: corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "app.kubernetes.io/name": "manual-container-metrics-app", - "app.kubernetes.io/instance": "manual-container-metrics-app", - }, - }, - Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: "manual-container-metrics-app", - Image: "datadog/opentelemetry-examples:manual-container-metrics-app-v1.0.5", - ImagePullPolicy: "IfNotPresent", - Ports: []corev1.ContainerPort{{ - Name: "http", - ContainerPort: 3000, - Protocol: "TCP", - }}, - LivenessProbe: &corev1.Probe{ - ProbeHandler: corev1.ProbeHandler{ - HTTPGet: &corev1.HTTPGetAction{ - Path: "/liveness", - Port: intstr.FromString("http"), - }, - }, - }, - ReadinessProbe: &corev1.Probe{ - ProbeHandler: corev1.ProbeHandler{ - HTTPGet: &corev1.HTTPGetAction{ - Path: "/readiness", - Port: intstr.FromString("http"), - }, - }, - }, - Env: []corev1.EnvVar{{ - Name: "OTEL_SERVICE_NAME", - Value: "manual-container-metrics-app", - }, { - Name: "OTEL_CONTAINER_NAME", - Value: "manual-container-metrics-app", - }, { - Name: "OTEL_K8S_CONTAINER_ID", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, - }, { - Name: "OTEL_K8S_NAMESPACE", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, - }, { - Name: "OTEL_K8S_NODE_NAME", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, - }, { - Name: "OTEL_K8S_POD_NAME", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, - }, { - Name: "OTEL_EXPORTER_OTLP_ENDPOINT", - Value: otlpEndpoint, - }, { - Name: "OTEL_EXPORTER_OTLP_PROTOCOL", - Value: "grpc", - }, { - Name: "OTEL_RESOURCE_ATTRIBUTES", - Value: "service.name=$(OTEL_SERVICE_NAME)," + - //"k8s.namespace.name=$(OTEL_K8S_NAMESPACE)," + - //"k8s.node.name=$(OTEL_K8S_NODE_NAME)," + - //"k8s.pod.name=$(OTEL_K8S_POD_NAME)," + - //"k8s.container.name=manual-container-metrics-app," + - "host.name=$(OTEL_K8S_NODE_NAME)," + - "deployment.environment=$(OTEL_K8S_NAMESPACE)," + - //"container.name=$(OTEL_CONTAINER_NAME)," + - "k8s.pod.uid=$(OTEL_K8S_CONTAINER_ID)", - }}, - }, - }, - }, - }, - }, - } - - _, err := s.Env().KubernetesCluster.Client().CoreV1().Services("datadog").Create(ctx, serviceSpec, metav1.CreateOptions{}) - require.NoError(s.T(), err, "Could not properly start service") - _, err = s.Env().KubernetesCluster.Client().AppsV1().Deployments("datadog").Create(ctx, deploymentSpec, metav1.CreateOptions{}) - require.NoError(s.T(), err, "Could not properly start deployment") -} - // TestContainerMetrics tests that OTLP metrics are received through OTel pipelines as expected func TestContainerMetrics(s OTelTestSuite) { ctx := context.Background() From 3f91a00b35354bcf519ec222fc3221e58be9103f Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 26 Sep 2024 10:23:53 -0400 Subject: [PATCH 25/47] Add EKS test --- .../tests/otel/otel-agent/config/complete.yml | 8 +- .../tests/otel/otel-agent/config/ia.yml | 17 +- .../otel/otel-agent/config/ia_disabled.yml | 57 ++++++ .../infraattributes_disabled_test.go | 28 ++- .../otel-agent/infraattributes_eks_test.go | 56 ++++++ .../otel/otel-agent/infraattributes_test.go | 26 ++- .../tests/otel/utils/pipelines_utils.go | 178 +++++++++++++++++- 7 files changed, 343 insertions(+), 27 deletions(-) create mode 100644 test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml create mode 100644 test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go diff --git a/test/new-e2e/tests/otel/otel-agent/config/complete.yml b/test/new-e2e/tests/otel/otel-agent/config/complete.yml index 5edc6e01b056e..9ba4ed0b2b90e 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/complete.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/complete.yml @@ -49,17 +49,17 @@ service: pipelines: traces: receivers: [otlp] - processors: [batch, infraattributes] + processors: [infraattributes, batch] exporters: [datadog/connector] traces/send: receivers: [otlp] - processors: [batch, infraattributes] + processors: [infraattributes, batch] exporters: [datadog] metrics: receivers: [otlp, datadog/connector, prometheus] - processors: [batch, infraattributes] + processors: [infraattributes, batch] exporters: [datadog] logs: receivers: [otlp] - processors: [batch, infraattributes] + processors: [infraattributes, batch] exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia.yml b/test/new-e2e/tests/otel/otel-agent/config/ia.yml index 68dfabb111b51..2c817a9ba13f8 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/ia.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/ia.yml @@ -23,14 +23,7 @@ exporters: key: ${DD_API_KEY} processors: batch: -connectors: - # Use datadog connector to compute stats for pre-sampled traces - datadog/connector: - traces: - span_name_as_resource_name: true - compute_stats_by_span_kind: true - compute_top_level_by_span_kind: true - peer_tags_aggregation: true + infraattributes: extensions: pprof: health_check: @@ -48,17 +41,17 @@ service: pipelines: traces: receivers: [otlp] - processors: [batch] + processors: [infraattributes, batch] exporters: [datadog/connector] traces/send: receivers: [otlp] - processors: [batch] + processors: [infraattributes, batch] exporters: [datadog] metrics: receivers: [otlp, datadog/connector, prometheus] - processors: [batch] + processors: [infraattributes, batch] exporters: [datadog] logs: receivers: [otlp] - processors: [batch] + processors: [infraattributes, batch] exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml b/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml new file mode 100644 index 0000000000000..959e6b8047657 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml @@ -0,0 +1,57 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + prometheus: + config: + scrape_configs: + - job_name: 'datadog-agent' + scrape_interval: 10s + static_configs: + - targets: [ '0.0.0.0:8888' ] +exporters: + datadog: + traces: + span_name_as_resource_name: true + metrics: + resource_attributes_as_tags: true + hostname: "otelcol-docker" + api: + key: ${DD_API_KEY} +processors: + batch: + infraattributes: +extensions: + pprof: + health_check: + zpages: + endpoint: "localhost:55679" + ddflare: +service: + extensions: + [ + pprof, + zpages, + health_check, + ddflare, + ] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [datadog/connector] + traces/send: + receivers: [otlp] + processors: [batch] + exporters: [datadog] + metrics: + receivers: [otlp, datadog/connector, prometheus] + processors: [batch] + exporters: [datadog] + logs: + receivers: [otlp] + processors: [batch] + exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go index 413d03a5350d6..807df99b480d4 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go @@ -22,7 +22,7 @@ type iaDisabledTestSuite struct { e2e.BaseSuite[environments.Kubernetes] } -//go:embed config/ia.yml +//go:embed config/ia_disabled.yml var iaDisabledConfig string func TestOTelAgentIADisabled(t *testing.T) { @@ -42,10 +42,30 @@ agents: e2e.Run(t, &iaDisabledTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaDisabledConfig))))) } +func (s *iaDisabledTestSuite) TestCalendarJavaApp() { + utils.TestCalendarJavaApp(s) +} + +func (s *iaDisabledTestSuite) TestCalendarGoApp() { + utils.TestCalendarGoApp(s) +} + +func (s *iaDisabledTestSuite) TestOTLPTraces() { + utils.TestTraces(s) +} + func (s *iaDisabledTestSuite) TestOTLPMetrics() { - utils.TestContainerMetrics(s) + utils.TestMetrics(s) +} + +func (s *iaDisabledTestSuite) TestOTLPLogs() { + utils.TestLogs(s) +} + +func (s *iaDisabledTestSuite) TestHosts() { + utils.TestHosts(s) } -func (s *iaDisabledTestSuite) TestOTelFlare() { - utils.TestOTelFlare(s) +func (s *iaDisabledTestSuite) TestPrometheusMetrics() { + utils.TestPrometheusMetrics(s) } diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go new file mode 100644 index 0000000000000..130bd1d073d98 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -0,0 +1,56 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type iaEKSTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +func TestOTelAgentIAEKS(t *testing.T) { + t.Skip() + e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSLinuxNodeGroup(), awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) +} + +func (s *iaEKSTestSuite) TestCalendarJavaApp() { + utils.TestCalendarJavaApp(s) +} + +func (s *iaEKSTestSuite) TestCalendarGoApp() { + utils.TestCalendarGoApp(s) +} + +func (s *iaEKSTestSuite) TestOTLPTraces() { + utils.TestTraces(s) +} + +func (s *iaEKSTestSuite) TestOTLPMetrics() { + utils.TestMetrics(s) +} + +func (s *iaEKSTestSuite) TestOTLPLogs() { + utils.TestLogs(s) +} + +func (s *iaEKSTestSuite) TestHosts() { + utils.TestHosts(s) +} + +func (s *iaEKSTestSuite) TestPrometheusMetrics() { + utils.TestPrometheusMetrics(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go index b97d58cdb3374..024aae261bf9a 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -30,10 +30,30 @@ func TestOTelAgentIA(t *testing.T) { e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } +func (s *iaTestSuite) TestCalendarJavaApp() { + utils.TestCalendarJavaApp(s) +} + +func (s *iaTestSuite) TestCalendarGoApp() { + utils.TestCalendarGoApp(s) +} + +func (s *iaTestSuite) TestOTLPTraces() { + utils.TestTraces(s) +} + func (s *iaTestSuite) TestOTLPMetrics() { - utils.TestContainerMetrics(s) + utils.TestMetrics(s) +} + +func (s *iaTestSuite) TestOTLPLogs() { + utils.TestLogs(s) +} + +func (s *iaTestSuite) TestHosts() { + utils.TestHosts(s) } -func (s *iaTestSuite) TestOTelFlare() { - utils.TestOTelFlare(s) +func (s *iaTestSuite) TestPrometheusMetrics() { + utils.TestPrometheusMetrics(s) } diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index abfd9d78ad3f5..b3e3b67cd500c 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -353,7 +353,7 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin require.NoError(s.T(), err, "Could not properly start job") } -func createCalendarApp(ctx context.Context, s OTelTestSuite) { +func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { var replicas int32 = 1 otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) @@ -459,6 +459,9 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { }, { Name: "OTEL_K8S_POD_NAME", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, { + Name: "OTEL_K8S_POD_ID", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, }, { Name: "OTEL_EXPORTER_OTLP_ENDPOINT", Value: otlpEndpoint, @@ -471,6 +474,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { "k8s.namespace.name=$(OTEL_K8S_NAMESPACE)," + "k8s.node.name=$(OTEL_K8S_NODE_NAME)," + "k8s.pod.name=$(OTEL_K8S_POD_NAME)," + + "k8s.pod.uid=$(OTEL_K8S_POD_ID)," + "k8s.container.name=calendar-java-otel," + "host.name=$(OTEL_K8S_NODE_NAME)," + "deployment.environment=$(OTEL_K8S_NAMESPACE)", @@ -488,14 +492,161 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { require.NoError(s.T(), err, "Could not properly start deployment") } -// TestContainerMetrics tests that OTLP metrics are received through OTel pipelines as expected -func TestContainerMetrics(s OTelTestSuite) { +func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { + var replicas int32 = 1 + + if s.Env().Agent == nil { + s.T().Log("AGENT NIL") + } + + if s.Env().Agent != nil { + s.T().Log("LinuxNodeAgent.LabelSelectors", s.Env().Agent.LinuxNodeAgent.LabelSelectors) + } + + otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) + serviceSpec := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "calendar-rest-go", + Labels: map[string]string{ + "helm.sh/chart": "calendar-rest-go-0.1.0", + "app.kubernetes.io/name": "calendar-rest-go", + "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", + }, + Annotations: map[string]string{ + "openshift.io/deployment.name": "openshift", + }, + }, + Spec: corev1.ServiceSpec{ + Type: corev1.ServiceTypeClusterIP, + Ports: []corev1.ServicePort{ + { + Port: 9090, + TargetPort: intstr.IntOrString{ + StrVal: "http", + }, + Protocol: "TCP", + Name: "http", + }, + }, + Selector: map[string]string{ + "app.kubernetes.io/name": "calendar-rest-go", + "app.kubernetes.io/instance": "calendar-rest-go", + }, + }, + } + deploymentSpec := &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "calendar-rest-go", + Labels: map[string]string{ + "helm.sh/chart": "calendar-rest-go-0.1.0", + "app.kubernetes.io/name": "calendar-rest-go", + "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", + }, + Annotations: map[string]string{ + "openshift.io/deployment.name": "openshift", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app.kubernetes.io/name": "calendar-rest-go", + "app.kubernetes.io/instance": "calendar-rest-go", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app.kubernetes.io/name": "calendar-rest-go", + "app.kubernetes.io/instance": "calendar-rest-go", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{{ + Name: "calendar-rest-go", + Image: "datadog/opentelemetry-examples:calendar-go-rest-0.14", + ImagePullPolicy: "IfNotPresent", + Ports: []corev1.ContainerPort{{ + Name: "http", + ContainerPort: 9090, + Protocol: "TCP", + }}, + LivenessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/calendar", + Port: intstr.FromString("http"), + }, + }, + }, + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/calendar", + Port: intstr.FromString("http"), + }, + }, + }, + Env: []corev1.EnvVar{{ + Name: "OTEL_SERVICE_NAME", + Value: "calendar-rest-go", + }, { + Name: "OTEL_CONTAINER_NAME", + Value: "calendar-rest-go", + }, { + Name: "OTEL_K8S_NAMESPACE", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, + }, { + Name: "OTEL_K8S_NODE_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, + }, { + Name: "OTEL_K8S_POD_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, + }, { + Name: "OTEL_K8S_POD_ID", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, + }, { + Name: "OTEL_EXPORTER_OTLP_ENDPOINT", + Value: otlpEndpoint, + }, { + Name: "OTEL_EXPORTER_OTLP_PROTOCOL", + Value: "grpc", + }, { + Name: "OTEL_RESOURCE_ATTRIBUTES", + Value: "service.name=$(OTEL_SERVICE_NAME)," + + "k8s.namespace.name=$(OTEL_K8S_NAMESPACE)," + + "k8s.node.name=$(OTEL_K8S_NODE_NAME)," + + "k8s.pod.name=$(OTEL_K8S_POD_NAME)," + + "k8s.pod.uid=$(OTEL_K8S_POD_ID)," + + "k8s.container.name=calendar-rest-go," + + "host.name=$(OTEL_K8S_NODE_NAME)," + + "deployment.environment=$(OTEL_K8S_NAMESPACE)", + }}, + }, + }, + }, + }, + }, + } + + _, err := s.Env().KubernetesCluster.Client().CoreV1().Services("datadog").Create(ctx, serviceSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start service") + _, err = s.Env().KubernetesCluster.Client().AppsV1().Deployments("datadog").Create(ctx, deploymentSpec, metav1.CreateOptions{}) + require.NoError(s.T(), err, "Could not properly start deployment") +} + +// TestCalendarJavaApp tests that OTLP metrics are received through OTel pipelines as expected +func TestCalendarJavaApp(s OTelTestSuite) { ctx := context.Background() err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) s.T().Log("Starting app") - createCalendarApp(ctx, s) + createJavaCalendarApp(ctx, s) var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") @@ -507,6 +658,25 @@ func TestContainerMetrics(s OTelTestSuite) { s.T().Log("Got metrics", metrics) } +// TestCalendarGoApp tests that OTLP metrics are received through OTel pipelines as expected +func TestCalendarGoApp(s OTelTestSuite) { + ctx := context.Background() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) + + s.T().Log("Starting app") + createGoCalendarApp(ctx, s) + + var metrics []*aggregator.MetricSeries + s.T().Log("Waiting for metrics") + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-rest-go"})) + assert.NoError(c, err) + assert.NotEmpty(c, metrics) + }, 5*time.Minute, 10*time.Second) + s.T().Log("Got metrics", metrics) +} + func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { ctags, ok := tp.Tags["_dd.tags.container"] if !ok { From 742a3fdc5d0c4b4444d8578899abdcdba64eb140 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 26 Sep 2024 10:48:16 -0400 Subject: [PATCH 26/47] Remove Skip --- .../tests/otel/otel-agent/infraattributes_eks_test.go | 2 +- test/new-e2e/tests/otel/utils/pipelines_utils.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go index 130bd1d073d98..645c7bffa0082 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -23,7 +23,7 @@ type iaEKSTestSuite struct { } func TestOTelAgentIAEKS(t *testing.T) { - t.Skip() + t.Parallel() e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSLinuxNodeGroup(), awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index b3e3b67cd500c..54223b0524fd6 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -297,6 +297,14 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 var backOffLimit int32 = 4 + if s.Env().Agent == nil { + s.T().Log("AGENT NIL") + } + + if s.Env().Agent != nil { + s.T().Log("LinuxNodeAgent.LabelSelectors", s.Env().Agent.LinuxNodeAgent.LabelSelectors) + } + otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) jobSpec := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ From b9483493f903fcb352bfc47e4ecb07d3c09aeb8a Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 26 Sep 2024 13:16:35 -0400 Subject: [PATCH 27/47] Add eks test fix --- .../pkg/environments/aws/kubernetes/eks.go | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/eks.go b/test/new-e2e/pkg/environments/aws/kubernetes/eks.go index 91d552ad2958b..1b3dc07d92832 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/eks.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/eks.go @@ -13,7 +13,7 @@ import ( "github.com/DataDog/test-infra-definitions/common/config" "github.com/DataDog/test-infra-definitions/common/utils" "github.com/DataDog/test-infra-definitions/components" - "github.com/DataDog/test-infra-definitions/components/datadog/agent" + "github.com/DataDog/test-infra-definitions/components/datadog/agent/helm" dogstatsdstandalone "github.com/DataDog/test-infra-definitions/components/datadog/dogstatsd-standalone" fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" @@ -324,34 +324,28 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi if err := fakeIntake.Export(awsEnv.Ctx(), &env.FakeIntake.FakeintakeOutput); err != nil { return err } + if params.agentOptions != nil { + newOpts := []kubernetesagentparams.Option{kubernetesagentparams.WithFakeintake(fakeIntake)} + params.agentOptions = append(newOpts, params.agentOptions...) + } + } else { + env.FakeIntake = nil } // Deploy the agent dependsOnSetup := utils.PulumiDependsOn(workloadDeps...) if params.agentOptions != nil { - paramsAgent, err := kubernetesagentparams.NewParams(params.agentOptions...) + params.agentOptions = append(params.agentOptions, kubernetesagentparams.WithPulumiResourceOptions(dependsOnSetup)) + kubernetesAgent, err := helm.NewKubernetesAgent(&awsEnv, "eks", eksKubeProvider, params.agentOptions...) if err != nil { return err } - - helmComponent, err := agent.NewHelmInstallation(&awsEnv, agent.HelmInstallationArgs{ - KubeProvider: eksKubeProvider, - Namespace: "datadog", - ValuesYAML: paramsAgent.HelmValues, - Fakeintake: fakeIntake, - DeployWindows: params.eksWindowsNodeGroup, - }, dependsOnSetup) + err = kubernetesAgent.Export(ctx, &env.Agent.KubernetesAgentOutput) if err != nil { return err } + } else { env.Agent = nil - - ctx.Export("agent-linux-helm-install-name", helmComponent.LinuxHelmReleaseName) - ctx.Export("agent-linux-helm-install-status", helmComponent.LinuxHelmReleaseStatus) - if params.eksWindowsNodeGroup { - ctx.Export("agent-windows-helm-install-name", helmComponent.WindowsHelmReleaseName) - ctx.Export("agent-windows-helm-install-status", helmComponent.WindowsHelmReleaseStatus) - } } // Deploy standalone dogstatsd From 6bccac1a0ac9923e13d223cc70c778d9dbd775d1 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 26 Sep 2024 17:36:45 -0400 Subject: [PATCH 28/47] test --- test/new-e2e/tests/otel/otel-agent/config/ia.yml | 6 +----- .../tests/otel/otel-agent/config/ia_disabled.yml | 6 +----- test/new-e2e/tests/otel/utils/pipelines_utils.go | 10 +++++++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia.yml b/test/new-e2e/tests/otel/otel-agent/config/ia.yml index 2c817a9ba13f8..4c368c6c6bcda 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/ia.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/ia.yml @@ -40,15 +40,11 @@ service: ] pipelines: traces: - receivers: [otlp] - processors: [infraattributes, batch] - exporters: [datadog/connector] - traces/send: receivers: [otlp] processors: [infraattributes, batch] exporters: [datadog] metrics: - receivers: [otlp, datadog/connector, prometheus] + receivers: [otlp, prometheus] processors: [infraattributes, batch] exporters: [datadog] logs: diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml b/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml index 959e6b8047657..33f94a1b7002b 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml @@ -40,15 +40,11 @@ service: ] pipelines: traces: - receivers: [otlp] - processors: [batch] - exporters: [datadog/connector] - traces/send: receivers: [otlp] processors: [batch] exporters: [datadog] metrics: - receivers: [otlp, datadog/connector, prometheus] + receivers: [otlp, prometheus] processors: [batch] exporters: [datadog] logs: diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 54223b0524fd6..984522660c439 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -133,11 +133,11 @@ func TestMetrics(s OTelTestSuite) { var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service), "kube_ownerref_kind:job"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) }, 2*time.Minute, 10*time.Second) - s.T().Log("Got metrics", metrics) + s.T().Log("Got metrics", s.T().Name(), metrics) for _, metricSeries := range metrics { tags := getTagMapFromSlice(s.T(), metricSeries.Tags) @@ -308,7 +308,7 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) jobSpec := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("telemetrygen-job-%v", telemetry), + Name: fmt.Sprintf("telemetrygen-job-%v-%v", telemetry, strings.ReplaceAll(strings.ToLower(s.T().Name()), "/", "-")), Namespace: "datadog", }, Spec: batchv1.JobSpec{ @@ -659,6 +659,8 @@ func TestCalendarJavaApp(s OTelTestSuite) { var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + mn, err := s.Env().FakeIntake.Client().GetMetricNames() + s.T().Log("CalendarJavaApp Metric Names", mn) metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar.api.hits", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-java-otel"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) @@ -678,6 +680,8 @@ func TestCalendarGoApp(s OTelTestSuite) { var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + mn, err := s.Env().FakeIntake.Client().GetMetricNames() + s.T().Log("CalendarGoApp Metric Names", mn) metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-rest-go"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) From 24483a8a9fe1d7da3d8095c0d5178b5940d261be Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Fri, 27 Sep 2024 10:14:34 -0400 Subject: [PATCH 29/47] lint --- test/new-e2e/tests/otel/utils/pipelines_utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 984522660c439..4e09f1e216c80 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -657,9 +657,10 @@ func TestCalendarJavaApp(s OTelTestSuite) { createJavaCalendarApp(ctx, s) var metrics []*aggregator.MetricSeries + var mn []string s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - mn, err := s.Env().FakeIntake.Client().GetMetricNames() + mn, err = s.Env().FakeIntake.Client().GetMetricNames() s.T().Log("CalendarJavaApp Metric Names", mn) metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar.api.hits", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-java-otel"})) assert.NoError(c, err) @@ -678,9 +679,10 @@ func TestCalendarGoApp(s OTelTestSuite) { createGoCalendarApp(ctx, s) var metrics []*aggregator.MetricSeries + var mn []string s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - mn, err := s.Env().FakeIntake.Client().GetMetricNames() + mn, err = s.Env().FakeIntake.Client().GetMetricNames() s.T().Log("CalendarGoApp Metric Names", mn) metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-rest-go"})) assert.NoError(c, err) From 9189d44cd5a0fa0b72eb242b1dba4e8f46e20c9a Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Fri, 27 Sep 2024 13:38:41 -0400 Subject: [PATCH 30/47] update tests --- .../infraattributesprocessor/logs.go | 2 +- .../infraattributesprocessor/traces.go | 2 +- .../tests/otel/otel-agent/complete_test.go | 14 ++++-- .../infraattributes_disabled_test.go | 6 +-- .../otel-agent/infraattributes_eks_test.go | 6 +-- .../otel/otel-agent/infraattributes_test.go | 6 +-- .../tests/otel/otel-agent/minimal_test.go | 14 ++++-- .../tests/otel/otlp-ingest/pipelines_test.go | 6 +-- .../tests/otel/utils/pipelines_utils.go | 45 +++++++++++++------ 9 files changed, 68 insertions(+), 33 deletions(-) diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go index 8d63b39c3754b..925c94fb4af99 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go @@ -43,7 +43,7 @@ func (ialp *infraAttributesLogProcessor) processLogs(_ context.Context, ld plog. // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { - entityTags, err := ialp.tagger.Tag(entityID.String(), ialp.cardinality) + entityTags, err := ialp.tagger.Tag(entityID.String(), types.HighCardinality) if err != nil { ialp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) continue diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go index ce6fe02674e95..6975650649e4a 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go @@ -42,7 +42,7 @@ func (iasp *infraAttributesSpanProcessor) processTraces(_ context.Context, td pt // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { - entityTags, err := iasp.tagger.Tag(entityID.String(), iasp.cardinality) + entityTags, err := iasp.tagger.Tag(entityID.String(), types.HighCardinality) if err != nil { iasp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) continue diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index 9e555a0dfa49f..ca53527824b82 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -39,15 +39,15 @@ agents: } func (s *completeTestSuite) TestOTLPTraces() { - utils.TestTraces(s) + utils.TestTraces(s, true) } func (s *completeTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s) + utils.TestMetrics(s, true) } func (s *completeTestSuite) TestOTLPLogs() { - utils.TestLogs(s) + utils.TestLogs(s, true) } func (s *completeTestSuite) TestHosts() { @@ -57,3 +57,11 @@ func (s *completeTestSuite) TestHosts() { func (s *completeTestSuite) TestPrometheusMetrics() { utils.TestPrometheusMetrics(s) } + +func (s *completeTestSuite) TestCalendarJavaApp() { + utils.TestCalendarJavaApp(s) +} + +func (s *completeTestSuite) TestCalendarGoApp() { + utils.TestCalendarGoApp(s) +} diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go index 807df99b480d4..9541f507bdf1d 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go @@ -51,15 +51,15 @@ func (s *iaDisabledTestSuite) TestCalendarGoApp() { } func (s *iaDisabledTestSuite) TestOTLPTraces() { - utils.TestTraces(s) + utils.TestTraces(s, false) } func (s *iaDisabledTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s) + utils.TestMetrics(s, false) } func (s *iaDisabledTestSuite) TestOTLPLogs() { - utils.TestLogs(s) + utils.TestLogs(s, false) } func (s *iaDisabledTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go index 645c7bffa0082..05f9dc6351a4c 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -36,15 +36,15 @@ func (s *iaEKSTestSuite) TestCalendarGoApp() { } func (s *iaEKSTestSuite) TestOTLPTraces() { - utils.TestTraces(s) + utils.TestTraces(s, true) } func (s *iaEKSTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s) + utils.TestMetrics(s, true) } func (s *iaEKSTestSuite) TestOTLPLogs() { - utils.TestLogs(s) + utils.TestLogs(s, true) } func (s *iaEKSTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go index 024aae261bf9a..95e4987ae3b63 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -39,15 +39,15 @@ func (s *iaTestSuite) TestCalendarGoApp() { } func (s *iaTestSuite) TestOTLPTraces() { - utils.TestTraces(s) + utils.TestTraces(s, true) } func (s *iaTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s) + utils.TestMetrics(s, true) } func (s *iaTestSuite) TestOTLPLogs() { - utils.TestLogs(s) + utils.TestLogs(s, true) } func (s *iaTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/otel-agent/minimal_test.go b/test/new-e2e/tests/otel/otel-agent/minimal_test.go index a1f9167f5623b..47721797020c5 100644 --- a/test/new-e2e/tests/otel/otel-agent/minimal_test.go +++ b/test/new-e2e/tests/otel/otel-agent/minimal_test.go @@ -31,15 +31,15 @@ func TestOTelAgentMinimal(t *testing.T) { } func (s *minimalTestSuite) TestOTLPTraces() { - utils.TestTraces(s) + utils.TestTraces(s, true) } func (s *minimalTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s) + utils.TestMetrics(s, true) } func (s *minimalTestSuite) TestOTLPLogs() { - utils.TestLogs(s) + utils.TestLogs(s, true) } func (s *minimalTestSuite) TestHosts() { @@ -57,3 +57,11 @@ func (s *minimalTestSuite) TestOTelAgentInstalled() { func (s *minimalTestSuite) TestOTelFlare() { utils.TestOTelFlare(s) } + +func (s *minimalTestSuite) TestCalendarJavaApp() { + utils.TestCalendarJavaApp(s) +} + +func (s *minimalTestSuite) TestCalendarGoApp() { + utils.TestCalendarGoApp(s) +} diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index a714c8a50109b..280615123993e 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -44,15 +44,15 @@ agents: } func (s *otlpIngestTestSuite) TestOTLPTraces() { - utils.TestTraces(s) + utils.TestTraces(s, false) } func (s *otlpIngestTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s) + utils.TestMetrics(s, false) } func (s *otlpIngestTestSuite) TestOTLPLogs() { - utils.TestLogs(s) + utils.TestLogs(s, false) } func (s *otlpIngestTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 4e09f1e216c80..1321167ac0b82 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -42,7 +42,7 @@ type OTelTestSuite interface { } // TestTraces tests that OTLP traces are received through OTel pipelines as expected -func TestTraces(s OTelTestSuite) { +func TestTraces(s OTelTestSuite, infraAttributes bool) { ctx := context.Background() err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) @@ -57,7 +57,18 @@ func TestTraces(s OTelTestSuite) { traces, err = s.Env().FakeIntake.Client().GetTraces() assert.NoError(c, err) assert.NotEmpty(c, traces) - }, 2*time.Minute, 10*time.Second) + trace := traces[0] + assert.NotEmpty(s.T(), trace.TracerPayloads) + tp := trace.TracerPayloads[0] + assert.NotEmpty(s.T(), tp.Chunks) + assert.NotEmpty(s.T(), tp.Chunks[0].Spans) + assert.Equal(s.T(), service, tp.Chunks[0].Spans[0].Service) + if infraAttributes { + ctags, ok := getContainerTags(s.T(), tp) + assert.True(s.T(), ok) + assert.NotNil(s.T(), ctags["kube_ownerref_kind"]) + } + }, 5*time.Minute, 10*time.Second) require.NotEmpty(s.T(), traces) s.T().Log("Got traces", traces) s.T().Log("num traces", len(traces)) @@ -121,7 +132,7 @@ func TestAPMStats(s OTelTestSuite, numTraces int) { } // TestMetrics tests that OTLP metrics are received through OTel pipelines as expected -func TestMetrics(s OTelTestSuite) { +func TestMetrics(s OTelTestSuite, infraAttributes bool) { ctx := context.Background() err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) @@ -133,10 +144,14 @@ func TestMetrics(s OTelTestSuite) { var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service), "kube_ownerref_kind:job"})) + tags := []string{fmt.Sprintf("service:%v", service)} + if infraAttributes { + tags = append(tags, "kube_ownerref_kind:job") + } + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries](tags)) assert.NoError(c, err) assert.NotEmpty(c, metrics) - }, 2*time.Minute, 10*time.Second) + }, 5*time.Minute, 10*time.Second) s.T().Log("Got metrics", s.T().Name(), metrics) for _, metricSeries := range metrics { @@ -166,7 +181,7 @@ func TestMetrics(s OTelTestSuite) { } // TestLogs tests that OTLP logs are received through OTel pipelines as expected -func TestLogs(s OTelTestSuite) { +func TestLogs(s OTelTestSuite, infraAttributes bool) { ctx := context.Background() err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) @@ -180,10 +195,14 @@ func TestLogs(s OTelTestSuite) { var logs []*aggregator.Log s.T().Log("Waiting for logs") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) + if infraAttributes { + logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody), fakeintake.WithTags[*aggregator.Log]([]string{"kube_ownerref_kind:job"})) + } else { + logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) + } assert.NoError(c, err) assert.NotEmpty(c, logs) - }, 2*time.Minute, 10*time.Second) + }, 5*time.Minute, 10*time.Second) s.T().Log("Got logs", logs) require.NotEmpty(s.T(), logs) @@ -661,12 +680,12 @@ func TestCalendarJavaApp(s OTelTestSuite) { s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { mn, err = s.Env().FakeIntake.Client().GetMetricNames() - s.T().Log("CalendarJavaApp Metric Names", mn) + s.T().Log("CalendarJavaApp Metric Names", s.T().Name(), mn) metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar.api.hits", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-java-otel"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) }, 5*time.Minute, 10*time.Second) - s.T().Log("Got metrics", metrics) + s.T().Log("Got metrics", s.T().Name(), metrics) } // TestCalendarGoApp tests that OTLP metrics are received through OTel pipelines as expected @@ -683,12 +702,12 @@ func TestCalendarGoApp(s OTelTestSuite) { s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { mn, err = s.Env().FakeIntake.Client().GetMetricNames() - s.T().Log("CalendarGoApp Metric Names", mn) - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-rest-go"})) + s.T().Log("CalendarGoApp Metric Names", s.T().Name(), mn) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-rest-go", "kube_ownerref_kind:replicaset"})) assert.NoError(c, err) assert.NotEmpty(c, metrics) }, 5*time.Minute, 10*time.Second) - s.T().Log("Got metrics", metrics) + s.T().Log("Got metrics", s.T().Name(), metrics) } func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { From af4189c283ba1ffc631ab4bb73ed2f688c753519 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Tue, 1 Oct 2024 15:01:16 -0400 Subject: [PATCH 31/47] Update calendar app names --- .../tests/otel/utils/pipelines_utils.go | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 1321167ac0b82..f8332e83a9969 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -383,14 +383,15 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { var replicas int32 = 1 + name := fmt.Sprintf("calendar-java-otel-%v", strings.ReplaceAll(strings.ToLower(s.T().Name()), "/", "-")) otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) serviceSpec := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ - Name: "calendar-java-otel", + Name: name, Labels: map[string]string{ "helm.sh/chart": "calendar-java-otel-0.1.0", - "app.kubernetes.io/name": "calendar-java-otel", - "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, "app.kubernetes.io/version": "1.16.0", "app.kubernetes.io/managed-by": "Helm", }, @@ -411,18 +412,18 @@ func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { }, }, Selector: map[string]string{ - "app.kubernetes.io/name": "calendar-java-otel", - "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, }, }, } deploymentSpec := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ - Name: "calendar-java-otel", + Name: name, Labels: map[string]string{ "helm.sh/chart": "calendar-java-otel-0.1.0", - "app.kubernetes.io/name": "calendar-java-otel", - "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, "app.kubernetes.io/version": "1.16.0", "app.kubernetes.io/managed-by": "Helm", }, @@ -434,20 +435,20 @@ func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { Replicas: &replicas, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ - "app.kubernetes.io/name": "calendar-java-otel", - "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, }, }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ - "app.kubernetes.io/name": "calendar-java-otel", - "app.kubernetes.io/instance": "calendar-java-otel", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, }, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ - Name: "calendar-java-otel", + Name: name, Image: "datadog/opentelemetry-examples:calendar-java-20240826", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ @@ -476,7 +477,7 @@ func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { Value: "calendar-java-otel", }, { Name: "OTEL_CONTAINER_NAME", - Value: "calendar-java-otel", + Value: name, }, { Name: "OTEL_K8S_NAMESPACE", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, @@ -521,6 +522,7 @@ func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { var replicas int32 = 1 + name := fmt.Sprintf("calendar-rest-go-%v", strings.ReplaceAll(strings.ToLower(s.T().Name()), "/", "-")) if s.Env().Agent == nil { s.T().Log("AGENT NIL") @@ -533,11 +535,11 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) serviceSpec := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ - Name: "calendar-rest-go", + Name: name, Labels: map[string]string{ "helm.sh/chart": "calendar-rest-go-0.1.0", - "app.kubernetes.io/name": "calendar-rest-go", - "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, "app.kubernetes.io/version": "1.16.0", "app.kubernetes.io/managed-by": "Helm", }, @@ -558,8 +560,8 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { }, }, Selector: map[string]string{ - "app.kubernetes.io/name": "calendar-rest-go", - "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, }, }, } @@ -568,8 +570,8 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { Name: "calendar-rest-go", Labels: map[string]string{ "helm.sh/chart": "calendar-rest-go-0.1.0", - "app.kubernetes.io/name": "calendar-rest-go", - "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, "app.kubernetes.io/version": "1.16.0", "app.kubernetes.io/managed-by": "Helm", }, @@ -581,20 +583,20 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { Replicas: &replicas, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ - "app.kubernetes.io/name": "calendar-rest-go", - "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, }, }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ - "app.kubernetes.io/name": "calendar-rest-go", - "app.kubernetes.io/instance": "calendar-rest-go", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, }, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ - Name: "calendar-rest-go", + Name: name, Image: "datadog/opentelemetry-examples:calendar-go-rest-0.14", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ @@ -623,7 +625,7 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { Value: "calendar-rest-go", }, { Name: "OTEL_CONTAINER_NAME", - Value: "calendar-rest-go", + Value: name, }, { Name: "OTEL_K8S_NAMESPACE", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, From 017d07a91b85fa3bac23b46cdabeac16aec6b9c1 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 00:32:04 -0400 Subject: [PATCH 32/47] Clean up tests --- cmd/otel-agent/subcommands/run/command.go | 4 +- .../infraattributesprocessor/metrics.go | 2 +- test/new-e2e/go.mod | 62 ++- test/new-e2e/go.sum | 272 ++++++++++- .../pkg/environments/aws/kubernetes/eks.go | 6 +- .../tests/otel/otel-agent/complete_test.go | 23 +- .../tests/otel/otel-agent/config/ia.yml | 1 + .../otel/otel-agent/config/ia_disabled.yml | 53 --- .../infraattributes_disabled_test.go | 71 --- .../otel-agent/infraattributes_eks_test.go | 28 +- .../otel/otel-agent/infraattributes_test.go | 26 +- .../tests/otel/otel-agent/minimal_test.go | 34 +- .../tests/otel/otlp-ingest/pipelines_test.go | 15 +- .../tests/otel/utils/pipelines_utils.go | 425 +++++------------- 14 files changed, 521 insertions(+), 501 deletions(-) delete mode 100644 test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml delete mode 100644 test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go diff --git a/cmd/otel-agent/subcommands/run/command.go b/cmd/otel-agent/subcommands/run/command.go index 64e1269bd82c8..4f86ee90b38e5 100644 --- a/cmd/otel-agent/subcommands/run/command.go +++ b/cmd/otel-agent/subcommands/run/command.go @@ -167,7 +167,9 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, return configsyncimpl.NewParams(params.SyncTimeout, params.SyncDelay, true) }), - fx.Provide(tagger.NewNodeRemoteTaggerParams), + fx.Provide(func() tagger.Params { + return tagger.NewNodeRemoteTaggerParamsWithFallback() + }), taggerimpl.Module(), telemetryimpl.Module(), fx.Provide(func(cfg traceconfig.Component) telemetry.TelemetryCollector { diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go index 08b99c862cb0a..a5f196b916ab0 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go @@ -101,7 +101,7 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { - entityTags, err := iamp.tagger.Tag(entityID.String(), types.HighCardinality) + entityTags, err := iamp.tagger.Tag(entityID.String(), iamp.cardinality) if err != nil { md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_error.%v", entityID.String()), err.Error()) iamp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index b0c6f87c5bfc7..2ec57f981ec9a 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -9,23 +9,28 @@ toolchain go1.22.6 // TODO: Implement hard check in CI replace ( + github.com/DataDog/datadog-agent/comp/core/tagger/types => ../../comp/core/tagger/types + github.com/DataDog/datadog-agent/comp/core/tagger/utils => ../../comp/core/tagger/utils github.com/DataDog/datadog-agent/comp/netflow/payload => ../../comp/netflow/payload github.com/DataDog/datadog-agent/pkg/proto => ../../pkg/proto github.com/DataDog/datadog-agent/pkg/trace => ../../pkg/trace github.com/DataDog/datadog-agent/pkg/util/optional => ../../pkg/util/optional github.com/DataDog/datadog-agent/pkg/util/pointer => ../../pkg/util/pointer github.com/DataDog/datadog-agent/pkg/util/scrubber => ../../pkg/util/scrubber + github.com/DataDog/datadog-agent/pkg/util/tagger => ../../pkg/util/tagger github.com/DataDog/datadog-agent/pkg/util/testutil => ../../pkg/util/testutil github.com/DataDog/datadog-agent/pkg/version => ../../pkg/version + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../pkg/config/nodetreemodel + github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../pkg/config/teeconfig github.com/DataDog/datadog-agent/test/fakeintake => ../fakeintake ) require ( github.com/DataDog/agent-payload/v5 v5.0.122 - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/optional v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.2 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 github.com/DataDog/datadog-agent/test/fakeintake v0.56.0-rc.3 github.com/DataDog/datadog-api-client-go v1.16.0 @@ -57,9 +62,9 @@ require ( github.com/samber/lo v1.47.0 github.com/stretchr/testify v1.9.0 github.com/xeipuuv/gojsonschema v1.2.0 - golang.org/x/crypto v0.26.0 - golang.org/x/sys v0.24.0 - golang.org/x/term v0.23.0 + golang.org/x/crypto v0.27.0 + golang.org/x/sys v0.25.0 + golang.org/x/term v0.24.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/zorkian/go-datadog-api.v2 v2.30.0 k8s.io/api v0.30.2 @@ -235,14 +240,14 @@ require ( go.opentelemetry.io/otel/trace v1.28.0 // indirect go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/text v0.17.0 + golang.org/x/text v0.18.0 golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.24.0 // indirect + golang.org/x/tools v0.25.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect @@ -265,6 +270,7 @@ require ( ) require ( + github.com/DataDog/datadog-agent/comp/core/tagger/types v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/digitalocean/go-libvirt v0.0.0-20240812180835-9c6c0a310c6c @@ -272,6 +278,31 @@ require ( ) require ( + github.com/DataDog/datadog-agent/comp/core/secrets v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/tagger v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2 // indirect + github.com/DataDog/viper v1.13.5 // indirect + github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect + github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.60.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.59.0 // indirect @@ -279,4 +310,11 @@ require ( github.com/pulumi/pulumi-azure-native-sdk/v2 v2.60.0 // indirect github.com/pulumi/pulumi-gcp/sdk/v6 v6.67.1 // indirect github.com/pulumi/pulumi-gcp/sdk/v7 v7.38.0 // indirect + github.com/shirou/gopsutil/v3 v3.24.4 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // 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 ) diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index bc258f6c5ae55..6d764bffc615a 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -8,6 +8,42 @@ github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DataDog/agent-payload/v5 v5.0.122 h1:tGhU9UMjUiVaX3iR+nZX20TRmzyrIvVGTkWbbrR7bDA= github.com/DataDog/agent-payload/v5 v5.0.122/go.mod h1:FgVQKmVdqdmZTbxIptqJC/l+xEzdiXsaAOs/vGAvWzs= +github.com/DataDog/datadog-agent/comp/api/api/def v0.56.2 h1:EYLWks4f2GeqzwvhyvfhARVpmBRQaoKARvnbKoSk7Kg= +github.com/DataDog/datadog-agent/comp/api/api/def v0.56.2/go.mod h1:B7o1FsKlzr4JSS+CYKYuyABr3eaaq2W7fIA56ntxGHQ= +github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.2 h1:wIGNGeNJPaX7byBWBPnaL4clGAEeIl3IR4o/v+vGIno= +github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.2/go.mod h1:oPs3OkQOyKRX/kERWQGMpIHG6j9J5kIlBdm2R6OyWHE= +github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.2 h1:3SeIZmDiXPKGNJKHF2C7KNWjuCM1vLJ+vBtWKpIsrqU= +github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.2/go.mod h1:SUizcQZHTU7Aezk/XKiZjPpt7Ng8x4AsAcr5PlxyP7w= +github.com/DataDog/datadog-agent/comp/core/secrets v0.56.2 h1:6/FSx8WPy/L86LFPWB0YPsiWLvIvcvFbWnba/PDkeo0= +github.com/DataDog/datadog-agent/comp/core/secrets v0.56.2/go.mod h1:gIs5mmRdE2epD1iYxNvdx2EhXrUfa2jebR+CU+0vYCo= +github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.2 h1:oMhfpqlRYwyhUdiN/mQRvI/aWkQERsGWBQscdDwQZ3A= +github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.2/go.mod h1:YkMtv/JWcPabF1jGiReg6eCuFYXyFi5PxOMoNTlFiJs= +github.com/DataDog/datadog-agent/comp/def v0.56.2 h1:EOQj5viXX5l47Su32muRE5uILjdNDsgiOcEqsi6BNgc= +github.com/DataDog/datadog-agent/comp/def v0.56.2/go.mod h1:DEWoZ2fdGE8yy5Q/p8w06DLm3cBWxW8i9a/xNUxE2qc= +github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 h1:OWZmy3BPMkjDjDp+mIYdGS+jjFUx3jK/sDJI/AjtvaY= +github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2/go.mod h1:s9QBNtoBURzy/0FeBInQ7kawNj04OnBNUo8xYr26z3E= +github.com/DataDog/datadog-agent/pkg/config/env v0.56.2 h1:TWsAiPjYKomf5FqRodShgzRRI+oP/537/myvW5GIXT8= +github.com/DataDog/datadog-agent/pkg/config/env v0.56.2/go.mod h1:1gXwnxusuGZQim0dtfidr7P1R/WGZGwY4HJvLKJUqMk= +github.com/DataDog/datadog-agent/pkg/config/model v0.56.2 h1:XjB3XpimhNFgHYztUZAFTbSg7G3BzbVqAdYhbf3OSEs= +github.com/DataDog/datadog-agent/pkg/config/model v0.56.2/go.mod h1:wm7zXdwf0zknLgc9lpz2H70fRP2xA9WHL0LEscxtDXQ= +github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2 h1:WMKs6IwIUpPrZ8KoiTL2Dw6y7UUQJs8v7VkuZc1s0jA= +github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2/go.mod h1:fYK7gt2JvuTmS5JeGCxui1Id8ZFkv2PUJrdnBvNhlxQ= +github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2 h1:XN+YzFS2mUF9OYrxQIPZdgiYhJzc+CUZgrXs8WL8y/A= +github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2/go.mod h1:mSSn2OzsdgoUnPyBmF8rEDU+ee1RFp+H6LFsJSteN9o= +github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2 h1:Lhy+q1zl9EQSM97ixD770xwFirtPF/69O13qnO8OxHo= +github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2/go.mod h1:GD+HjlsNGhPAjAYrNjt/XXq+lHgor1Piia+Mlat/97s= +github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.2 h1:FOnoG/i37bWlZfVhS/a1icX83dUtSCsixZYi3qTxT1s= +github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.2/go.mod h1:bI6jSFleEMzkMlm+dmjNs4T7a6R9PDIgWdAyW6cIBkY= +github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2 h1:1lgz81YwRXqGqYqX65mTDBHWLgpUBP67giv3sVthYig= +github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2/go.mod h1:g+gn4N6q/QoVjAvMFWJFcTc8nnwVx2LqaUEoj0Y/MSE= +github.com/DataDog/datadog-agent/pkg/util/log v0.56.2 h1:dcdsyPFTHFr+Cl/OfNt5VJWZl/TY0Xo5KYTDD316Ep4= +github.com/DataDog/datadog-agent/pkg/util/log v0.56.2/go.mod h1:DWliXBL5ROdWFjUHuh5fh5ve5zHydidMM/hE/w3j/Ww= +github.com/DataDog/datadog-agent/pkg/util/system v0.56.2 h1:yPztPIEPPeDgxJoOFVVR9lcIA2NF8ScGdplU2puav1U= +github.com/DataDog/datadog-agent/pkg/util/system v0.56.2/go.mod h1:AbeAoUquORgGoRhQ9hDqJO/n4nCw7+/k5dgq/ZysWWI= +github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2 h1:EQuMMdAd7uTeYCcHsyL6mUixMGtcU0PiAjea170xEAA= +github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2/go.mod h1:tBwAMDAEJEaZ5VNe19GJoLLzviZGOPUJH0WnzETWhyY= +github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2 h1:5Cg+O4+Npt8BMuot5KpRdN5TVw9lqRxUBkcr6W9Bss8= +github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2/go.mod h1:lZaWAGe78MiYFRHwbHS1NikRXtiYz3CsEiYbyMJyPTk= github.com/DataDog/datadog-api-client-go v1.16.0 h1:5jOZv1m98criCvYTa3qpW8Hzv301nbZX3K9yJtwGyWY= github.com/DataDog/datadog-api-client-go v1.16.0/go.mod h1:PgrP2ABuJWL3Auw2iEkemAJ/r72ghG4DQQmb5sgnKW4= github.com/DataDog/datadog-api-client-go/v2 v2.27.0 h1:AGZj41frjnjMufQHQbJH2fzmifOs20wpmVDtIBCv33E= @@ -18,6 +54,8 @@ github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a h1:m9REhmyaWD5YJ0P53y github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= github.com/DataDog/test-infra-definitions v0.0.0-20240930155632-85c56b464e81 h1:fDYHxfWiqapW3ukrOpxz21hv+qg9Ko7QBFG39ufudi0= github.com/DataDog/test-infra-definitions v0.0.0-20240930155632-85c56b464e81/go.mod h1:nbSZa2alOY/vhOJRJNhMAbXNLARLT83ozjoP+s1hyRE= +github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= +github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= @@ -32,18 +70,25 @@ github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpz github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= 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/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= +github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= @@ -98,6 +143,8 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 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/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= @@ -108,6 +155,9 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +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/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= @@ -123,6 +173,8 @@ github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuP github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= @@ -131,6 +183,14 @@ github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -140,6 +200,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/go-libvirt v0.0.0-20240812180835-9c6c0a310c6c h1:1y+eZhZOMDP86ErYQ7P7ebAvyhpr+HZhR5K6BlOkWoo= github.com/digitalocean/go-libvirt v0.0.0-20240812180835-9c6c0a310c6c/go.mod h1:vhj0tZhS07ugaMVppAreQmBVHcqLwl5YR2DRu5/uJbY= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= @@ -175,11 +237,13 @@ github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBd github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -192,33 +256,46 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/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-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -229,6 +306,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -240,6 +318,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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= @@ -248,15 +327,23 @@ 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/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= 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/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= @@ -272,8 +359,12 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= +github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= +github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -284,17 +375,27 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 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/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -307,6 +408,11 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +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/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -323,10 +429,12 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -336,8 +444,12 @@ github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3 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 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -352,12 +464,14 @@ github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= @@ -371,6 +485,8 @@ github.com/opentracing/basictracer-go v1.1.0/go.mod h1:V2HZueSJEp879yv285Aap1BS6 github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pgavlin/fx v0.1.6 h1:r9jEg69DhNoCd3Xh0+5mIbdbS3PqWrVWujkY76MFRTU= @@ -380,6 +496,8 @@ github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2 github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= @@ -388,15 +506,34 @@ github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/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 v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= 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.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= github.com/pulumi/esc v0.9.1 h1:HH5eEv8sgyxSpY5a8yePyqFXzA8cvBvapfH8457+mIs= @@ -443,6 +580,9 @@ github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -456,18 +596,39 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6Ng github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/shirou/gopsutil/v3 v3.24.4 h1:dEHgzZXt4LMNm+oYELpzl9YCqV65Yr/6SfrvgRBtXeU= +github.com/shirou/gopsutil/v3 v3.24.4/go.mod h1:lTd2mdiOspcqLgAnr9/nGi71NkeMpWKdmhuxm9GusH8= +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.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/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= @@ -481,16 +642,27 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= +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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= 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= @@ -503,16 +675,21 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= @@ -525,15 +702,34 @@ go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6b go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +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.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 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/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= +go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= +go.uber.org/fx v1.18.2 h1:bUNI6oShr+OVFQeU8cDNbnN7VFsu+SsjHzUF51V/GAU= +go.uber.org/fx v1.18.2/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +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/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +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-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -541,15 +737,17 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -557,14 +755,19 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/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-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -577,13 +780,14 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -593,15 +797,23 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190529164535-6a60838ec259/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/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-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/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-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -613,14 +825,18 @@ golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -629,8 +845,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= 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.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -640,16 +856,23 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -658,8 +881,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= 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= @@ -670,15 +893,19 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 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 v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -693,17 +920,27 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -716,6 +953,7 @@ gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/eks.go b/test/new-e2e/pkg/environments/aws/kubernetes/eks.go index 1b3dc07d92832..65680a36f0657 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/eks.go +++ b/test/new-e2e/pkg/environments/aws/kubernetes/eks.go @@ -324,10 +324,6 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi if err := fakeIntake.Export(awsEnv.Ctx(), &env.FakeIntake.FakeintakeOutput); err != nil { return err } - if params.agentOptions != nil { - newOpts := []kubernetesagentparams.Option{kubernetesagentparams.WithFakeintake(fakeIntake)} - params.agentOptions = append(newOpts, params.agentOptions...) - } } else { env.FakeIntake = nil } @@ -335,7 +331,7 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi // Deploy the agent dependsOnSetup := utils.PulumiDependsOn(workloadDeps...) if params.agentOptions != nil { - params.agentOptions = append(params.agentOptions, kubernetesagentparams.WithPulumiResourceOptions(dependsOnSetup)) + params.agentOptions = append(params.agentOptions, kubernetesagentparams.WithPulumiResourceOptions(dependsOnSetup), kubernetesagentparams.WithFakeintake(fakeIntake)) kubernetesAgent, err := helm.NewKubernetesAgent(&awsEnv, "eks", eksKubeProvider, params.agentOptions...) if err != nil { return err diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index ca53527824b82..8da68f2132b28 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -27,6 +27,10 @@ var completeConfig string func TestOTelAgentComplete(t *testing.T) { values := ` +datadog: + logs: + containerCollectAll: false + containerCollectUsingFiles: false agents: containers: otelAgent: @@ -38,16 +42,21 @@ agents: e2e.Run(t, &completeTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(completeConfig))))) } +func (s *completeTestSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + utils.TestCalendarApp(s) +} + func (s *completeTestSuite) TestOTLPTraces() { - utils.TestTraces(s, true) + utils.TestTraces(s, minimalParams) } func (s *completeTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s, true) + utils.TestMetrics(s, minimalParams) } func (s *completeTestSuite) TestOTLPLogs() { - utils.TestLogs(s, true) + utils.TestLogs(s, minimalParams) } func (s *completeTestSuite) TestHosts() { @@ -58,10 +67,10 @@ func (s *completeTestSuite) TestPrometheusMetrics() { utils.TestPrometheusMetrics(s) } -func (s *completeTestSuite) TestCalendarJavaApp() { - utils.TestCalendarJavaApp(s) +func (s *completeTestSuite) TestOTelAgentInstalled() { + utils.TestOTelAgentInstalled(s) } -func (s *completeTestSuite) TestCalendarGoApp() { - utils.TestCalendarGoApp(s) +func (s *completeTestSuite) TestOTelFlare() { + utils.TestOTelFlare(s) } diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia.yml b/test/new-e2e/tests/otel/otel-agent/config/ia.yml index 4c368c6c6bcda..fa761ea3c6be9 100644 --- a/test/new-e2e/tests/otel/otel-agent/config/ia.yml +++ b/test/new-e2e/tests/otel/otel-agent/config/ia.yml @@ -24,6 +24,7 @@ exporters: processors: batch: infraattributes: + cardinality: 2 extensions: pprof: health_check: diff --git a/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml b/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml deleted file mode 100644 index 33f94a1b7002b..0000000000000 --- a/test/new-e2e/tests/otel/otel-agent/config/ia_disabled.yml +++ /dev/null @@ -1,53 +0,0 @@ -receivers: - otlp: - protocols: - grpc: - endpoint: 0.0.0.0:4317 - http: - endpoint: 0.0.0.0:4318 - prometheus: - config: - scrape_configs: - - job_name: 'datadog-agent' - scrape_interval: 10s - static_configs: - - targets: [ '0.0.0.0:8888' ] -exporters: - datadog: - traces: - span_name_as_resource_name: true - metrics: - resource_attributes_as_tags: true - hostname: "otelcol-docker" - api: - key: ${DD_API_KEY} -processors: - batch: - infraattributes: -extensions: - pprof: - health_check: - zpages: - endpoint: "localhost:55679" - ddflare: -service: - extensions: - [ - pprof, - zpages, - health_check, - ddflare, - ] - pipelines: - traces: - receivers: [otlp] - processors: [batch] - exporters: [datadog] - metrics: - receivers: [otlp, prometheus] - processors: [batch] - exporters: [datadog] - logs: - receivers: [otlp] - processors: [batch] - exporters: [datadog] diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go deleted file mode 100644 index 9541f507bdf1d..0000000000000 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_disabled_test.go +++ /dev/null @@ -1,71 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2016-present Datadog, Inc. - -// Package otelagent contains e2e otel agent tests -package otelagent - -import ( - _ "embed" - "testing" - - "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" - - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" - "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" -) - -type iaDisabledTestSuite struct { - e2e.BaseSuite[environments.Kubernetes] -} - -//go:embed config/ia_disabled.yml -var iaDisabledConfig string - -func TestOTelAgentIADisabled(t *testing.T) { - values := ` -agents: - containers: - agent: - env: - - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED - value: 'false' - otelAgent: - env: - - name: DD_OTELCOLLECTOR_CONVERTER_ENABLED - value: 'false' -` - t.Parallel() - e2e.Run(t, &iaDisabledTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaDisabledConfig))))) -} - -func (s *iaDisabledTestSuite) TestCalendarJavaApp() { - utils.TestCalendarJavaApp(s) -} - -func (s *iaDisabledTestSuite) TestCalendarGoApp() { - utils.TestCalendarGoApp(s) -} - -func (s *iaDisabledTestSuite) TestOTLPTraces() { - utils.TestTraces(s, false) -} - -func (s *iaDisabledTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s, false) -} - -func (s *iaDisabledTestSuite) TestOTLPLogs() { - utils.TestLogs(s, false) -} - -func (s *iaDisabledTestSuite) TestHosts() { - utils.TestHosts(s) -} - -func (s *iaDisabledTestSuite) TestPrometheusMetrics() { - utils.TestPrometheusMetrics(s) -} diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go index 05f9dc6351a4c..5f6b410c87d1b 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -8,13 +8,14 @@ package otelagent import ( _ "embed" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" "testing" "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -23,28 +24,37 @@ type iaEKSTestSuite struct { } func TestOTelAgentIAEKS(t *testing.T) { + values := ` +datadog: + logs: + containerCollectAll: false + containerCollectUsingFiles: false +` t.Parallel() - e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSLinuxNodeGroup(), awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) + e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } -func (s *iaEKSTestSuite) TestCalendarJavaApp() { - utils.TestCalendarJavaApp(s) +var eksParams = utils.IAParams{ + InfraAttributes: true, + EKS: true, + Cardinality: types.HighCardinality, } -func (s *iaEKSTestSuite) TestCalendarGoApp() { - utils.TestCalendarGoApp(s) +func (s *iaEKSTestSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + utils.TestCalendarApp(s) } func (s *iaEKSTestSuite) TestOTLPTraces() { - utils.TestTraces(s, true) + utils.TestTraces(s, eksParams) } func (s *iaEKSTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s, true) + utils.TestMetrics(s, eksParams) } func (s *iaEKSTestSuite) TestOTLPLogs() { - utils.TestLogs(s, true) + utils.TestLogs(s, eksParams) } func (s *iaEKSTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go index 95e4987ae3b63..6825d6a57ee2b 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -12,6 +12,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" @@ -26,28 +27,37 @@ type iaTestSuite struct { var iaConfig string func TestOTelAgentIA(t *testing.T) { + values := ` +datadog: + logs: + containerCollectAll: false + containerCollectUsingFiles: false +` t.Parallel() - e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) + e2e.Run(t, &iaTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } -func (s *iaTestSuite) TestCalendarJavaApp() { - utils.TestCalendarJavaApp(s) +var iaParams = utils.IAParams{ + InfraAttributes: true, + EKS: false, + Cardinality: types.HighCardinality, } -func (s *iaTestSuite) TestCalendarGoApp() { - utils.TestCalendarGoApp(s) +func (s *iaTestSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + utils.TestCalendarApp(s) } func (s *iaTestSuite) TestOTLPTraces() { - utils.TestTraces(s, true) + utils.TestTraces(s, iaParams) } func (s *iaTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s, true) + utils.TestMetrics(s, iaParams) } func (s *iaTestSuite) TestOTLPLogs() { - utils.TestLogs(s, true) + utils.TestLogs(s, iaParams) } func (s *iaTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/otel-agent/minimal_test.go b/test/new-e2e/tests/otel/otel-agent/minimal_test.go index 47721797020c5..b527fa29fdf47 100644 --- a/test/new-e2e/tests/otel/otel-agent/minimal_test.go +++ b/test/new-e2e/tests/otel/otel-agent/minimal_test.go @@ -12,6 +12,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" @@ -26,20 +27,37 @@ type minimalTestSuite struct { var minimalConfig string func TestOTelAgentMinimal(t *testing.T) { + values := ` +datadog: + logs: + containerCollectAll: false + containerCollectUsingFiles: false +` t.Parallel() - e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) + e2e.Run(t, &minimalTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(minimalConfig))))) +} + +var minimalParams = utils.IAParams{ + InfraAttributes: true, + EKS: false, + Cardinality: types.LowCardinality, +} + +func (s *minimalTestSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + utils.TestCalendarApp(s) } func (s *minimalTestSuite) TestOTLPTraces() { - utils.TestTraces(s, true) + utils.TestTraces(s, minimalParams) } func (s *minimalTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s, true) + utils.TestMetrics(s, minimalParams) } func (s *minimalTestSuite) TestOTLPLogs() { - utils.TestLogs(s, true) + utils.TestLogs(s, minimalParams) } func (s *minimalTestSuite) TestHosts() { @@ -57,11 +75,3 @@ func (s *minimalTestSuite) TestOTelAgentInstalled() { func (s *minimalTestSuite) TestOTelFlare() { utils.TestOTelFlare(s) } - -func (s *minimalTestSuite) TestCalendarJavaApp() { - utils.TestCalendarJavaApp(s) -} - -func (s *minimalTestSuite) TestCalendarGoApp() { - utils.TestCalendarGoApp(s) -} diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index 280615123993e..2c764e35e5113 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -43,16 +43,25 @@ agents: e2e.Run(t, &otlpIngestTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values))))) } +var otlpIngestParams = utils.IAParams{ + InfraAttributes: false, +} + +func (s *otlpIngestTestSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + utils.TestCalendarApp(s) +} + func (s *otlpIngestTestSuite) TestOTLPTraces() { - utils.TestTraces(s, false) + utils.TestTraces(s, otlpIngestParams) } func (s *otlpIngestTestSuite) TestOTLPMetrics() { - utils.TestMetrics(s, false) + utils.TestMetrics(s, otlpIngestParams) } func (s *otlpIngestTestSuite) TestOTLPLogs() { - utils.TestLogs(s, false) + utils.TestLogs(s, otlpIngestParams) } func (s *otlpIngestTestSuite) TestHosts() { diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index f8332e83a9969..878ed5bc315d8 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -9,6 +9,7 @@ package utils import ( "context" "fmt" + "maps" "strings" "testing" "time" @@ -21,6 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" fakeintake "github.com/DataDog/datadog-agent/test/fakeintake/client" @@ -28,7 +30,8 @@ import ( ) const ( - service = "telemetrygen-job" + calendarService = "calendar-rest-go" + telemetrygenService = "telemetrygen-job" env = "e2e" version = "1.0" customAttribute = "custom.attribute" @@ -41,15 +44,22 @@ type OTelTestSuite interface { Env() *environments.Kubernetes } +// IAParams contains options for different infra attribute testing scenarios +type IAParams struct { + // InfraAttributes indicates whether this test should check for infra attributes + InfraAttributes bool + + // EKS indicates if this test should check for EKS specific properties + EKS bool + + // Cardinality represents the tag cardinality used by this test + Cardinality types.TagCardinality +} + // TestTraces tests that OTLP traces are received through OTel pipelines as expected -func TestTraces(s OTelTestSuite, infraAttributes bool) { - ctx := context.Background() +func TestTraces(s OTelTestSuite, iaParams IAParams) { err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) - numTraces := 10 - - s.T().Log("Starting telemetrygen") - createTelemetrygenJob(ctx, s, "traces", []string{"--traces", fmt.Sprint(numTraces)}) var traces []*aggregator.TracePayload s.T().Log("Waiting for traces") @@ -62,93 +72,57 @@ func TestTraces(s OTelTestSuite, infraAttributes bool) { tp := trace.TracerPayloads[0] assert.NotEmpty(s.T(), tp.Chunks) assert.NotEmpty(s.T(), tp.Chunks[0].Spans) - assert.Equal(s.T(), service, tp.Chunks[0].Spans[0].Service) - if infraAttributes { + assert.Equal(s.T(), calendarService, tp.Chunks[0].Spans[0].Service) + if iaParams.InfraAttributes { ctags, ok := getContainerTags(s.T(), tp) assert.True(s.T(), ok) assert.NotNil(s.T(), ctags["kube_ownerref_kind"]) } }, 5*time.Minute, 10*time.Second) require.NotEmpty(s.T(), traces) - s.T().Log("Got traces", traces) - s.T().Log("num traces", len(traces)) - trace := traces[0] - require.NotEmpty(s.T(), trace.TracerPayloads) + s.T().Log("Got traces", s.T().Name(), traces) // Verify tags on traces and spans - tp := trace.TracerPayloads[0] - ctags, ok := getContainerTags(s.T(), tp) - require.True(s.T(), ok) + tp := traces[0].TracerPayloads[0] assert.Equal(s.T(), env, tp.Env) assert.Equal(s.T(), version, tp.AppVersion) require.NotEmpty(s.T(), tp.Chunks) require.NotEmpty(s.T(), tp.Chunks[0].Spans) spans := tp.Chunks[0].Spans for _, sp := range spans { - assert.Equal(s.T(), service, sp.Service) + assert.Equal(s.T(), calendarService, sp.Service) assert.Equal(s.T(), env, sp.Meta["env"]) assert.Equal(s.T(), version, sp.Meta["version"]) assert.Equal(s.T(), customAttributeValue, sp.Meta[customAttribute]) - assert.Equal(s.T(), "telemetrygen", sp.Meta["otel.library.name"]) + assert.Equal(s.T(), "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp", sp.Meta["otel.library.name"]) assert.Equal(s.T(), sp.Meta["k8s.node.name"], tp.Hostname) - - // Verify container tags from infraattributes processor - assert.NotNil(s.T(), ctags["kube_container_name"]) - assert.NotNil(s.T(), ctags["kube_namespace"]) - assert.NotNil(s.T(), ctags["pod_name"]) + ctags, ok := getContainerTags(s.T(), tp) + assert.True(s.T(), ok) assert.Equal(s.T(), sp.Meta["k8s.container.name"], ctags["kube_container_name"]) assert.Equal(s.T(), sp.Meta["k8s.namespace.name"], ctags["kube_namespace"]) assert.Equal(s.T(), sp.Meta["k8s.pod.name"], ctags["pod_name"]) - } - TestAPMStats(s, numTraces) -} -// TestAPMStats checks that APM stats are received with the correct number of hits per traces given -func TestAPMStats(s OTelTestSuite, numTraces int) { - s.T().Log("Waiting for APM stats") - var stats []*aggregator.APMStatsPayload - var err error - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - stats, err = s.Env().FakeIntake.Client().GetAPMStats() - assert.NoError(c, err) - assert.NotEmpty(c, stats) - hasStatsForService := false - for _, payload := range stats { - for _, csp := range payload.StatsPayload.Stats { - for _, bucket := range csp.Stats { - for _, cgs := range bucket.Stats { - if cgs.Service == service { - hasStatsForService = true - assert.EqualValues(c, cgs.Hits, numTraces) - assert.EqualValues(c, cgs.TopLevelHits, numTraces) - } - } - } - } + // Verify container tags from infraattributes processor + if iaParams.InfraAttributes { + maps.Copy(ctags, sp.Meta) + testInfraTags(s.T(), ctags, iaParams) } - assert.True(c, hasStatsForService) - }, 2*time.Minute, 10*time.Second) - s.T().Log("Got APM stats", stats) + } } // TestMetrics tests that OTLP metrics are received through OTel pipelines as expected -func TestMetrics(s OTelTestSuite, infraAttributes bool) { - ctx := context.Background() +func TestMetrics(s OTelTestSuite, iaParams IAParams) { err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) - numMetrics := 10 - - s.T().Log("Starting telemetrygen") - createTelemetrygenJob(ctx, s, "metrics", []string{"--metrics", fmt.Sprint(numMetrics)}) var metrics []*aggregator.MetricSeries s.T().Log("Waiting for metrics") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - tags := []string{fmt.Sprintf("service:%v", service)} - if infraAttributes { - tags = append(tags, "kube_ownerref_kind:job") + tags := []string{fmt.Sprintf("service:%v", calendarService)} + if iaParams.InfraAttributes { + tags = append(tags, "kube_ownerref_kind:replicaset") } - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries](tags)) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries](tags)) assert.NoError(c, err) assert.NotEmpty(c, metrics) }, 5*time.Minute, 10*time.Second) @@ -156,19 +130,13 @@ func TestMetrics(s OTelTestSuite, infraAttributes bool) { for _, metricSeries := range metrics { tags := getTagMapFromSlice(s.T(), metricSeries.Tags) - assert.Equal(s.T(), service, tags["service"]) + assert.Equal(s.T(), calendarService, tags["service"]) assert.Equal(s.T(), env, tags["env"]) assert.Equal(s.T(), version, tags["version"]) assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) - - // Verify container tags from infraattributes processor - assert.NotNil(s.T(), tags["kube_container_name"]) - assert.NotNil(s.T(), tags["kube_namespace"]) - assert.NotNil(s.T(), tags["pod_name"]) assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) - hasHostResource := false for _, resource := range metricSeries.Resources { if resource.Type == "host" { @@ -177,68 +145,54 @@ func TestMetrics(s OTelTestSuite, infraAttributes bool) { } } assert.True(s.T(), hasHostResource) + // Verify container tags from infraattributes processor + testInfraTags(s.T(), tags, iaParams) } } // TestLogs tests that OTLP logs are received through OTel pipelines as expected -func TestLogs(s OTelTestSuite, infraAttributes bool) { - ctx := context.Background() +func TestLogs(s OTelTestSuite, iaParams IAParams) { err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) - numLogs := 10 - logBody := "telemetrygen log" - - s.T().Log("Starting telemetrygen") - ddtags := fmt.Sprintf("ddtags=\"k8s.namespace.name:$(OTEL_K8S_NAMESPACE),k8s.node.name:$(OTEL_K8S_NODE_NAME),k8s.pod.name:$(OTEL_K8S_POD_NAME),k8s.container.name:telemetrygen-job,%v:%v\"", customAttribute, customAttributeValue) - createTelemetrygenJob(ctx, s, "logs", []string{"--logs", fmt.Sprint(numLogs), "--body", logBody, "--telemetry-attributes", ddtags}) + logBody := "random date" var logs []*aggregator.Log s.T().Log("Waiting for logs") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - if infraAttributes { - logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody), fakeintake.WithTags[*aggregator.Log]([]string{"kube_ownerref_kind:job"})) + if iaParams.InfraAttributes { + logs, err = s.Env().FakeIntake.Client().FilterLogs(calendarService, fakeintake.WithMessageContaining(logBody), fakeintake.WithTags[*aggregator.Log]([]string{"kube_ownerref_kind:replicaset"})) } else { - logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) + logs, err = s.Env().FakeIntake.Client().FilterLogs(calendarService, fakeintake.WithMessageContaining(logBody)) } assert.NoError(c, err) assert.NotEmpty(c, logs) }, 5*time.Minute, 10*time.Second) - s.T().Log("Got logs", logs) + for _, l := range logs { + s.T().Log("Got log", l) + } require.NotEmpty(s.T(), logs) for _, log := range logs { assert.Contains(s.T(), log.Message, logBody) tags := getTagMapFromSlice(s.T(), log.Tags) - assert.Equal(s.T(), service, tags["service"]) + assert.Equal(s.T(), calendarService, tags["service"]) assert.Equal(s.T(), env, tags["env"]) assert.Equal(s.T(), version, tags["version"]) assert.Equal(s.T(), customAttributeValue, tags[customAttribute]) assert.Equal(s.T(), tags["k8s.node.name"], log.HostName) - - // Verify container tags from infraattributes processor - assert.NotNil(s.T(), tags["kube_container_name"]) - assert.NotNil(s.T(), tags["kube_namespace"]) - assert.NotNil(s.T(), tags["pod_name"]) assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) + // Verify container tags from infraattributes processor + testInfraTags(s.T(), tags, iaParams) } } // TestHosts verifies that OTLP traces, metrics, and logs have consistent hostnames func TestHosts(s OTelTestSuite) { - ctx := context.Background() err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) - numTelemetry := 10 - logBody := "telemetrygen log" - - s.T().Log("Starting telemetrygen traces") - createTelemetrygenJob(ctx, s, "traces", []string{"--traces", fmt.Sprint(numTelemetry)}) - s.T().Log("Starting telemetrygen metrics") - createTelemetrygenJob(ctx, s, "metrics", []string{"--metrics", fmt.Sprint(numTelemetry)}) - s.T().Log("Starting telemetrygen logs") - createTelemetrygenJob(ctx, s, "logs", []string{"--logs", fmt.Sprint(numTelemetry), "--body", logBody}) + logBody := "random date" var traces []*aggregator.TracePayload var metrics []*aggregator.MetricSeries @@ -249,11 +203,11 @@ func TestHosts(s OTelTestSuite) { assert.NoError(c, err) assert.NotEmpty(c, traces) - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("gen", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", service)})) + metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{fmt.Sprintf("service:%v", calendarService)})) assert.NoError(c, err) assert.NotEmpty(c, metrics) - logs, err = s.Env().FakeIntake.Client().FilterLogs(service, fakeintake.WithMessageContaining(logBody)) + logs, err = s.Env().FakeIntake.Client().FilterLogs(calendarService, fakeintake.WithMessageContaining(logBody)) assert.NoError(c, err) assert.NotEmpty(c, logs) }, 2*time.Minute, 10*time.Second) @@ -291,6 +245,34 @@ func TestSampling(s OTelTestSuite) { TestAPMStats(s, numTraces) } +// TestAPMStats checks that APM stats are received with the correct number of hits per traces given +func TestAPMStats(s OTelTestSuite, numTraces int) { + s.T().Log("Waiting for APM stats") + var stats []*aggregator.APMStatsPayload + var err error + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + stats, err = s.Env().FakeIntake.Client().GetAPMStats() + assert.NoError(c, err) + assert.NotEmpty(c, stats) + hasStatsForService := false + for _, payload := range stats { + for _, csp := range payload.StatsPayload.Stats { + for _, bucket := range csp.Stats { + for _, cgs := range bucket.Stats { + if cgs.Service == telemetrygenService { + hasStatsForService = true + assert.EqualValues(c, cgs.Hits, numTraces) + assert.EqualValues(c, cgs.TopLevelHits, numTraces) + } + } + } + } + } + assert.True(c, hasStatsForService) + }, 2*time.Minute, 10*time.Second) + s.T().Log("Got APM stats", stats) +} + // TestPrometheusMetrics tests that expected prometheus metrics are scraped func TestPrometheusMetrics(s OTelTestSuite) { err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() @@ -316,14 +298,6 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin var ttlSecondsAfterFinished int32 = 0 //nolint:revive // We want to see this is explicitly set to 0 var backOffLimit int32 = 4 - if s.Env().Agent == nil { - s.T().Log("AGENT NIL") - } - - if s.Env().Agent != nil { - s.T().Log("LinuxNodeAgent.LabelSelectors", s.Env().Agent.LinuxNodeAgent.LabelSelectors) - } - otlpEndpoint := fmt.Sprintf("%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) jobSpec := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ @@ -338,7 +312,7 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin { Env: []corev1.EnvVar{{ Name: "OTEL_SERVICE_NAME", - Value: service, + Value: telemetrygenService, }, { Name: "OTEL_K8S_POD_ID", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, @@ -380,158 +354,20 @@ func createTelemetrygenJob(ctx context.Context, s OTelTestSuite, telemetry strin require.NoError(s.T(), err, "Could not properly start job") } -func createJavaCalendarApp(ctx context.Context, s OTelTestSuite) { - var replicas int32 = 1 - - name := fmt.Sprintf("calendar-java-otel-%v", strings.ReplaceAll(strings.ToLower(s.T().Name()), "/", "-")) - otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) - serviceSpec := &corev1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Labels: map[string]string{ - "helm.sh/chart": "calendar-java-otel-0.1.0", - "app.kubernetes.io/name": name, - "app.kubernetes.io/instance": name, - "app.kubernetes.io/version": "1.16.0", - "app.kubernetes.io/managed-by": "Helm", - }, - Annotations: map[string]string{ - "openshift.io/deployment.name": "openshift", - }, - }, - Spec: corev1.ServiceSpec{ - Type: corev1.ServiceTypeClusterIP, - Ports: []corev1.ServicePort{ - { - Port: 9090, - TargetPort: intstr.IntOrString{ - StrVal: "http", - }, - Protocol: "TCP", - Name: "http", - }, - }, - Selector: map[string]string{ - "app.kubernetes.io/name": name, - "app.kubernetes.io/instance": name, - }, - }, - } - deploymentSpec := &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Labels: map[string]string{ - "helm.sh/chart": "calendar-java-otel-0.1.0", - "app.kubernetes.io/name": name, - "app.kubernetes.io/instance": name, - "app.kubernetes.io/version": "1.16.0", - "app.kubernetes.io/managed-by": "Helm", - }, - Annotations: map[string]string{ - "openshift.io/deployment.name": "openshift", - }, - }, - Spec: appsv1.DeploymentSpec{ - Replicas: &replicas, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app.kubernetes.io/name": name, - "app.kubernetes.io/instance": name, - }, - }, - Template: corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "app.kubernetes.io/name": name, - "app.kubernetes.io/instance": name, - }, - }, - Spec: corev1.PodSpec{ - Containers: []corev1.Container{{ - Name: name, - Image: "datadog/opentelemetry-examples:calendar-java-20240826", - ImagePullPolicy: "IfNotPresent", - Ports: []corev1.ContainerPort{{ - Name: "http", - ContainerPort: 9090, - Protocol: "TCP", - }}, - LivenessProbe: &corev1.Probe{ - ProbeHandler: corev1.ProbeHandler{ - HTTPGet: &corev1.HTTPGetAction{ - Path: "/calendar", - Port: intstr.FromString("http"), - }, - }, - }, - ReadinessProbe: &corev1.Probe{ - ProbeHandler: corev1.ProbeHandler{ - HTTPGet: &corev1.HTTPGetAction{ - Path: "/calendar", - Port: intstr.FromString("http"), - }, - }, - }, - Env: []corev1.EnvVar{{ - Name: "OTEL_SERVICE_NAME", - Value: "calendar-java-otel", - }, { - Name: "OTEL_CONTAINER_NAME", - Value: name, - }, { - Name: "OTEL_K8S_NAMESPACE", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}, - }, { - Name: "OTEL_K8S_NODE_NAME", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "spec.nodeName"}}, - }, { - Name: "OTEL_K8S_POD_NAME", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, - }, { - Name: "OTEL_K8S_POD_ID", - ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.uid"}}, - }, { - Name: "OTEL_EXPORTER_OTLP_ENDPOINT", - Value: otlpEndpoint, - }, { - Name: "OTEL_EXPORTER_OTLP_PROTOCOL", - Value: "grpc", - }, { - Name: "OTEL_RESOURCE_ATTRIBUTES", - Value: "service.name=$(OTEL_SERVICE_NAME)," + - "k8s.namespace.name=$(OTEL_K8S_NAMESPACE)," + - "k8s.node.name=$(OTEL_K8S_NODE_NAME)," + - "k8s.pod.name=$(OTEL_K8S_POD_NAME)," + - "k8s.pod.uid=$(OTEL_K8S_POD_ID)," + - "k8s.container.name=calendar-java-otel," + - "host.name=$(OTEL_K8S_NODE_NAME)," + - "deployment.environment=$(OTEL_K8S_NAMESPACE)", - }}, - }, - }, - }, - }, - }, - } +// TestCalendarApp tests that OTLP metrics are received through OTel pipelines as expected +func TestCalendarApp(s OTelTestSuite) { + ctx := context.Background() + err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() + require.NoError(s.T(), err) - _, err := s.Env().KubernetesCluster.Client().CoreV1().Services("datadog").Create(ctx, serviceSpec, metav1.CreateOptions{}) - require.NoError(s.T(), err, "Could not properly start service") - _, err = s.Env().KubernetesCluster.Client().AppsV1().Deployments("datadog").Create(ctx, deploymentSpec, metav1.CreateOptions{}) - require.NoError(s.T(), err, "Could not properly start deployment") + s.T().Log("Starting calendar app") + createCalendarApp(ctx, s) } -func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { +func createCalendarApp(ctx context.Context, s OTelTestSuite) { var replicas int32 = 1 name := fmt.Sprintf("calendar-rest-go-%v", strings.ReplaceAll(strings.ToLower(s.T().Name()), "/", "-")) - if s.Env().Agent == nil { - s.T().Log("AGENT NIL") - } - - if s.Env().Agent != nil { - s.T().Log("LinuxNodeAgent.LabelSelectors", s.Env().Agent.LinuxNodeAgent.LabelSelectors) - } - otlpEndpoint := fmt.Sprintf("http://%v:4317", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]) serviceSpec := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ @@ -567,7 +403,7 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { } deploymentSpec := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ - Name: "calendar-rest-go", + Name: name, Labels: map[string]string{ "helm.sh/chart": "calendar-rest-go-0.1.0", "app.kubernetes.io/name": name, @@ -590,14 +426,17 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ - "app.kubernetes.io/name": name, - "app.kubernetes.io/instance": name, + "helm.sh/chart": "calendar-rest-go-0.1.0", + "app.kubernetes.io/name": name, + "app.kubernetes.io/instance": name, + "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/managed-by": "Helm", }, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: name, - Image: "datadog/opentelemetry-examples:calendar-go-rest-0.14", + Image: "stanleyliu855/manual-container-metrics:1.0", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ Name: "http", @@ -622,7 +461,7 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { }, Env: []corev1.EnvVar{{ Name: "OTEL_SERVICE_NAME", - Value: "calendar-rest-go", + Value: calendarService, }, { Name: "OTEL_CONTAINER_NAME", Value: name, @@ -651,9 +490,10 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { "k8s.node.name=$(OTEL_K8S_NODE_NAME)," + "k8s.pod.name=$(OTEL_K8S_POD_NAME)," + "k8s.pod.uid=$(OTEL_K8S_POD_ID)," + - "k8s.container.name=calendar-rest-go," + + "k8s.container.name=$(OTEL_CONTAINER_NAME)," + "host.name=$(OTEL_K8S_NODE_NAME)," + - "deployment.environment=$(OTEL_K8S_NAMESPACE)", + fmt.Sprintf("deployment.environment=%v", env) + + fmt.Sprintf("service.version=%v", version), }}, }, }, @@ -668,48 +508,29 @@ func createGoCalendarApp(ctx context.Context, s OTelTestSuite) { require.NoError(s.T(), err, "Could not properly start deployment") } -// TestCalendarJavaApp tests that OTLP metrics are received through OTel pipelines as expected -func TestCalendarJavaApp(s OTelTestSuite) { - ctx := context.Background() - err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - require.NoError(s.T(), err) - - s.T().Log("Starting app") - createJavaCalendarApp(ctx, s) - - var metrics []*aggregator.MetricSeries - var mn []string - s.T().Log("Waiting for metrics") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - mn, err = s.Env().FakeIntake.Client().GetMetricNames() - s.T().Log("CalendarJavaApp Metric Names", s.T().Name(), mn) - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar.api.hits", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-java-otel"})) - assert.NoError(c, err) - assert.NotEmpty(c, metrics) - }, 5*time.Minute, 10*time.Second) - s.T().Log("Got metrics", s.T().Name(), metrics) -} - -// TestCalendarGoApp tests that OTLP metrics are received through OTel pipelines as expected -func TestCalendarGoApp(s OTelTestSuite) { - ctx := context.Background() - err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() - require.NoError(s.T(), err) - - s.T().Log("Starting app") - createGoCalendarApp(ctx, s) - - var metrics []*aggregator.MetricSeries - var mn []string - s.T().Log("Waiting for metrics") - require.EventuallyWithT(s.T(), func(c *assert.CollectT) { - mn, err = s.Env().FakeIntake.Client().GetMetricNames() - s.T().Log("CalendarGoApp Metric Names", s.T().Name(), mn) - metrics, err = s.Env().FakeIntake.Client().FilterMetrics("calendar-rest-go.api.counter", fakeintake.WithTags[*aggregator.MetricSeries]([]string{"service.name:calendar-rest-go", "kube_ownerref_kind:replicaset"})) - assert.NoError(c, err) - assert.NotEmpty(c, metrics) - }, 5*time.Minute, 10*time.Second) - s.T().Log("Got metrics", s.T().Name(), metrics) +func testInfraTags(t *testing.T, tags map[string]string, iaParams IAParams) { + assert.NotNil(t, tags["kube_deployment"]) + assert.NotNil(t, tags["kube_qos"]) + assert.NotNil(t, tags["kube_replica_set"]) + assert.NotNil(t, tags["pod_phase"]) + assert.Equal(t, "replicaset", tags["kube_ownerref_kind"]) + assert.Equal(t, tags["kube_app_instance"], tags["kube_app_name"]) + assert.Contains(t, tags["k8s.pod.name"], tags["kube_replica_set"]) + + if iaParams.EKS { + assert.NotNil(t, tags["container_id"]) + assert.NotNil(t, tags["image_id"]) + assert.NotNil(t, tags["image_name"]) + assert.NotNil(t, tags["image_tag"]) + assert.NotNil(t, tags["short_image"]) + } + if iaParams.Cardinality == types.OrchestratorCardinality || iaParams.Cardinality == types.HighCardinality { + assert.Contains(t, tags["k8s.pod.name"], tags["kube_ownerref_name"]) + assert.Equal(t, tags["kube_replica_set"], tags["kube_ownerref_name"]) + } + if iaParams.Cardinality == types.HighCardinality && iaParams.EKS { + assert.NotNil(t, tags["display_container_name"]) + } } func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, bool) { From af5dae784692080888d961a6b91e774e7e653443 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 00:46:44 -0400 Subject: [PATCH 33/47] go mod tidy --- test/new-e2e/go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index 2ec57f981ec9a..f0bd7f1a3699d 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -12,6 +12,8 @@ replace ( github.com/DataDog/datadog-agent/comp/core/tagger/types => ../../comp/core/tagger/types github.com/DataDog/datadog-agent/comp/core/tagger/utils => ../../comp/core/tagger/utils github.com/DataDog/datadog-agent/comp/netflow/payload => ../../comp/netflow/payload + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../pkg/config/nodetreemodel + github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/proto => ../../pkg/proto github.com/DataDog/datadog-agent/pkg/trace => ../../pkg/trace github.com/DataDog/datadog-agent/pkg/util/optional => ../../pkg/util/optional @@ -20,8 +22,6 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/tagger => ../../pkg/util/tagger github.com/DataDog/datadog-agent/pkg/util/testutil => ../../pkg/util/testutil github.com/DataDog/datadog-agent/pkg/version => ../../pkg/version - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../pkg/config/nodetreemodel - github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../pkg/config/teeconfig github.com/DataDog/datadog-agent/test/fakeintake => ../fakeintake ) From b6e70c5f70af0cdf980cb6c0e9c35b567e6294ee Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 09:16:20 -0400 Subject: [PATCH 34/47] Fix tests --- test/new-e2e/go.mod | 20 ++++++++ test/new-e2e/go.sum | 46 +++---------------- .../tests/otel/utils/pipelines_utils.go | 2 +- 3 files changed, 27 insertions(+), 41 deletions(-) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index f0bd7f1a3699d..b4186b60a308f 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -9,18 +9,36 @@ toolchain go1.22.6 // TODO: Implement hard check in CI replace ( + github.com/DataDog/datadog-agent/comp/api/def => ../../comp/api/def + github.com/DataDog/datadog-agent/comp/core/flare/builder => ../../comp/core/flare/builder + github.com/DataDog/datadog-agent/comp/core/flare/types => ../../comp/core/flare/types + github.com/DataDog/datadog-agent/comp/core/secrets => ../../comp/core/secrets github.com/DataDog/datadog-agent/comp/core/tagger/types => ../../comp/core/tagger/types github.com/DataDog/datadog-agent/comp/core/tagger/utils => ../../comp/core/tagger/utils + github.com/DataDog/datadog-agent/comp/core/telemetry => ../../comp/core/telemetry + github.com/DataDog/datadog-agent/comp/def => ../../comp/def github.com/DataDog/datadog-agent/comp/netflow/payload => ../../comp/netflow/payload + github.com/DataDog/datadog-agent/pkg/collector/check/defaults => ../../pkg/collector/check/defaults + github.com/DataDog/datadog-agent/pkg/config/env => ../../pkg/config/env + github.com/DataDog/datadog-agent/pkg/config/model => ../../pkg/config/model github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../pkg/config/nodetreemodel + github.com/DataDog/datadog-agent/pkg/config/setup => ../../pkg/config/setup github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/proto => ../../pkg/proto github.com/DataDog/datadog-agent/pkg/trace => ../../pkg/trace + github.com/DataDog/datadog-agent/pkg/util/executable => ../../pkg/util/executable + github.com/DataDog/datadog-agent/pkg/util/filesystem => ../../pkg/util/filesystem + github.com/DataDog/datadog-agent/pkg/util/fxutil => ../../pkg/util/fxutil + github.com/DataDog/datadog-agent/pkg/util/hostname/validate => ../../pkg/util/hostname/validate + github.com/DataDog/datadog-agent/pkg/util/log => ../../pkg/util/log github.com/DataDog/datadog-agent/pkg/util/optional => ../../pkg/util/optional github.com/DataDog/datadog-agent/pkg/util/pointer => ../../pkg/util/pointer github.com/DataDog/datadog-agent/pkg/util/scrubber => ../../pkg/util/scrubber + github.com/DataDog/datadog-agent/pkg/util/system => ../../pkg/util/system + github.com/DataDog/datadog-agent/pkg/util/system/socket => ../../pkg/util/system/socket github.com/DataDog/datadog-agent/pkg/util/tagger => ../../pkg/util/tagger github.com/DataDog/datadog-agent/pkg/util/testutil => ../../pkg/util/testutil + github.com/DataDog/datadog-agent/pkg/util/winutil => ../../pkg/util/winutil github.com/DataDog/datadog-agent/pkg/version => ../../pkg/version github.com/DataDog/datadog-agent/test/fakeintake => ../fakeintake ) @@ -283,7 +301,9 @@ require ( github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/config/env v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/config/model v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2 // indirect diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index 6d764bffc615a..efd787d48ab2c 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -8,42 +8,8 @@ github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DataDog/agent-payload/v5 v5.0.122 h1:tGhU9UMjUiVaX3iR+nZX20TRmzyrIvVGTkWbbrR7bDA= github.com/DataDog/agent-payload/v5 v5.0.122/go.mod h1:FgVQKmVdqdmZTbxIptqJC/l+xEzdiXsaAOs/vGAvWzs= -github.com/DataDog/datadog-agent/comp/api/api/def v0.56.2 h1:EYLWks4f2GeqzwvhyvfhARVpmBRQaoKARvnbKoSk7Kg= -github.com/DataDog/datadog-agent/comp/api/api/def v0.56.2/go.mod h1:B7o1FsKlzr4JSS+CYKYuyABr3eaaq2W7fIA56ntxGHQ= -github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.2 h1:wIGNGeNJPaX7byBWBPnaL4clGAEeIl3IR4o/v+vGIno= -github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.2/go.mod h1:oPs3OkQOyKRX/kERWQGMpIHG6j9J5kIlBdm2R6OyWHE= -github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.2 h1:3SeIZmDiXPKGNJKHF2C7KNWjuCM1vLJ+vBtWKpIsrqU= -github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.2/go.mod h1:SUizcQZHTU7Aezk/XKiZjPpt7Ng8x4AsAcr5PlxyP7w= -github.com/DataDog/datadog-agent/comp/core/secrets v0.56.2 h1:6/FSx8WPy/L86LFPWB0YPsiWLvIvcvFbWnba/PDkeo0= -github.com/DataDog/datadog-agent/comp/core/secrets v0.56.2/go.mod h1:gIs5mmRdE2epD1iYxNvdx2EhXrUfa2jebR+CU+0vYCo= -github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.2 h1:oMhfpqlRYwyhUdiN/mQRvI/aWkQERsGWBQscdDwQZ3A= -github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.2/go.mod h1:YkMtv/JWcPabF1jGiReg6eCuFYXyFi5PxOMoNTlFiJs= -github.com/DataDog/datadog-agent/comp/def v0.56.2 h1:EOQj5viXX5l47Su32muRE5uILjdNDsgiOcEqsi6BNgc= -github.com/DataDog/datadog-agent/comp/def v0.56.2/go.mod h1:DEWoZ2fdGE8yy5Q/p8w06DLm3cBWxW8i9a/xNUxE2qc= -github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 h1:OWZmy3BPMkjDjDp+mIYdGS+jjFUx3jK/sDJI/AjtvaY= -github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2/go.mod h1:s9QBNtoBURzy/0FeBInQ7kawNj04OnBNUo8xYr26z3E= -github.com/DataDog/datadog-agent/pkg/config/env v0.56.2 h1:TWsAiPjYKomf5FqRodShgzRRI+oP/537/myvW5GIXT8= -github.com/DataDog/datadog-agent/pkg/config/env v0.56.2/go.mod h1:1gXwnxusuGZQim0dtfidr7P1R/WGZGwY4HJvLKJUqMk= -github.com/DataDog/datadog-agent/pkg/config/model v0.56.2 h1:XjB3XpimhNFgHYztUZAFTbSg7G3BzbVqAdYhbf3OSEs= -github.com/DataDog/datadog-agent/pkg/config/model v0.56.2/go.mod h1:wm7zXdwf0zknLgc9lpz2H70fRP2xA9WHL0LEscxtDXQ= -github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2 h1:WMKs6IwIUpPrZ8KoiTL2Dw6y7UUQJs8v7VkuZc1s0jA= -github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2/go.mod h1:fYK7gt2JvuTmS5JeGCxui1Id8ZFkv2PUJrdnBvNhlxQ= -github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2 h1:XN+YzFS2mUF9OYrxQIPZdgiYhJzc+CUZgrXs8WL8y/A= -github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2/go.mod h1:mSSn2OzsdgoUnPyBmF8rEDU+ee1RFp+H6LFsJSteN9o= -github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2 h1:Lhy+q1zl9EQSM97ixD770xwFirtPF/69O13qnO8OxHo= -github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2/go.mod h1:GD+HjlsNGhPAjAYrNjt/XXq+lHgor1Piia+Mlat/97s= -github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.2 h1:FOnoG/i37bWlZfVhS/a1icX83dUtSCsixZYi3qTxT1s= -github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.2/go.mod h1:bI6jSFleEMzkMlm+dmjNs4T7a6R9PDIgWdAyW6cIBkY= -github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2 h1:1lgz81YwRXqGqYqX65mTDBHWLgpUBP67giv3sVthYig= -github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2/go.mod h1:g+gn4N6q/QoVjAvMFWJFcTc8nnwVx2LqaUEoj0Y/MSE= -github.com/DataDog/datadog-agent/pkg/util/log v0.56.2 h1:dcdsyPFTHFr+Cl/OfNt5VJWZl/TY0Xo5KYTDD316Ep4= -github.com/DataDog/datadog-agent/pkg/util/log v0.56.2/go.mod h1:DWliXBL5ROdWFjUHuh5fh5ve5zHydidMM/hE/w3j/Ww= -github.com/DataDog/datadog-agent/pkg/util/system v0.56.2 h1:yPztPIEPPeDgxJoOFVVR9lcIA2NF8ScGdplU2puav1U= -github.com/DataDog/datadog-agent/pkg/util/system v0.56.2/go.mod h1:AbeAoUquORgGoRhQ9hDqJO/n4nCw7+/k5dgq/ZysWWI= -github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2 h1:EQuMMdAd7uTeYCcHsyL6mUixMGtcU0PiAjea170xEAA= -github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2/go.mod h1:tBwAMDAEJEaZ5VNe19GJoLLzviZGOPUJH0WnzETWhyY= -github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2 h1:5Cg+O4+Npt8BMuot5KpRdN5TVw9lqRxUBkcr6W9Bss8= -github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2/go.mod h1:lZaWAGe78MiYFRHwbHS1NikRXtiYz3CsEiYbyMJyPTk= +github.com/DataDog/datadog-agent/comp/api/api/def v0.56.0-rc.3 h1:IG/rw4De+THSrGYLickNl7BKLRhwt3vxboAMvEhiHZg= +github.com/DataDog/datadog-agent/comp/api/api/def v0.56.0-rc.3/go.mod h1:Coyh0zcmY+SA7XBWSq/FBXrpV3obQ0AgnslbwHdhLSQ= github.com/DataDog/datadog-api-client-go v1.16.0 h1:5jOZv1m98criCvYTa3qpW8Hzv301nbZX3K9yJtwGyWY= github.com/DataDog/datadog-api-client-go v1.16.0/go.mod h1:PgrP2ABuJWL3Auw2iEkemAJ/r72ghG4DQQmb5sgnKW4= github.com/DataDog/datadog-api-client-go/v2 v2.27.0 h1:AGZj41frjnjMufQHQbJH2fzmifOs20wpmVDtIBCv33E= @@ -714,10 +680,10 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 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/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= -go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= -go.uber.org/fx v1.18.2 h1:bUNI6oShr+OVFQeU8cDNbnN7VFsu+SsjHzUF51V/GAU= -go.uber.org/fx v1.18.2/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY= +go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= +go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= +go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= +go.uber.org/fx v1.22.2/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 878ed5bc315d8..edfe7adf00a99 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -436,7 +436,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: name, - Image: "stanleyliu855/manual-container-metrics:1.0", + Image: "stanleyliu855/calendar-rest-go:0.15.0", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ Name: "http", From fbee8cc1cdaade64d047ef7fc9cfc4cd40b1f079 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 09:26:19 -0400 Subject: [PATCH 35/47] go mod tidy --- test/new-e2e/go.mod | 1 + test/new-e2e/go.sum | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index b4186b60a308f..0c2a608d07af7 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -9,6 +9,7 @@ toolchain go1.22.6 // TODO: Implement hard check in CI replace ( + github.com/DataDog/datadog-agent/comp/api/api/def => ../../comp/api/api/def github.com/DataDog/datadog-agent/comp/api/def => ../../comp/api/def github.com/DataDog/datadog-agent/comp/core/flare/builder => ../../comp/core/flare/builder github.com/DataDog/datadog-agent/comp/core/flare/types => ../../comp/core/flare/types diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index efd787d48ab2c..b00088a0ae164 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -8,8 +8,6 @@ github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DataDog/agent-payload/v5 v5.0.122 h1:tGhU9UMjUiVaX3iR+nZX20TRmzyrIvVGTkWbbrR7bDA= github.com/DataDog/agent-payload/v5 v5.0.122/go.mod h1:FgVQKmVdqdmZTbxIptqJC/l+xEzdiXsaAOs/vGAvWzs= -github.com/DataDog/datadog-agent/comp/api/api/def v0.56.0-rc.3 h1:IG/rw4De+THSrGYLickNl7BKLRhwt3vxboAMvEhiHZg= -github.com/DataDog/datadog-agent/comp/api/api/def v0.56.0-rc.3/go.mod h1:Coyh0zcmY+SA7XBWSq/FBXrpV3obQ0AgnslbwHdhLSQ= github.com/DataDog/datadog-api-client-go v1.16.0 h1:5jOZv1m98criCvYTa3qpW8Hzv301nbZX3K9yJtwGyWY= github.com/DataDog/datadog-api-client-go v1.16.0/go.mod h1:PgrP2ABuJWL3Auw2iEkemAJ/r72ghG4DQQmb5sgnKW4= github.com/DataDog/datadog-api-client-go/v2 v2.27.0 h1:AGZj41frjnjMufQHQbJH2fzmifOs20wpmVDtIBCv33E= From 1037dfbb7c12669c3c7da96d534cc34f742df993 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 09:41:37 -0400 Subject: [PATCH 36/47] Fix test --- test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go | 2 +- test/new-e2e/tests/otel/utils/pipelines_utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go index 5f6b410c87d1b..036b48d368909 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -31,7 +31,7 @@ datadog: containerCollectUsingFiles: false ` t.Parallel() - e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) + e2e.Run(t, &iaEKSTestSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner(awskubernetes.WithEKSLinuxNodeGroup(), awskubernetes.WithAgentOptions(kubernetesagentparams.WithoutDualShipping(), kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithOTelAgent(), kubernetesagentparams.WithOTelConfig(iaConfig))))) } var eksParams = utils.IAParams{ diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index edfe7adf00a99..597a6d50b0a35 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -436,7 +436,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: name, - Image: "stanleyliu855/calendar-rest-go:0.15.0", + Image: "datadog/opentelemetry-examples:calendar-go-rest-0.14", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ Name: "http", From 3c50783937bf601cfa1500edfaf098dc7666bfdc Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 15:53:08 -0400 Subject: [PATCH 37/47] Fix logs test --- .../tests/otel/utils/pipelines_utils.go | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 597a6d50b0a35..af5c445312831 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -8,6 +8,7 @@ package utils import ( "context" + "encoding/json" "fmt" "maps" "strings" @@ -36,6 +37,7 @@ const ( version = "1.0" customAttribute = "custom.attribute" customAttributeValue = "true" + logBody = "random date" ) // OTelTestSuite is an interface for the OTel e2e test suite. @@ -145,8 +147,11 @@ func TestMetrics(s OTelTestSuite, iaParams IAParams) { } } assert.True(s.T(), hasHostResource) + // Verify container tags from infraattributes processor - testInfraTags(s.T(), tags, iaParams) + if iaParams.InfraAttributes { + testInfraTags(s.T(), tags, iaParams) + } } } @@ -155,7 +160,6 @@ func TestLogs(s OTelTestSuite, iaParams IAParams) { err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) - logBody := "random date" var logs []*aggregator.Log s.T().Log("Waiting for logs") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { @@ -174,7 +178,11 @@ func TestLogs(s OTelTestSuite, iaParams IAParams) { require.NotEmpty(s.T(), logs) for _, log := range logs { assert.Contains(s.T(), log.Message, logBody) + attrs := make(map[string]string) + err = json.Unmarshal([]byte(log.Message), &attrs) + assert.NoError(s.T(), err) tags := getTagMapFromSlice(s.T(), log.Tags) + maps.Copy(tags, attrs) assert.Equal(s.T(), calendarService, tags["service"]) assert.Equal(s.T(), env, tags["env"]) assert.Equal(s.T(), version, tags["version"]) @@ -183,8 +191,11 @@ func TestLogs(s OTelTestSuite, iaParams IAParams) { assert.Equal(s.T(), tags["k8s.container.name"], tags["kube_container_name"]) assert.Equal(s.T(), tags["k8s.namespace.name"], tags["kube_namespace"]) assert.Equal(s.T(), tags["k8s.pod.name"], tags["pod_name"]) + // Verify container tags from infraattributes processor - testInfraTags(s.T(), tags, iaParams) + if iaParams.InfraAttributes { + testInfraTags(s.T(), tags, iaParams) + } } } @@ -192,7 +203,6 @@ func TestLogs(s OTelTestSuite, iaParams IAParams) { func TestHosts(s OTelTestSuite) { err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators() require.NoError(s.T(), err) - logBody := "random date" var traces []*aggregator.TracePayload var metrics []*aggregator.MetricSeries @@ -362,6 +372,13 @@ func TestCalendarApp(s OTelTestSuite) { s.T().Log("Starting calendar app") createCalendarApp(ctx, s) + + // Wait for calendar app to start + require.EventuallyWithT(s.T(), func(c *assert.CollectT) { + logs, err := s.Env().FakeIntake.Client().FilterLogs(calendarService, fakeintake.WithMessageContaining(logBody)) + assert.NoError(c, err) + assert.NotEmpty(c, logs) + }, 10*time.Minute, 10*time.Second) } func createCalendarApp(ctx context.Context, s OTelTestSuite) { @@ -436,12 +453,11 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: name, - Image: "datadog/opentelemetry-examples:calendar-go-rest-0.14", + Image: "stanleyliu855/calendar-rest-go:0.16.0", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ Name: "http", ContainerPort: 9090, - Protocol: "TCP", }}, LivenessProbe: &corev1.Probe{ ProbeHandler: corev1.ProbeHandler{ @@ -492,8 +508,9 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { "k8s.pod.uid=$(OTEL_K8S_POD_ID)," + "k8s.container.name=$(OTEL_CONTAINER_NAME)," + "host.name=$(OTEL_K8S_NODE_NAME)," + - fmt.Sprintf("deployment.environment=%v", env) + - fmt.Sprintf("service.version=%v", version), + fmt.Sprintf("deployment.environment=%v,", env) + + fmt.Sprintf("service.version=%v,", version) + + fmt.Sprintf("%v=%v", customAttribute, customAttributeValue), }}, }, }, From a02cc802c9ed48ad9dc4e0395062cc2a505fdbbc Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 15:56:34 -0400 Subject: [PATCH 38/47] Revert testing changes --- comp/core/tagger/taggerimpl/local/tagger.go | 9 --------- comp/core/tagger/taggerimpl/remote/tagger.go | 9 --------- comp/core/tagger/taggerimpl/tagger.go | 11 ----------- .../core/tagger/taggerimpl/tagstore/tagstore.go | 4 ---- .../processor/infraattributesprocessor/logs.go | 2 +- .../infraattributesprocessor/metrics.go | 17 ++--------------- .../infraattributesprocessor/traces.go | 2 +- 7 files changed, 4 insertions(+), 50 deletions(-) diff --git a/comp/core/tagger/taggerimpl/local/tagger.go b/comp/core/tagger/taggerimpl/local/tagger.go index 57b4c854e0a67..5a0d1dbf31afd 100644 --- a/comp/core/tagger/taggerimpl/local/tagger.go +++ b/comp/core/tagger/taggerimpl/local/tagger.go @@ -76,14 +76,12 @@ func (t *Tagger) Stop() error { // getTags returns a read only list of tags for a given entity. func (t *Tagger) getTags(entityID types.EntityID, cardinality types.TagCardinality) (tagset.HashedTags, error) { - fmt.Printf("---- getTags: entityID.String():%v, entityID.GetID():%v, cardinality:%v ----\n", entityID.String(), entityID.GetID(), cardinality) if entityID.GetID() == "" { t.telemetryStore.QueriesByCardinality(cardinality).EmptyEntityID.Inc() return tagset.HashedTags{}, fmt.Errorf("empty entity ID") } cachedTags := t.tagStore.LookupHashed(entityID, cardinality) - fmt.Printf("---- cachedTags.Get():%v ----\n", cachedTags.Get()) t.telemetryStore.QueriesByCardinality(cardinality).Success.Inc() return cachedTags, nil @@ -99,18 +97,11 @@ func (t *Tagger) AccumulateTagsFor(entityID string, cardinality types.TagCardina // Tag returns a copy of the tags for a given entity func (t *Tagger) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { - fmt.Printf("---- Tag: entityID:%v, cardinality:%v ----\n", entityID, cardinality) - list := t.List() - for k, v := range list.Entities { - fmt.Printf("---- Entities: entity:%v, tags:%v ----\n", k, v.Tags) - } id, _ := types.NewEntityIDFromString(entityID) tags, err := t.getTags(id, cardinality) if err != nil { - fmt.Printf("---- err:%v ----\n", err.Error()) return nil, err } - fmt.Printf("---- tags.Copy():%v ----\n", tags.Copy()) return tags.Copy(), nil } diff --git a/comp/core/tagger/taggerimpl/remote/tagger.go b/comp/core/tagger/taggerimpl/remote/tagger.go index a310d9aae6d02..59184d502c674 100644 --- a/comp/core/tagger/taggerimpl/remote/tagger.go +++ b/comp/core/tagger/taggerimpl/remote/tagger.go @@ -198,19 +198,10 @@ func (t *Tagger) GetTaggerTelemetryStore() *telemetry.Store { // Tag returns tags for a given entity at the desired cardinality. func (t *Tagger) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { - fmt.Printf("---- Remote Tag: entityID:%v, cardinality:%v ----\n", entityID, cardinality) - list := t.List() - for k, v := range list.Entities { - fmt.Printf("---- Remote Entities: entity:%v, tags:%v ----\n", k, v.Tags) - } id, _ := types.NewEntityIDFromString(entityID) entity := t.store.getEntity(id) if entity != nil { - fmt.Printf("---- entity.LowCardinalityTags():%v ----\n", entity.LowCardinalityTags) - tgs := entity.GetTags(cardinality) - fmt.Printf("---- entity.GetTags():%v ----\n", tgs) t.telemetryStore.QueriesByCardinality(cardinality).Success.Inc() - return tgs, nil } t.telemetryStore.QueriesByCardinality(cardinality).EmptyTags.Inc() diff --git a/comp/core/tagger/taggerimpl/tagger.go b/comp/core/tagger/taggerimpl/tagger.go index 44d09f28c1695..b26eaed4b804c 100644 --- a/comp/core/tagger/taggerimpl/tagger.go +++ b/comp/core/tagger/taggerimpl/tagger.go @@ -9,7 +9,6 @@ package taggerimpl import ( "context" "encoding/json" - "fmt" "net/http" "reflect" "strconv" @@ -261,13 +260,6 @@ func (t *TaggerClient) GetEntity(entityID string) (*types.Entity, error) { // It can return tags at high cardinality (with tags about individual containers), // or at orchestrator cardinality (pod/task level). func (t *TaggerClient) Tag(entityID string, cardinality types.TagCardinality) ([]string, error) { - if t.defaultTagger != nil { - list := t.defaultTagger.List() - for k, v := range list.Entities { - fmt.Printf("---- default tagger entities: entity:%v, tags:%v ----\n", k, v.Tags) - } - } - // TODO: defer unlock once performance overhead of defer is negligible t.mux.RLock() if t.captureTagger != nil { @@ -344,9 +336,6 @@ func (t *TaggerClient) AgentTags(cardinality types.TagCardinality) ([]string, er // GlobalTags queries global tags that should apply to all data coming from the // agent. func (t *TaggerClient) GlobalTags(cardinality types.TagCardinality) ([]string, error) { - if taggercommon.GetGlobalEntityID() != nil { - fmt.Printf("---- taggercommon.GetGlobalEntityID().String():%v ----\n", taggercommon.GetGlobalEntityID().String()) - } t.mux.RLock() if t.captureTagger != nil { tags, err := t.captureTagger.Tag(taggercommon.GetGlobalEntityID().String(), cardinality) diff --git a/comp/core/tagger/taggerimpl/tagstore/tagstore.go b/comp/core/tagger/taggerimpl/tagstore/tagstore.go index 731b6d74a3d6b..020128c06b2df 100644 --- a/comp/core/tagger/taggerimpl/tagstore/tagstore.go +++ b/comp/core/tagger/taggerimpl/tagstore/tagstore.go @@ -10,7 +10,6 @@ package tagstore import ( "context" "errors" - "fmt" "reflect" "sync" "time" @@ -253,9 +252,6 @@ func (s *TagStore) LookupHashed(entityID types.EntityID, cardinality types.TagCa s.RLock() defer s.RUnlock() storedTags, present := s.store.Get(entityID) - if storedTags != nil { - fmt.Printf("---- storedTags.tagsBySource():%v, present:%v ----\n", storedTags.tagsBySource(), present) - } if !present { return tagset.HashedTags{} diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go index 925c94fb4af99..8d63b39c3754b 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/logs.go @@ -43,7 +43,7 @@ func (ialp *infraAttributesLogProcessor) processLogs(_ context.Context, ld plog. // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { - entityTags, err := ialp.tagger.Tag(entityID.String(), types.HighCardinality) + entityTags, err := ialp.tagger.Tag(entityID.String(), ialp.cardinality) if err != nil { ialp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) continue diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go index a5f196b916ab0..e7a8cb3d7a700 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/metrics.go @@ -93,50 +93,37 @@ func (iamp *infraAttributesMetricProcessor) processMetrics(_ context.Context, md for i := 0; i < rms.Len(); i++ { resourceAttributes := rms.At(i).Resource().Attributes() entityIDs := entityIDsFromAttributes(resourceAttributes, iamp.generateID) - for i2, e := range entityIDs { - md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_id.%v", i2), e.String()) - fmt.Printf("entity_id.%v:%v\n", i2, e.String()) - } tagMap := make(map[string]string) // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { entityTags, err := iamp.tagger.Tag(entityID.String(), iamp.cardinality) if err != nil { - md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_error.%v", entityID.String()), err.Error()) iamp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) - fmt.Printf("entity_error.%v:%v\n", entityID.String(), err.Error()) continue } - - for i2, tag := range entityTags { + for _, tag := range entityTags { k, v := splitTag(tag) _, hasTag := tagMap[k] if k != "" && v != "" && !hasTag { tagMap[k] = v } - md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("entity_tag.%v", i2), tag) - fmt.Printf("entity_tag.%v:%v\n", i2, tag) } } globalTags, err := iamp.tagger.GlobalTags(iamp.cardinality) if err != nil { iamp.logger.Error("Cannot get global tags", zap.Error(err)) } - for i2, tag := range globalTags { + for _, tag := range globalTags { k, v := splitTag(tag) _, hasTag := tagMap[k] if k != "" && v != "" && !hasTag { tagMap[k] = v } - md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("global_tag.%v", i2), tag) - fmt.Printf("global_tag.%v:%v\n", i2, tag) } // Add all tags as resource attributes for k, v := range tagMap { - md.ResourceMetrics().At(i).Resource().Attributes().PutStr(fmt.Sprintf("tag_map.%v", k), v) - fmt.Printf("tag_map.%v:%v\n", k, v) resourceAttributes.PutStr(k, v) } } diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go b/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go index 6975650649e4a..ce6fe02674e95 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/traces.go @@ -42,7 +42,7 @@ func (iasp *infraAttributesSpanProcessor) processTraces(_ context.Context, td pt // Get all unique tags from resource attributes and global tags for _, entityID := range entityIDs { - entityTags, err := iasp.tagger.Tag(entityID.String(), types.HighCardinality) + entityTags, err := iasp.tagger.Tag(entityID.String(), iasp.cardinality) if err != nil { iasp.logger.Error("Cannot get tags for entity", zap.String("entityID", entityID.String()), zap.Error(err)) continue From 1e7c20c0d750391d42bb8770c2c38ce6dba15e87 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 2 Oct 2024 15:58:01 -0400 Subject: [PATCH 39/47] Fix change --- comp/core/tagger/taggerimpl/remote/tagger.go | 1 + 1 file changed, 1 insertion(+) diff --git a/comp/core/tagger/taggerimpl/remote/tagger.go b/comp/core/tagger/taggerimpl/remote/tagger.go index 59184d502c674..e0a7d7ec01f17 100644 --- a/comp/core/tagger/taggerimpl/remote/tagger.go +++ b/comp/core/tagger/taggerimpl/remote/tagger.go @@ -202,6 +202,7 @@ func (t *Tagger) Tag(entityID string, cardinality types.TagCardinality) ([]strin entity := t.store.getEntity(id) if entity != nil { t.telemetryStore.QueriesByCardinality(cardinality).Success.Inc() + return entity.GetTags(cardinality), nil } t.telemetryStore.QueriesByCardinality(cardinality).EmptyTags.Inc() From 03638617d53cc8d0cdf74b831b6602bf2b42c655 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 00:22:27 -0400 Subject: [PATCH 40/47] Fix tests --- test/new-e2e/go.sum | 4 ++-- test/new-e2e/tests/otel/otel-agent/complete_test.go | 4 ---- test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go | 4 ---- test/new-e2e/tests/otel/utils/pipelines_utils.go | 10 ++++++---- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index b00088a0ae164..907f7a0d792a0 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -16,8 +16,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a h1:m9REhmyaWD5YJ0P53ygRHxKKo+KM+nw+zz0hEdKztMo= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/DataDog/test-infra-definitions v0.0.0-20240930155632-85c56b464e81 h1:fDYHxfWiqapW3ukrOpxz21hv+qg9Ko7QBFG39ufudi0= -github.com/DataDog/test-infra-definitions v0.0.0-20240930155632-85c56b464e81/go.mod h1:nbSZa2alOY/vhOJRJNhMAbXNLARLT83ozjoP+s1hyRE= +github.com/DataDog/test-infra-definitions v0.0.0-20241002105811-0e2d625838fc h1:PtRMzcoFwEcxSAvqguHKiLDQshWfKwtFiKYYE3Z5Hsw= +github.com/DataDog/test-infra-definitions v0.0.0-20241002105811-0e2d625838fc/go.mod h1:nbSZa2alOY/vhOJRJNhMAbXNLARLT83ozjoP+s1hyRE= github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= diff --git a/test/new-e2e/tests/otel/otel-agent/complete_test.go b/test/new-e2e/tests/otel/otel-agent/complete_test.go index 8da68f2132b28..9065dd0a095f4 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -70,7 +70,3 @@ func (s *completeTestSuite) TestPrometheusMetrics() { func (s *completeTestSuite) TestOTelAgentInstalled() { utils.TestOTelAgentInstalled(s) } - -func (s *completeTestSuite) TestOTelFlare() { - utils.TestOTelFlare(s) -} diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index 2c764e35e5113..7c1ecc02e3e7a 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -63,7 +63,3 @@ func (s *otlpIngestTestSuite) TestOTLPMetrics() { func (s *otlpIngestTestSuite) TestOTLPLogs() { utils.TestLogs(s, otlpIngestParams) } - -func (s *otlpIngestTestSuite) TestHosts() { - utils.TestHosts(s) -} diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index af5c445312831..1974c9ed99214 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -177,12 +177,14 @@ func TestLogs(s OTelTestSuite, iaParams IAParams) { require.NotEmpty(s.T(), logs) for _, log := range logs { - assert.Contains(s.T(), log.Message, logBody) - attrs := make(map[string]string) + tags := getTagMapFromSlice(s.T(), log.Tags) + attrs := make(map[string]interface{}) err = json.Unmarshal([]byte(log.Message), &attrs) assert.NoError(s.T(), err) - tags := getTagMapFromSlice(s.T(), log.Tags) - maps.Copy(tags, attrs) + for k, v := range attrs { + tags[k] = fmt.Sprint(v) + } + assert.Contains(s.T(), log.Message, logBody) assert.Equal(s.T(), calendarService, tags["service"]) assert.Equal(s.T(), env, tags["env"]) assert.Equal(s.T(), version, tags["version"]) From 2e9dd0c36ff65eea02368a88a63c7e98efcc3f79 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 00:23:47 -0400 Subject: [PATCH 41/47] Increase timeout --- test/new-e2e/tests/otel/utils/pipelines_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 1974c9ed99214..0c4391d58c476 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -380,7 +380,7 @@ func TestCalendarApp(s OTelTestSuite) { logs, err := s.Env().FakeIntake.Client().FilterLogs(calendarService, fakeintake.WithMessageContaining(logBody)) assert.NoError(c, err) assert.NotEmpty(c, logs) - }, 10*time.Minute, 10*time.Second) + }, 120*time.Minute, 10*time.Second) } func createCalendarApp(ctx context.Context, s OTelTestSuite) { From 3935bb1445f5b4c3bc94872c92130e0b2d24f3bb Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 10:18:24 -0400 Subject: [PATCH 42/47] Clean up tests --- test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go | 3 +++ test/new-e2e/tests/otel/utils/pipelines_utils.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go index 7c1ecc02e3e7a..ff3621d2a31da 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -32,6 +32,9 @@ datadog: enabled: true logs: enabled: true + logs: + containerCollectAll: false + containerCollectUsingFiles: false agents: containers: agent: diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 0c4391d58c476..ca63661f2de33 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -380,7 +380,7 @@ func TestCalendarApp(s OTelTestSuite) { logs, err := s.Env().FakeIntake.Client().FilterLogs(calendarService, fakeintake.WithMessageContaining(logBody)) assert.NoError(c, err) assert.NotEmpty(c, logs) - }, 120*time.Minute, 10*time.Second) + }, 60*time.Minute, 10*time.Second) } func createCalendarApp(ctx context.Context, s OTelTestSuite) { @@ -455,7 +455,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: name, - Image: "stanleyliu855/calendar-rest-go:0.16.0", + Image: "datadog/opentelemetry-examples:calendar-go-rest-0.15", ImagePullPolicy: "IfNotPresent", Ports: []corev1.ContainerPort{{ Name: "http", From bb6284153308fbfc31095e96f55cfc3ad9055e49 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 12:08:40 -0400 Subject: [PATCH 43/47] Address feedback --- .../tests/otel/utils/pipelines_utils.go | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index ca63661f2de33..c28fd59636ad7 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -67,13 +67,23 @@ func TestTraces(s OTelTestSuite, iaParams IAParams) { s.T().Log("Waiting for traces") require.EventuallyWithT(s.T(), func(c *assert.CollectT) { traces, err = s.Env().FakeIntake.Client().GetTraces() - assert.NoError(c, err) - assert.NotEmpty(c, traces) + if !assert.NoError(c, err) { + return + } + if !assert.NotEmpty(c, traces) { + return + } trace := traces[0] - assert.NotEmpty(s.T(), trace.TracerPayloads) + if !assert.NotEmpty(s.T(), trace.TracerPayloads) { + return + } tp := trace.TracerPayloads[0] - assert.NotEmpty(s.T(), tp.Chunks) - assert.NotEmpty(s.T(), tp.Chunks[0].Spans) + if !assert.NotEmpty(s.T(), tp.Chunks) { + return + } + if !assert.NotEmpty(s.T(), tp.Chunks[0].Spans) { + return + } assert.Equal(s.T(), calendarService, tp.Chunks[0].Spans[0].Service) if iaParams.InfraAttributes { ctags, ok := getContainerTags(s.T(), tp) From 268135d375db3de04abfe956b48219f34589cf84 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 13:18:06 -0400 Subject: [PATCH 44/47] Address feedback --- test/new-e2e/tests/otel/utils/pipelines_utils.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index c28fd59636ad7..4592f71c174e3 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -568,22 +568,16 @@ func getContainerTags(t *testing.T, tp *trace.TracerPayload) (map[string]string, return nil, false } splits := strings.Split(ctags, ",") - m := make(map[string]string) - for _, s := range splits { - kv := strings.SplitN(s, ":", 2) - if !assert.Len(t, kv, 2, "malformed container tag: %v", s) { - continue - } - m[kv[0]] = kv[1] - } - return m, true + return getTagMapFromSlice(t, splits), true } func getTagMapFromSlice(t *testing.T, tagSlice []string) map[string]string { m := make(map[string]string) for _, s := range tagSlice { kv := strings.SplitN(s, ":", 2) - require.Len(t, kv, 2, "malformed tag: %v", s) + if !assert.Len(t, kv, 2, "malformed tag: %v", s) { + continue + } m[kv[0]] = kv[1] } return m From 93424653da36f93ed2e60ebf01c48182c2dd4d44 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 16:07:40 -0400 Subject: [PATCH 45/47] inv tidy --- test/new-e2e/go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index 907f7a0d792a0..2c9cf131dd6ba 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -16,8 +16,8 @@ github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a h1:m9REhmyaWD5YJ0P53ygRHxKKo+KM+nw+zz0hEdKztMo= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/DataDog/test-infra-definitions v0.0.0-20241002105811-0e2d625838fc h1:PtRMzcoFwEcxSAvqguHKiLDQshWfKwtFiKYYE3Z5Hsw= -github.com/DataDog/test-infra-definitions v0.0.0-20241002105811-0e2d625838fc/go.mod h1:nbSZa2alOY/vhOJRJNhMAbXNLARLT83ozjoP+s1hyRE= +github.com/DataDog/test-infra-definitions v0.0.0-20241003134706-f3aa4172342a h1:pIBGr3y+uiBo8bgjhNAWLh3yQrHl684drANOfyRle0Q= +github.com/DataDog/test-infra-definitions v0.0.0-20241003134706-f3aa4172342a/go.mod h1:nbSZa2alOY/vhOJRJNhMAbXNLARLT83ozjoP+s1hyRE= github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= From 04656d3d47a078700962a0181a4a04d212280fd7 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Thu, 3 Oct 2024 16:09:39 -0400 Subject: [PATCH 46/47] Update version --- test/new-e2e/tests/otel/utils/pipelines_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/new-e2e/tests/otel/utils/pipelines_utils.go b/test/new-e2e/tests/otel/utils/pipelines_utils.go index 4592f71c174e3..9365d487b3e36 100644 --- a/test/new-e2e/tests/otel/utils/pipelines_utils.go +++ b/test/new-e2e/tests/otel/utils/pipelines_utils.go @@ -405,7 +405,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { "helm.sh/chart": "calendar-rest-go-0.1.0", "app.kubernetes.io/name": name, "app.kubernetes.io/instance": name, - "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/version": "0.15", "app.kubernetes.io/managed-by": "Helm", }, Annotations: map[string]string{ @@ -437,7 +437,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { "helm.sh/chart": "calendar-rest-go-0.1.0", "app.kubernetes.io/name": name, "app.kubernetes.io/instance": name, - "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/version": "0.15", "app.kubernetes.io/managed-by": "Helm", }, Annotations: map[string]string{ @@ -458,7 +458,7 @@ func createCalendarApp(ctx context.Context, s OTelTestSuite) { "helm.sh/chart": "calendar-rest-go-0.1.0", "app.kubernetes.io/name": name, "app.kubernetes.io/instance": name, - "app.kubernetes.io/version": "1.16.0", + "app.kubernetes.io/version": "0.15", "app.kubernetes.io/managed-by": "Helm", }, }, From d183c150e4b3ddf0b89366f89fe3bf3177bd3fe3 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Fri, 4 Oct 2024 12:40:35 -0400 Subject: [PATCH 47/47] Mark as flaky --- test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go index 036b48d368909..a94e4ad83de88 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_eks_test.go @@ -13,6 +13,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" "github.com/DataDog/datadog-agent/comp/core/tagger/types" + "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" @@ -24,6 +25,7 @@ type iaEKSTestSuite struct { } func TestOTelAgentIAEKS(t *testing.T) { + flake.Mark(t) values := ` datadog: logs: