From 7acfadf5fa6a1941c0d7213673a009d7c437e7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Fri, 22 Sep 2023 12:44:44 +0200 Subject: [PATCH] feat!: use OTLP sources by default --- deploy/helm/sumologic/values.yaml | 10 +- tests/helm/logs_test.go | 5 +- tests/helm/metrics_test.go | 55 ++++++++- .../goldenfile/events_otc/basic.output.yaml | 4 +- .../goldenfile/events_otc/options.output.yaml | 4 +- .../events_otc_statefulset/basic.output.yaml | 5 + .../events_otc_statefulset/custom.input.yaml | 2 +- .../events_otc_statefulset/custom.output.yaml | 5 - .../events_otc_statefulset/proxy.output.yaml | 5 + .../metadata_logs_otc/otel.output.yaml | 25 ++-- .../metadata_logs_otc/templates.output.yaml | 25 ++-- .../basic.output.yaml | 5 + .../custom.input.yaml | 2 +- .../custom.output.yaml | 5 - .../additional_endpoints.output.yaml | 111 +----------------- .../metadata_metrics_otc/basic.output.yaml | 111 +----------------- .../metadata_metrics_otc/custom.input.yaml | 2 +- .../metadata_metrics_otc/custom.output.yaml | 111 +++++++++++++++++- .../filtered_app_metrics.output.yaml | 111 +----------------- .../basic.output.yaml | 5 + .../custom.input.yaml | 2 +- .../custom.output.yaml | 5 - .../basic.output.yaml | 5 + .../custom.input.yaml | 2 +- .../custom.output.yaml | 5 - .../basic.output.yaml | 5 + .../custom.input.yaml | 2 +- .../custom.output.yaml | 5 - .../traces-sampler/simple.output.yaml | 2 +- ..._otlp_test.go => helm_http_source_test.go} | 2 +- tests/integration/values/values_common.yaml | 5 - .../values/values_helm_http_source.yaml | 15 +++ .../integration/values/values_helm_otlp.yaml | 15 --- 33 files changed, 246 insertions(+), 432 deletions(-) rename tests/integration/{helm_otlp_test.go => helm_http_source_test.go} (96%) create mode 100644 tests/integration/values/values_helm_http_source.yaml delete mode 100644 tests/integration/values/values_helm_otlp.yaml diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index a4ee639c53..8944c4d63b 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -272,7 +272,7 @@ sumologic: pvcLabels: {} # storageClass: - sourceType: http + sourceType: otlp ### Logs configuration ## Set the enabled flag to false for disabling logs ingestion altogether. @@ -435,7 +435,7 @@ sumologic: ## https://help.sumologic.com/docs/manage/fields/#manage-fields additionalFields: [] - sourceType: http + sourceType: otlp ### Metrics configuration ## Set the enabled flag to false for disabling metrics ingestion altogether. @@ -666,7 +666,7 @@ sumologic: ## The type of source we send to in Sumo. The possible values are http and otlp. ## Consult the documentation for more information. - sourceType: http + sourceType: otlp ### Traces configuration ## Set the enabled flag to false to disable traces ingestion. @@ -675,7 +675,7 @@ sumologic: ## How many spans per request should be send to receiver spans_per_request: 100 - sourceType: http + sourceType: otlp ## Configure metrics-server ## ref: https://github.com/bitnami/charts/blob/master/bitnami/metrics-server/values.yaml @@ -1583,7 +1583,7 @@ tracesSampler: # logging: # loglevel: debug otlphttp: - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE} + traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces compression: gzip service: extensions: [health_check, memory_ballast, pprof] diff --git a/tests/helm/logs_test.go b/tests/helm/logs_test.go index 14ccbff280..45c0bc1985 100644 --- a/tests/helm/logs_test.go +++ b/tests/helm/logs_test.go @@ -78,7 +78,7 @@ sumologic: err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig) require.NoError(t, err) - require.ElementsMatch(t, []string{"sumologic/containers"}, keys(otelConfig.Exporters)) + require.ElementsMatch(t, []string{"sumologic"}, keys(otelConfig.Exporters)) require.ElementsMatch(t, []string{"logs/otlp/containers"}, keys(otelConfig.Service.Pipelines)) for processorName := range otelConfig.Processors { require.NotContains(t, processorName, "systemd") @@ -126,7 +126,7 @@ sumologic: require.Contains(t, containersPipeline.Processors, "filter/include-host") } -func TestMetadataLogFormat(t *testing.T) { +func TestMetadataLogFormatHTTP(t *testing.T) { t.Parallel() templatePath := "templates/logs/otelcol/configmap.yaml" @@ -174,6 +174,7 @@ sumologic: logs: container: format: %s + sourceType: http ` valuesYaml := fmt.Sprintf(valuesYamlTemplate, testCase.logFormat) otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath) diff --git a/tests/helm/metrics_test.go b/tests/helm/metrics_test.go index e04869558f..2f6d6f8c86 100644 --- a/tests/helm/metrics_test.go +++ b/tests/helm/metrics_test.go @@ -137,7 +137,6 @@ func TestMetadataMetricsOtelConfigExtraProcessors(t *testing.T) { "transform/remove_name", "filter/drop_unnecessary_metrics", "batch", - "routing", } require.Equal(t, expectedPipelineValue, otelConfig.Service.Pipelines.Metrics.Processors) @@ -180,12 +179,62 @@ sumologic: assert.Equal(t, otelConfig.Exporters.Default.Endpoint, "${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE}") assert.Len(t, otelConfig.Exporters.Rest, 0) assert.NotContains(t, otelConfig.Processors, "routing") - assert.NotContains(t, otelConfig.Processors, "transform/prepare_routing") assert.NotContains(t, otelConfig.Service.Pipelines.Metrics.Processors, "routing") - assert.NotContains(t, otelConfig.Service.Pipelines.Metrics.Processors, "transform/prepare_routing") assert.Equal(t, otelConfig.Service.Pipelines.Metrics.Exporters, []string{"sumologic/default"}) } +func TestMetadataSourceTypeHTTP(t *testing.T) { + t.Parallel() + templatePath := "templates/metrics/otelcol/configmap.yaml" + + type OtelConfig struct { + Exporters map[string]struct { + MetricFormat string `yaml:"metric_format"` + Endpoint string + } `yaml:"exporters"` + Processors map[string]interface{} + Service struct { + Pipelines struct { + Metrics struct { + Processors []string `yaml:"processors"` + Exporters []string `yaml:"exporters"` + } + } + } + } + + var otelConfig OtelConfig + valuesYaml := ` +sumologic: + metrics: + sourceType: http +` + otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath) + err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig) + require.NoError(t, err) + + require.Contains(t, otelConfig.Exporters, "sumologic/default") + defaultExporter := otelConfig.Exporters["sumologic/default"] + assert.Equal(t, "prometheus", defaultExporter.MetricFormat) + assert.Equal(t, "${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE}", defaultExporter.Endpoint) + assert.Contains(t, otelConfig.Processors, "routing") + assert.Contains(t, otelConfig.Service.Pipelines.Metrics.Processors, "routing") + assert.Equal( + t, + []string{ + "sumologic/default", + "sumologic/apiserver", + "sumologic/control_plane", + "sumologic/controller", + "sumologic/kubelet", + "sumologic/node", + "sumologic/scheduler", + "sumologic/state", + }, + otelConfig.Service.Pipelines.Metrics.Exporters, + ) +} + func TestNoPrometheusServiceMonitors(t *testing.T) { t.Parallel() allTemplatePaths := []string{ diff --git a/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml b/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml index f6bd9bec33..85c706b3dd 100644 --- a/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc/basic.output.yaml @@ -15,8 +15,8 @@ data: exporters: sumologic: clear_logs_timestamp: false - endpoint: ${SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE} - log_format: json + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_EVENTS_SOURCE} + log_format: otlp sending_queue: enabled: true storage: file_storage diff --git a/tests/helm/testdata/goldenfile/events_otc/options.output.yaml b/tests/helm/testdata/goldenfile/events_otc/options.output.yaml index e1e17ac6bc..05ddec2cf4 100644 --- a/tests/helm/testdata/goldenfile/events_otc/options.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc/options.output.yaml @@ -15,8 +15,8 @@ data: exporters: sumologic: clear_logs_timestamp: false - endpoint: ${SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE} - log_format: json + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_EVENTS_SOURCE} + log_format: otlp sending_queue: enabled: true extensions: diff --git a/tests/helm/testdata/goldenfile/events_otc_statefulset/basic.output.yaml b/tests/helm/testdata/goldenfile/events_otc_statefulset/basic.output.yaml index 0853117a9a..266e79163d 100644 --- a/tests/helm/testdata/goldenfile/events_otc_statefulset/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc_statefulset/basic.output.yaml @@ -126,6 +126,11 @@ spec: secretKeyRef: name: sumologic key: endpoint-events + - name: SUMO_ENDPOINT_DEFAULT_OTLP_EVENTS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-events-otlp - name: NO_PROXY value: kubernetes.default.svc diff --git a/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.input.yaml b/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.input.yaml index d57b6132d4..80042a5666 100644 --- a/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.input.yaml @@ -1,6 +1,6 @@ sumologic: events: - sourceType: otlp + sourceType: http podAnnotations: sumoAnnotation: sumoValue podLabels: diff --git a/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.output.yaml b/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.output.yaml index cf961cf327..c6ee838739 100644 --- a/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.output.yaml @@ -114,11 +114,6 @@ spec: secretKeyRef: name: sumologic key: endpoint-events - - name: SUMO_ENDPOINT_DEFAULT_OTLP_EVENTS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-events-otlp - name: NO_PROXY value: kubernetes.default.svc diff --git a/tests/helm/testdata/goldenfile/events_otc_statefulset/proxy.output.yaml b/tests/helm/testdata/goldenfile/events_otc_statefulset/proxy.output.yaml index 136d5815fc..0251a066f4 100644 --- a/tests/helm/testdata/goldenfile/events_otc_statefulset/proxy.output.yaml +++ b/tests/helm/testdata/goldenfile/events_otc_statefulset/proxy.output.yaml @@ -110,6 +110,11 @@ spec: secretKeyRef: name: sumologic key: endpoint-events + - name: SUMO_ENDPOINT_DEFAULT_OTLP_EVENTS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-events-otlp - name: HTTP_PROXY value: http://proxy.internal diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc/otel.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc/otel.output.yaml index 6723fe8893..728078af22 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc/otel.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc/otel.output.yaml @@ -13,21 +13,10 @@ metadata: data: config.yaml: | exporters: - sumologic/containers: - endpoint: ${SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE} - json_logs: - add_timestamp: false - log_format: json - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - sumologic/systemd: - endpoint: ${SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE} - json_logs: - add_timestamp: false - log_format: json + sumologic: + clear_logs_timestamp: false + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_LOGS_SOURCE} + log_format: otlp sending_queue: enabled: true num_consumers: 10 @@ -291,7 +280,7 @@ data: pipelines: logs/otlp/containers: exporters: - - sumologic/containers + - sumologic processors: - memory_limiter - filter/include_containers @@ -311,7 +300,7 @@ data: - otlp logs/otlp/kubelet: exporters: - - sumologic/systemd + - sumologic processors: - memory_limiter - filter/include_fluent_tag_host @@ -333,7 +322,7 @@ data: - otlp logs/otlp/systemd: exporters: - - sumologic/systemd + - sumologic processors: - memory_limiter - filter/include_fluent_tag_host diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc/templates.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc/templates.output.yaml index 362ce2ceb5..f734263d18 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc/templates.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc/templates.output.yaml @@ -13,21 +13,10 @@ metadata: data: config.yaml: | exporters: - sumologic/containers: - endpoint: ${SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE} - json_logs: - add_timestamp: false - log_format: json - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - sumologic/systemd: - endpoint: ${SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE} - json_logs: - add_timestamp: false - log_format: json + sumologic: + clear_logs_timestamp: false + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_LOGS_SOURCE} + log_format: otlp sending_queue: enabled: true num_consumers: 10 @@ -318,7 +307,7 @@ data: pipelines: logs/otlp/containers: exporters: - - sumologic/containers + - sumologic processors: - memory_limiter - filter/include_containers @@ -340,7 +329,7 @@ data: - otlp logs/otlp/kubelet: exporters: - - sumologic/systemd + - sumologic processors: - memory_limiter - filter/include_fluent_tag_host @@ -364,7 +353,7 @@ data: - otlp logs/otlp/systemd: exporters: - - sumologic/systemd + - sumologic processors: - memory_limiter - filter/include_fluent_tag_host diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml index db62bc9544..e97ddadcb2 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.output.yaml @@ -98,6 +98,11 @@ spec: secretKeyRef: name: sumologic key: endpoint-logs + - name: SUMO_ENDPOINT_DEFAULT_OTLP_LOGS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-logs-otlp - name: NO_PROXY value: kubernetes.default.svc diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.input.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.input.yaml index edf15f18e0..edd96a1538 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.input.yaml @@ -1,6 +1,6 @@ sumologic: logs: - sourceType: otlp + sourceType: http metadata: image: diff --git a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml index c36ccdfb66..097d50217e 100644 --- a/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/custom.output.yaml @@ -122,11 +122,6 @@ spec: secretKeyRef: name: sumologic key: endpoint-logs - - name: SUMO_ENDPOINT_DEFAULT_OTLP_LOGS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-logs-otlp - name: NO_PROXY value: kubernetes.default.svc diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml index 3b4509a825..5e3055ddc6 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.output.yaml @@ -13,81 +13,11 @@ metadata: data: config.yaml: | exporters: - sumologic/apiserver: - endpoint: ${SUMO_ENDPOINT_APISERVER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/control_plane: - endpoint: ${SUMO_ENDPOINT_CONTROL_PLANE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/controller: - endpoint: ${SUMO_ENDPOINT_CONTROLLER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s sumologic/default: decompose_otlp_histograms: true - endpoint: ${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/kubelet: - endpoint: ${SUMO_ENDPOINT_KUBELET_METRICS_SOURCE} + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE} max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/node: - endpoint: ${SUMO_ENDPOINT_NODE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/scheduler: - endpoint: ${SUMO_ENDPOINT_SCHEDULER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/state: - endpoint: ${SUMO_ENDPOINT_STATE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus + metric_format: otlp sending_queue: enabled: true num_consumers: 10 @@ -201,35 +131,6 @@ data: attributes: - action: delete key: k8s.pod.pod_name - routing: - default_exporters: - - sumologic/default - error_mode: ignore - table: - - exporters: - - sumologic/apiserver - statement: route() where resource.attributes["job"] == "apiserver" - - exporters: - - sumologic/control_plane - statement: route() where resource.attributes["job"] == "coredns" - - exporters: - - sumologic/control_plane - statement: route() where resource.attributes["job"] == "kube-etcd" - - exporters: - - sumologic/controller - statement: route() where resource.attributes["job"] == "kube-controller-manager" - - exporters: - - sumologic/kubelet - statement: route() where resource.attributes["job"] == "kubelet" - - exporters: - - sumologic/node - statement: route() where resource.attributes["job"] == "node-exporter" - - exporters: - - sumologic/scheduler - statement: route() where resource.attributes["job"] == "kube-scheduler" - - exporters: - - sumologic/state - statement: route() where resource.attributes["job"] == "kube-state-metrics" source: collector: kubernetes exclude: @@ -279,13 +180,6 @@ data: metrics: exporters: - sumologic/default - - sumologic/apiserver - - sumologic/control_plane - - sumologic/controller - - sumologic/kubelet - - sumologic/node - - sumologic/scheduler - - sumologic/state processors: - memory_limiter - metricstransform @@ -301,7 +195,6 @@ data: - transform/remove_name - filter/drop_unnecessary_metrics - batch - - routing receivers: - telegraf - otlp diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml index ef38dc4eb4..85df3500e1 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.output.yaml @@ -13,81 +13,11 @@ metadata: data: config.yaml: | exporters: - sumologic/apiserver: - endpoint: ${SUMO_ENDPOINT_APISERVER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/control_plane: - endpoint: ${SUMO_ENDPOINT_CONTROL_PLANE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/controller: - endpoint: ${SUMO_ENDPOINT_CONTROLLER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s sumologic/default: decompose_otlp_histograms: true - endpoint: ${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/kubelet: - endpoint: ${SUMO_ENDPOINT_KUBELET_METRICS_SOURCE} + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE} max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/node: - endpoint: ${SUMO_ENDPOINT_NODE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/scheduler: - endpoint: ${SUMO_ENDPOINT_SCHEDULER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/state: - endpoint: ${SUMO_ENDPOINT_STATE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus + metric_format: otlp sending_queue: enabled: true num_consumers: 10 @@ -201,35 +131,6 @@ data: attributes: - action: delete key: k8s.pod.pod_name - routing: - default_exporters: - - sumologic/default - error_mode: ignore - table: - - exporters: - - sumologic/apiserver - statement: route() where resource.attributes["job"] == "apiserver" - - exporters: - - sumologic/control_plane - statement: route() where resource.attributes["job"] == "coredns" - - exporters: - - sumologic/control_plane - statement: route() where resource.attributes["job"] == "kube-etcd" - - exporters: - - sumologic/controller - statement: route() where resource.attributes["job"] == "kube-controller-manager" - - exporters: - - sumologic/kubelet - statement: route() where resource.attributes["job"] == "kubelet" - - exporters: - - sumologic/node - statement: route() where resource.attributes["job"] == "node-exporter" - - exporters: - - sumologic/scheduler - statement: route() where resource.attributes["job"] == "kube-scheduler" - - exporters: - - sumologic/state - statement: route() where resource.attributes["job"] == "kube-state-metrics" source: collector: kubernetes exclude: @@ -277,13 +178,6 @@ data: metrics: exporters: - sumologic/default - - sumologic/apiserver - - sumologic/control_plane - - sumologic/controller - - sumologic/kubelet - - sumologic/node - - sumologic/scheduler - - sumologic/state processors: - memory_limiter - metricstransform @@ -299,7 +193,6 @@ data: - transform/remove_name - filter/drop_unnecessary_metrics - batch - - routing receivers: - telegraf - otlp diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml index 19eb873f99..750aba7002 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml @@ -1,3 +1,3 @@ sumologic: metrics: - sourceType: otlp + sourceType: http diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml index 85df3500e1..ef38dc4eb4 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml @@ -13,11 +13,81 @@ metadata: data: config.yaml: | exporters: + sumologic/apiserver: + endpoint: ${SUMO_ENDPOINT_APISERVER_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + sumologic/control_plane: + endpoint: ${SUMO_ENDPOINT_CONTROL_PLANE_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + sumologic/controller: + endpoint: ${SUMO_ENDPOINT_CONTROLLER_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s sumologic/default: decompose_otlp_histograms: true - endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE} + endpoint: ${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + sumologic/kubelet: + endpoint: ${SUMO_ENDPOINT_KUBELET_METRICS_SOURCE} max_request_body_size: 16777216 - metric_format: otlp + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + sumologic/node: + endpoint: ${SUMO_ENDPOINT_NODE_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + sumologic/scheduler: + endpoint: ${SUMO_ENDPOINT_SCHEDULER_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + sumologic/state: + endpoint: ${SUMO_ENDPOINT_STATE_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: prometheus sending_queue: enabled: true num_consumers: 10 @@ -131,6 +201,35 @@ data: attributes: - action: delete key: k8s.pod.pod_name + routing: + default_exporters: + - sumologic/default + error_mode: ignore + table: + - exporters: + - sumologic/apiserver + statement: route() where resource.attributes["job"] == "apiserver" + - exporters: + - sumologic/control_plane + statement: route() where resource.attributes["job"] == "coredns" + - exporters: + - sumologic/control_plane + statement: route() where resource.attributes["job"] == "kube-etcd" + - exporters: + - sumologic/controller + statement: route() where resource.attributes["job"] == "kube-controller-manager" + - exporters: + - sumologic/kubelet + statement: route() where resource.attributes["job"] == "kubelet" + - exporters: + - sumologic/node + statement: route() where resource.attributes["job"] == "node-exporter" + - exporters: + - sumologic/scheduler + statement: route() where resource.attributes["job"] == "kube-scheduler" + - exporters: + - sumologic/state + statement: route() where resource.attributes["job"] == "kube-state-metrics" source: collector: kubernetes exclude: @@ -178,6 +277,13 @@ data: metrics: exporters: - sumologic/default + - sumologic/apiserver + - sumologic/control_plane + - sumologic/controller + - sumologic/kubelet + - sumologic/node + - sumologic/scheduler + - sumologic/state processors: - memory_limiter - metricstransform @@ -193,6 +299,7 @@ data: - transform/remove_name - filter/drop_unnecessary_metrics - batch + - routing receivers: - telegraf - otlp diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml index e35fd881f0..9223239438 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.output.yaml @@ -13,81 +13,11 @@ metadata: data: config.yaml: | exporters: - sumologic/apiserver: - endpoint: ${SUMO_ENDPOINT_APISERVER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/control_plane: - endpoint: ${SUMO_ENDPOINT_CONTROL_PLANE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/controller: - endpoint: ${SUMO_ENDPOINT_CONTROLLER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s sumologic/default: decompose_otlp_histograms: true - endpoint: ${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/kubelet: - endpoint: ${SUMO_ENDPOINT_KUBELET_METRICS_SOURCE} + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE} max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/node: - endpoint: ${SUMO_ENDPOINT_NODE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/scheduler: - endpoint: ${SUMO_ENDPOINT_SCHEDULER_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus - sending_queue: - enabled: true - num_consumers: 10 - queue_size: 10000 - storage: file_storage - timeout: 30s - sumologic/state: - endpoint: ${SUMO_ENDPOINT_STATE_METRICS_SOURCE} - max_request_body_size: 16777216 - metric_format: prometheus + metric_format: otlp sending_queue: enabled: true num_consumers: 10 @@ -225,35 +155,6 @@ data: attributes: - action: delete key: k8s.pod.pod_name - routing: - default_exporters: - - sumologic/default - error_mode: ignore - table: - - exporters: - - sumologic/apiserver - statement: route() where resource.attributes["job"] == "apiserver" - - exporters: - - sumologic/control_plane - statement: route() where resource.attributes["job"] == "coredns" - - exporters: - - sumologic/control_plane - statement: route() where resource.attributes["job"] == "kube-etcd" - - exporters: - - sumologic/controller - statement: route() where resource.attributes["job"] == "kube-controller-manager" - - exporters: - - sumologic/kubelet - statement: route() where resource.attributes["job"] == "kubelet" - - exporters: - - sumologic/node - statement: route() where resource.attributes["job"] == "node-exporter" - - exporters: - - sumologic/scheduler - statement: route() where resource.attributes["job"] == "kube-scheduler" - - exporters: - - sumologic/state - statement: route() where resource.attributes["job"] == "kube-state-metrics" source: collector: kubernetes exclude: @@ -301,13 +202,6 @@ data: metrics: exporters: - sumologic/default - - sumologic/apiserver - - sumologic/control_plane - - sumologic/controller - - sumologic/kubelet - - sumologic/node - - sumologic/scheduler - - sumologic/state processors: - memory_limiter - metricstransform @@ -324,7 +218,6 @@ data: - filter/drop_unnecessary_metrics - filter/app_metrics - batch - - routing receivers: - telegraf - otlp diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/basic.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/basic.output.yaml index b2a15b2c46..dafcc2e730 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/basic.output.yaml @@ -132,6 +132,11 @@ spec: secretKeyRef: name: sumologic key: endpoint-metrics + - name: SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-metrics-otlp - name: SUMO_ENDPOINT_KUBELET_METRICS_SOURCE valueFrom: secretKeyRef: diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.input.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.input.yaml index 33b0d8ccc6..103c3be078 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.input.yaml @@ -1,6 +1,6 @@ sumologic: metrics: - sourceType: otlp + sourceType: http metadata: image: repository: my_repository diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.output.yaml index 9bb4e9cefc..d0a6cb25d0 100644 --- a/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/custom.output.yaml @@ -148,11 +148,6 @@ spec: secretKeyRef: name: sumologic key: endpoint-metrics - - name: SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-metrics-otlp - name: SUMO_ENDPOINT_KUBELET_METRICS_SOURCE valueFrom: secretKeyRef: diff --git a/tests/helm/testdata/goldenfile/traces-gateway-deployment/basic.output.yaml b/tests/helm/testdata/goldenfile/traces-gateway-deployment/basic.output.yaml index 2aebc3f28a..8fee76b063 100644 --- a/tests/helm/testdata/goldenfile/traces-gateway-deployment/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-gateway-deployment/basic.output.yaml @@ -48,6 +48,11 @@ spec: secretKeyRef: name: sumologic key: endpoint-traces + - name: SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-traces-otlp - name: SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE valueFrom: diff --git a/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.input.yaml b/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.input.yaml index 193911e475..32cd5fe67e 100644 --- a/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.input.yaml @@ -1,6 +1,6 @@ sumologic: traces: - sourceType: otlp + sourceType: http tracesGateway: deployment: diff --git a/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.output.yaml b/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.output.yaml index 287ffc56db..e31aa0e671 100644 --- a/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.output.yaml @@ -48,11 +48,6 @@ spec: secretKeyRef: name: sumologic key: endpoint-traces - - name: SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-traces-otlp - name: SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE valueFrom: diff --git a/tests/helm/testdata/goldenfile/traces-sampler-deployment/basic.output.yaml b/tests/helm/testdata/goldenfile/traces-sampler-deployment/basic.output.yaml index d0cbdf8440..6e94df2659 100644 --- a/tests/helm/testdata/goldenfile/traces-sampler-deployment/basic.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-sampler-deployment/basic.output.yaml @@ -42,6 +42,11 @@ spec: secretKeyRef: name: sumologic key: endpoint-traces + - name: SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-traces-otlp - name: NO_PROXY value: kubernetes.default.svc diff --git a/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.input.yaml b/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.input.yaml index 998cea5a35..330ba2d398 100644 --- a/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.input.yaml @@ -1,6 +1,6 @@ sumologic: traces: - sourceType: otlp + sourceType: http tracesSampler: deployment: diff --git a/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.output.yaml b/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.output.yaml index 331dd4892a..1970bed76b 100644 --- a/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.output.yaml @@ -42,11 +42,6 @@ spec: secretKeyRef: name: sumologic key: endpoint-traces - - name: SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-traces-otlp - name: NO_PROXY value: kubernetes.default.svc diff --git a/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml b/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml index 4ac84c2ade..ffca5a12c3 100644 --- a/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml +++ b/tests/helm/testdata/goldenfile/traces-sampler/simple.output.yaml @@ -15,7 +15,7 @@ data: exporters: otlphttp: compression: gzip - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE} + traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces extensions: health_check: {} memory_ballast: diff --git a/tests/integration/helm_otlp_test.go b/tests/integration/helm_http_source_test.go similarity index 96% rename from tests/integration/helm_otlp_test.go rename to tests/integration/helm_http_source_test.go index 3394915fd2..47f4a9dc1c 100644 --- a/tests/integration/helm_otlp_test.go +++ b/tests/integration/helm_http_source_test.go @@ -9,7 +9,7 @@ import ( "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal" ) -func Test_Helm_OTLP(t *testing.T) { +func Test_Helm_Http_Source(t *testing.T) { expectedMetrics := internal.DefaultExpectedMetrics // we have tracing enabled, so check tracing-specific metrics expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) diff --git a/tests/integration/values/values_common.yaml b/tests/integration/values/values_common.yaml index ba04b0c48e..c89271c8fa 100644 --- a/tests/integration/values/values_common.yaml +++ b/tests/integration/values/values_common.yaml @@ -85,11 +85,6 @@ otelcol: # Request less resources so that this fits on Github actions runners environment tracesSampler: - config: - # Default otlp pipeline from values.yaml is used. - exporters: - otlphttp: - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}/v1/traces deployment: replicas: 1 resources: diff --git a/tests/integration/values/values_helm_http_source.yaml b/tests/integration/values/values_helm_http_source.yaml new file mode 100644 index 0000000000..030b28cd9b --- /dev/null +++ b/tests/integration/values/values_helm_http_source.yaml @@ -0,0 +1,15 @@ +sumologic: + metrics: + sourceType: http + events: + sourceType: http + logs: + sourceType: http + traces: + sourceType: http + +tracesSampler: + config: + exporters: + otlphttp: + traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}/v1/traces diff --git a/tests/integration/values/values_helm_otlp.yaml b/tests/integration/values/values_helm_otlp.yaml deleted file mode 100644 index 23b16538c9..0000000000 --- a/tests/integration/values/values_helm_otlp.yaml +++ /dev/null @@ -1,15 +0,0 @@ -sumologic: - metrics: - sourceType: otlp - events: - sourceType: otlp - logs: - sourceType: otlp - traces: - sourceType: otlp - -tracesSampler: - config: - exporters: - otlphttp: - traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_TRACES_SOURCE}/v1/traces