From fae8c2e0d08ef9e522c6b614ecae6cb40835540d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Tue, 21 Mar 2023 15:51:42 +0100 Subject: [PATCH] feat(metrics): add ability to use OTLP source --- .changelog/2949.added.txt | 1 + deploy/helm/sumologic/README.md | 1 + .../conf/metrics/otelcol/exporters.yaml | 84 +++---- .../conf/metrics/otelcol/pipeline.yaml | 6 + .../conf/metrics/otelcol/processors.yaml | 11 + .../sumologic/templates/_helpers/_metrics.tpl | 27 +++ deploy/helm/sumologic/values.yaml | 9 + docs/README.md | 1 + docs/otlp-source.md | 12 +- tests/helm/metrics_test.go | 46 ++++ .../metadata_metrics_otc/custom.input.yaml | 3 + .../metadata_metrics_otc/custom.output.yaml | 219 ++++++++++++++++++ .../custom.input.yaml | 1 + .../custom.output.yaml | 5 + .../terraform/all_fields.output.yaml | 9 + .../terraform/collector_fields.output.yaml | 9 + .../goldenfile/terraform/default.output.yaml | 9 + .../disable_default_metrics.output.yaml | 9 + .../terraform/disabled_dashboards.output.yaml | 9 + .../terraform/disabled_monitors.output.yaml | 9 + ...itors_with_email_notifications.output.yaml | 9 + .../monitors_with_single_email.output.yaml | 9 + .../terraform/strip_extrapolation.output.yaml | 9 + .../tracing-metrics-disabled.output.yaml | 9 + .../helm_fluentbit_fluentd_test.go | 2 +- .../helm_ot_default_namespaceoverride_test.go | 2 +- tests/integration/helm_ot_default_test.go | 2 +- tests/integration/helm_ot_metrics_test.go | 2 +- ...elm_otc_fips_metadata_installation_test.go | 2 +- tests/integration/helm_otlp_test.go | 17 +- .../integration/values/values_helm_otlp.yaml | 2 +- 31 files changed, 495 insertions(+), 50 deletions(-) create mode 100644 .changelog/2949.added.txt create mode 100644 tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml create mode 100644 tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml diff --git a/.changelog/2949.added.txt b/.changelog/2949.added.txt new file mode 100644 index 0000000000..9479e4e6f0 --- /dev/null +++ b/.changelog/2949.added.txt @@ -0,0 +1 @@ +feat(metrics): add ability to use OTLP source \ No newline at end of file diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 71b53617d4..a85d41ab30 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -139,6 +139,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `sumologic.metrics.collector.otelcol.annotatedPods.enabled` | Enable collection of metrics from Pods annotated with prometheus.io/\* keys. See [docs/collecting-application-metrics.md](/docs/collecting-application-metrics.md#application-metrics-are-exposed-one-endpoint-scenario) for more information. | `true` | | `sumologic.metrics.collector.otelcol.allocationStrategy` | Allocation strategy for the scrape target allocator. Valid values are: least-weighted and consistent-hashing. See: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspectargetallocator | `least-weighted` | | `sumologic.metrics.dropHistogramBuckets` | Drop buckets from select high-cardinality histogram metrics, leaving only the sum and count components. | `true` | +| `sumologic.metrics.sourceType` | The type of the Sumo Logic source being used for metrics ingestion. Can be `http` or `otlp`. | `http` | | `sumologic.traces.enabled` | Set the enabled flag to true to enable tracing ingestion. _Tracing must be enabled for the account first. Please contact your Sumo representative for activation details_ | `true` | | `sumologic.traces.spans_per_request` | Maximum number of spans sent in single batch | `100` | | `sumologic.traces.sourceType` | The type of the Sumo Logic source being used for traces ingestion. Can be `http` for [HTTP Source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/traces/) or `otlp` for [OTLP/HTTP Source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/otlp/). | `http` | diff --git a/deploy/helm/sumologic/conf/metrics/otelcol/exporters.yaml b/deploy/helm/sumologic/conf/metrics/otelcol/exporters.yaml index 41b72f284f..e2dfda95fa 100644 --- a/deploy/helm/sumologic/conf/metrics/otelcol/exporters.yaml +++ b/deploy/helm/sumologic/conf/metrics/otelcol/exporters.yaml @@ -1,106 +1,112 @@ -sumologic/apiserver: - endpoint: ${SUMO_ENDPOINT_APISERVER_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression - metric_format: prometheus +## Configuration for Sumo Logic Exporter +## ref: https://github.com/SumoLogic/sumologic-otel-collector/blob/main/pkg/exporter/sumologicexporter +sumologic/default: + metric_format: {{ include "metrics.otelcol.exporter.format" . }} + endpoint: {{ include "metrics.otelcol.exporter.endpoint" . }} + ## Configuration for sending queue + ## ref: https://github.com/open-telemetry/opentelemetry-collector/tree/release/v0.37.x/exporter/exporterhelper#configuration sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + ## setting queue_size a high number, so we always use maximum space of the storage + ## minimal alert non-triggering queue size (if only one exporter is being used): 10GB/16MB = 640 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s -sumologic/control_plane: - endpoint: ${SUMO_ENDPOINT_CONTROL_PLANE_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression +{{- if eq .Values.sumologic.metrics.sourceType "http" }} +sumologic/apiserver: metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_APISERVER_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s -sumologic/controller: - endpoint: ${SUMO_ENDPOINT_CONTROLLER_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression +sumologic/control_plane: metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_CONTROL_PLANE_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s -sumologic/default: - endpoint: ${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression +sumologic/controller: metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_CONTROLLER_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - ## setting queue_size a high number, so we always use maximum space of the storage - ## minimal alert non-triggering queue size (if only one exporter is being used): 10GB/16MB = 640 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s sumologic/kubelet: - endpoint: ${SUMO_ENDPOINT_KUBELET_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_KUBELET_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s sumologic/node: - endpoint: ${SUMO_ENDPOINT_NODE_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_NODE_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s sumologic/scheduler: - endpoint: ${SUMO_ENDPOINT_SCHEDULER_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_SCHEDULER_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s sumologic/state: - endpoint: ${SUMO_ENDPOINT_STATE_METRICS_SOURCE} - max_request_body_size: 16_777_216 # 16 MB before compression metric_format: prometheus + endpoint: ${SUMO_ENDPOINT_STATE_METRICS_SOURCE} sending_queue: enabled: true - num_consumers: 10 - queue_size: 10_000 {{- if .Values.metadata.persistence.enabled }} storage: file_storage {{- end }} + num_consumers: 10 + queue_size: 10_000 + max_request_body_size: 16_777_216 # 16 MB before compression ## set timeout to 30s due to big requests timeout: 30s +{{- end }} diff --git a/deploy/helm/sumologic/conf/metrics/otelcol/pipeline.yaml b/deploy/helm/sumologic/conf/metrics/otelcol/pipeline.yaml index f04e65e103..6d4ad50b6f 100644 --- a/deploy/helm/sumologic/conf/metrics/otelcol/pipeline.yaml +++ b/deploy/helm/sumologic/conf/metrics/otelcol/pipeline.yaml @@ -1,5 +1,6 @@ exporters: - sumologic/default +{{- if eq .Values.sumologic.metrics.sourceType "http" }} - sumologic/apiserver - sumologic/control_plane - sumologic/controller @@ -7,6 +8,7 @@ exporters: - sumologic/node - sumologic/scheduler - sumologic/state +{{- end }} processors: - memory_limiter - metricstransform @@ -26,8 +28,12 @@ processors: - groupbyattrs/group_by_name - transform/remove_name - batch +{{- if eq .Values.sumologic.metrics.sourceType "http" }} - transform/prepare_routing - routing +{{- else }} + - transform/drop_routing_attribute +{{- end }} receivers: - telegraf - otlp diff --git a/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml b/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml index 8801068f6a..cf5ae4ea5e 100644 --- a/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml +++ b/deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml @@ -115,6 +115,7 @@ resource/remove_k8s_pod_pod_name: - action: delete key: k8s.pod.pod_name +{{- if eq .Values.sumologic.metrics.sourceType "http" }} ## NOTE: below listed rules could be simplified if routingprocessor ## supports regex matching. At this point we could group route entries ## going to the same set of exporters. @@ -163,6 +164,7 @@ routing: - exporters: - sumologic/default value: /prometheus.metrics.applications.custom +{{- end }} ## Configuration for Source Processor ## Source processor adds Sumo Logic related metadata @@ -176,6 +178,7 @@ source: sumologic_schema: add_cloud_namespace: false +{{- if eq .Values.sumologic.metrics.sourceType "http" }} transform/prepare_routing: error_mode: ignore metric_statements: @@ -189,6 +192,14 @@ transform/prepare_routing: - set(resource.attributes["http_listener_v2_path"], "/prometheus.metrics.node") where resource.attributes["job"] == "node-exporter" - set(resource.attributes["http_listener_v2_path"], "/prometheus.metrics.scheduler") where resource.attributes["job"] == "kube-scheduler" - set(resource.attributes["http_listener_v2_path"], "/prometheus.metrics.state") where resource.attributes["job"] == "kube-state-metrics" +{{ else }} +transform/drop_routing_attribute: + error_mode: ignore + metric_statements: + - context: resource + statements: + - delete_key(attributes, "http_listener_v2_path") +{{- end }} transform/remove_name: error_mode: ignore diff --git a/deploy/helm/sumologic/templates/_helpers/_metrics.tpl b/deploy/helm/sumologic/templates/_helpers/_metrics.tpl index 4122d8631f..cf005e3e46 100644 --- a/deploy/helm/sumologic/templates/_helpers/_metrics.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_metrics.tpl @@ -290,6 +290,33 @@ sumologic.com/app: otelcol {{ template "sumologic.metadata.name.metrics.targetallocator.name" . }} {{- end -}} +{{/* +Return the metrics format for the default Sumologic exporter for metrics. +'{{ include "metrics.otelcol.exporter.format" . }}' +*/}} +{{- define "metrics.otelcol.exporter.format" -}} +{{- if eq .Values.sumologic.metrics.sourceType "http" -}} +{{- "prometheus" -}} +{{- else if eq .Values.sumologic.metrics.sourceType "otlp" -}} +{{- "otlp" -}} +{{- else -}} +{{- fail "`sumologic.metrics.sourceType` can only be `http` or `otlp`" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the endpoint for the default Sumologic exporter for metrics. +'{{ include "metrics.otelcol.exporter.endpoint" . }}' +*/}} +{{- define "metrics.otelcol.exporter.endpoint" -}} +{{- if eq .Values.sumologic.metrics.sourceType "http" -}} +{{- "${SUMO_ENDPOINT_DEFAULT_METRICS_SOURCE}" -}} +{{- else if eq .Values.sumologic.metrics.sourceType "otlp" -}} +{{- "${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE}" -}} +{{- else -}} +{{- fail "`sumologic.metrics.sourceType` can only be `http` or `otlp`" -}} +{{- end -}} +{{- end -}} {{/* Generate metrics match configuration diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 57009bb68a..446085d62e 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -166,6 +166,11 @@ sumologic: default: name: (default-metrics) config-name: endpoint-metrics + default-otlp: + name: metrics-otlp + config-name: endpoint-metrics-otlp + properties: + content_type: Otlp apiserver: name: apiserver-metrics config-name: endpoint-metrics-apiserver @@ -722,6 +727,10 @@ sumologic: matchLabels: app: kube-prometheus-stack-prometheus + ## The type of source we send to in Sumo. The possible values are http and otlp. + ## Consult the documentation for more information. + sourceType: http + ### Traces configuration ## Set the enabled flag to false to disable traces ingestion. traces: diff --git a/docs/README.md b/docs/README.md index 1b31c1d0dd..d6146c853e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -40,6 +40,7 @@ Documentation links: - [Comparison of Fluentd and Opentelemetry Collector functionality](/docs/fluent/fluentd-otc-comparison.md) - [Comparison of Fluent Bit and Opentelemetry Collector functionality](/docs/fluentbit-otc-comparison.md) - [Traces - auto-instrumentation in Kubernetes](https://help.sumologic.com/docs/apm/traces/get-started-transaction-tracing/opentelemetry-instrumentation/kubernetes) + - [OTLP source](/docs/otlp-source.md) - Fluentd and Fluent-Bit - [Adding Additional Fluentd Plugins](/docs/fluent/additional-fluentd-plugins.md) - [Container log parsing with Fluent-Bit (Docker, CRI-O, containerd)](/docs/fluent/container-logs.md) diff --git a/docs/otlp-source.md b/docs/otlp-source.md index 220fdfbf24..05932be5ad 100644 --- a/docs/otlp-source.md +++ b/docs/otlp-source.md @@ -7,8 +7,6 @@ The data needed to be converted to the formats the generic HTTP source supports Recently, we've added support for directly sending data using the OTLP protocol to Sumo Logic. This is achieved using the [OTLP source][otlp_source]. This document explains how to use this new source with the Helm Chart. -**Note:** This Chart currently only supports OTLP Source for the following signal types: logs, events - ## Enabling the OTLP source ### For logs @@ -21,6 +19,16 @@ sumologic: sourceType: otlp ``` +### For metrics + +Add the following to your configuration: + +```yaml +sumologic: + metricss: + sourceType: otlp +``` + ### For traces Add the following to your configuration: diff --git a/tests/helm/metrics_test.go b/tests/helm/metrics_test.go index 65286f7888..b377837c8b 100644 --- a/tests/helm/metrics_test.go +++ b/tests/helm/metrics_test.go @@ -4,6 +4,7 @@ import ( "path" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" ) @@ -141,3 +142,48 @@ func TestMetadataMetricsOtelConfigExtraProcessors(t *testing.T) { require.Equal(t, expectedPipelineValue, otelConfig.Service.Pipelines.Metrics.Processors) } + +func TestMetadataSourceTypeOTLP(t *testing.T) { + t.Parallel() + templatePath := "templates/metrics/otelcol/configmap.yaml" + + type OtelConfig struct { + Exporters struct { + Default struct { + MetricFormat string `yaml:"metric_format"` + Endpoint string + } `yaml:"sumologic/default"` + Rest map[string]interface{} `yaml:",inline"` + } + 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: otlp +` + otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath) + err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig) + require.NoError(t, err) + + assert.Equal(t, otelConfig.Exporters.Default.MetricFormat, "otlp") + 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.Contains(t, otelConfig.Processors, "transform/drop_routing_attribute") + assert.NotContains(t, otelConfig.Service.Pipelines.Metrics.Processors, "routing") + assert.NotContains(t, otelConfig.Service.Pipelines.Metrics.Processors, "transform/prepare_routing") + assert.Contains(t, otelConfig.Service.Pipelines.Metrics.Processors, "transform/drop_routing_attribute") + assert.Equal(t, otelConfig.Service.Pipelines.Metrics.Exporters, []string{"sumologic/default"}) +} diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml new file mode 100644 index 0000000000..19eb873f99 --- /dev/null +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml @@ -0,0 +1,3 @@ +sumologic: + metrics: + sourceType: otlp diff --git a/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml new file mode 100644 index 0000000000..69c63e68f8 --- /dev/null +++ b/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.output.yaml @@ -0,0 +1,219 @@ +--- +# Source: sumologic/templates/metrics/otelcol/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: RELEASE-NAME-sumologic-otelcol-metrics + namespace: sumologic + labels: + app: RELEASE-NAME-sumologic-otelcol-metrics + chart: "sumologic-%CURRENT_CHART_VERSION%" + release: "RELEASE-NAME" + heritage: "Helm" +data: + config.yaml: | + exporters: + sumologic/default: + endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_METRICS_SOURCE} + max_request_body_size: 16777216 + metric_format: otlp + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 10000 + storage: file_storage + timeout: 30s + extensions: + file_storage: + compaction: + directory: /tmp + on_rebound: true + directory: /var/lib/storage/otc + timeout: 10s + health_check: {} + pprof: {} + processors: + batch: + send_batch_max_size: 2048 + send_batch_size: 1024 + timeout: 1s + groupbyattrs: + keys: + - container + - namespace + - pod + - service + groupbyattrs/group_by_name: + keys: + - __name__ + - job + k8s_tagger: + extract: + delimiter: _ + labels: + - key: '*' + tag_name: pod_labels_%s + metadata: + - daemonSetName + - deploymentName + - nodeName + - replicaSetName + - serviceName + - statefulSetName + owner_lookup_enabled: true + passthrough: false + pod_association: + - from: build_hostname + memory_limiter: + check_interval: 5s + limit_percentage: 75 + spike_limit_percentage: 20 + metricstransform: + transforms: + action: update + include: ^prometheus_remote_write_(.*)$$ + match_type: regexp + new_name: $$1 + resource: + attributes: + - action: upsert + from_attribute: namespace + key: k8s.namespace.name + - action: delete + key: namespace + - action: upsert + from_attribute: pod + key: k8s.pod.name + - action: delete + key: pod + - action: upsert + from_attribute: container + key: k8s.container.name + - action: delete + key: container + - action: upsert + from_attribute: service + key: prometheus_service + - action: delete + key: service + - action: upsert + from_attribute: service.name + key: job + - action: delete + key: service.name + - action: upsert + key: _origin + value: kubernetes + - action: upsert + key: cluster + value: kubernetes + resource/delete_source_metadata: + attributes: + - action: delete + key: _sourceCategory + - action: delete + key: _sourceHost + - action: delete + key: _sourceName + resource/remove_k8s_pod_pod_name: + attributes: + - action: delete + key: k8s.pod.pod_name + source: + collector: kubernetes + exclude: + k8s.namespace.name: "" + sumologic_schema: + add_cloud_namespace: false + transform/drop_routing_attribute: + error_mode: ignore + metric_statements: + - context: resource + statements: + - delete_key(attributes, "http_listener_v2_path") + transform/remove_name: + error_mode: ignore + metric_statements: + - context: resource + statements: + - delete_key(attributes, "__name__") + transform/set_name: + error_mode: ignore + metric_statements: + - context: datapoint + statements: + - set(attributes["__name__"], metric.name) where IsMatch(metric.name, "^cloudprovider_.*") + receivers: + otlp: + protocols: + http: + endpoint: 0.0.0.0:4318 + telegraf: + agent_config: | + [agent] + interval = "30s" + flush_interval = "30s" + omit_hostname = true + [[inputs.http_listener_v2]] + # wait longer than prometheus + read_timeout = "30s" + write_timeout = "30s" + service_address = ":9888" + data_format = "prometheusremotewrite" + path_tag = true + paths = [ + "/prometheus.metrics", + "/prometheus.metrics.applications.activemq", + "/prometheus.metrics.applications.apache", + "/prometheus.metrics.applications.cassandra", + "/prometheus.metrics.applications.couchbase", + "/prometheus.metrics.applications.custom", + "/prometheus.metrics.applications.elasticsearch", + "/prometheus.metrics.applications.haproxy", + "/prometheus.metrics.applications.jmx", + "/prometheus.metrics.applications.kafka", + "/prometheus.metrics.applications.memcached", + "/prometheus.metrics.applications.mongodb", + "/prometheus.metrics.applications.mysql", + "/prometheus.metrics.applications.nginx", + "/prometheus.metrics.applications.nginx-ingress", + "/prometheus.metrics.applications.postgresql", + "/prometheus.metrics.applications.rabbitmq", + "/prometheus.metrics.applications.redis", + "/prometheus.metrics.applications.sqlserver", + "/prometheus.metrics.applications.squidproxy", + "/prometheus.metrics.applications.tomcat", + "/prometheus.metrics.applications.varnish", + "/prometheus.metrics.node", + "/prometheus.metrics.operator.rule" + ] + service: + extensions: + - health_check + - file_storage + - pprof + pipelines: + metrics: + exporters: + - sumologic/default + processors: + - memory_limiter + - metricstransform + - groupbyattrs + - resource + - k8s_tagger + - source + - resource/remove_k8s_pod_pod_name + - resource/delete_source_metadata + - sumologic_schema + - transform/set_name + - groupbyattrs/group_by_name + - transform/remove_name + - batch + - transform/drop_routing_attribute + receivers: + - telegraf + - otlp + telemetry: + logs: + level: info 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 8fd325b966..fad305432e 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 @@ -2,6 +2,7 @@ sumologic: metrics: metadata: provider: otelcol + sourceType: otlp metadata: image: 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 d0a6cb25d0..9bb4e9cefc 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,6 +148,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/terraform/all_fields.output.yaml b/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml index b6b6d910d5..9ce2c3574f 100644 --- a/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -519,6 +520,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -611,6 +618,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -757,6 +765,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml b/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml index 0c053b7bd4..2e009b3dfa 100644 --- a/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -520,6 +521,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -567,6 +574,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -712,6 +720,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/default.output.yaml b/tests/helm/testdata/goldenfile/terraform/default.output.yaml index b95a53e425..f5b3cc3792 100644 --- a/tests/helm/testdata/goldenfile/terraform/default.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/default.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -518,6 +519,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -565,6 +572,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -710,6 +718,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml b/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml index 8ee74f0a97..b04bdfff65 100644 --- a/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml @@ -350,6 +350,7 @@ data: apiserver_metrics_source = "apiserver-metrics" control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -512,6 +513,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -558,6 +565,7 @@ data: endpoint-metrics-apiserver = sumologic_http_source.apiserver_metrics_source.url endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -702,6 +710,7 @@ data: terraform import sumologic_http_source.apiserver_metrics_source "${COLLECTOR_NAME}/apiserver-metrics" terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml b/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml index 8166fb5a6f..c891e7e5fd 100644 --- a/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -518,6 +519,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -565,6 +572,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -710,6 +718,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml b/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml index 592715d684..f2a06d754f 100644 --- a/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -518,6 +519,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -565,6 +572,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -710,6 +718,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml b/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml index ddff9f8d9f..ce67290063 100644 --- a/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -524,6 +525,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -571,6 +578,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -716,6 +724,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml b/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml index 000fb2a47d..b8d7fd3333 100644 --- a/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -524,6 +525,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -571,6 +578,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -716,6 +724,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml b/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml index c8046937d1..de511d5087 100644 --- a/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -519,6 +520,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -566,6 +573,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -711,6 +719,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml b/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml index b95a53e425..f5b3cc3792 100644 --- a/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml @@ -351,6 +351,7 @@ data: control_plane_metrics_source = "control-plane-metrics" controller_metrics_source = "kube-controller-manager-metrics" default_metrics_source = "(default-metrics)" + default_otlp_metrics_source = "metrics-otlp" kubelet_metrics_source = "kubelet-metrics" node_metrics_source = "node-exporter-metrics" scheduler_metrics_source = "kube-scheduler-metrics" @@ -518,6 +519,12 @@ data: collector_id = sumologic_collector.collector.id } + resource "sumologic_http_source" "default_otlp_metrics_source" { + name = local.default_otlp_metrics_source + collector_id = sumologic_collector.collector.id + content_type = "Otlp" + } + resource "sumologic_http_source" "kubelet_metrics_source" { name = local.kubelet_metrics_source collector_id = sumologic_collector.collector.id @@ -565,6 +572,7 @@ data: endpoint-control_plane_metrics_source = sumologic_http_source.control_plane_metrics_source.url endpoint-metrics-kube-controller-manager = sumologic_http_source.controller_metrics_source.url endpoint-metrics = sumologic_http_source.default_metrics_source.url + endpoint-metrics-otlp = sumologic_http_source.default_otlp_metrics_source.url endpoint-metrics-kubelet = sumologic_http_source.kubelet_metrics_source.url endpoint-metrics-node-exporter = sumologic_http_source.node_metrics_source.url endpoint-metrics-kube-scheduler = sumologic_http_source.scheduler_metrics_source.url @@ -710,6 +718,7 @@ data: terraform import sumologic_http_source.control_plane_metrics_source "${COLLECTOR_NAME}/control-plane-metrics" terraform import sumologic_http_source.controller_metrics_source "${COLLECTOR_NAME}/kube-controller-manager-metrics" terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)" + terraform import sumologic_http_source.default_otlp_metrics_source "${COLLECTOR_NAME}/metrics-otlp" terraform import sumologic_http_source.kubelet_metrics_source "${COLLECTOR_NAME}/kubelet-metrics" terraform import sumologic_http_source.node_metrics_source "${COLLECTOR_NAME}/node-exporter-metrics" terraform import sumologic_http_source.scheduler_metrics_source "${COLLECTOR_NAME}/kube-scheduler-metrics" diff --git a/tests/integration/helm_fluentbit_fluentd_test.go b/tests/integration/helm_fluentbit_fluentd_test.go index f523387e9f..354ec923ea 100644 --- a/tests/integration/helm_fluentbit_fluentd_test.go +++ b/tests/integration/helm_fluentbit_fluentd_test.go @@ -13,7 +13,7 @@ func Test_Helm_FluentBit_Fluentd(t *testing.T) { expectedMetrics := internal.DefaultExpectedFluentdFluentbitMetrics installChecks := []featureCheck{ - CheckSumologicSecret(12), + CheckSumologicSecret(13), CheckFluentdMetadataLogsInstall, CheckFluentdMetadataMetricsInstall, CheckFluentdEventsInstall, diff --git a/tests/integration/helm_ot_default_namespaceoverride_test.go b/tests/integration/helm_ot_default_namespaceoverride_test.go index 92751770cf..a4cc210cda 100644 --- a/tests/integration/helm_ot_default_namespaceoverride_test.go +++ b/tests/integration/helm_ot_default_namespaceoverride_test.go @@ -22,7 +22,7 @@ func Test_Helm_Default_OT_NamespaceOverride(t *testing.T) { expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) installChecks := []featureCheck{ - CheckSumologicSecret(14), + CheckSumologicSecret(15), CheckOtelcolMetadataLogsInstall, CheckOtelcolMetadataMetricsInstall, CheckOtelcolEventsInstall, diff --git a/tests/integration/helm_ot_default_test.go b/tests/integration/helm_ot_default_test.go index 5369c017ea..79b83b5f60 100644 --- a/tests/integration/helm_ot_default_test.go +++ b/tests/integration/helm_ot_default_test.go @@ -16,7 +16,7 @@ func Test_Helm_Default_OT(t *testing.T) { expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) installChecks := []featureCheck{ - CheckSumologicSecret(14), + CheckSumologicSecret(15), CheckOtelcolMetadataLogsInstall, CheckOtelcolMetadataMetricsInstall, CheckOtelcolEventsInstall, diff --git a/tests/integration/helm_ot_metrics_test.go b/tests/integration/helm_ot_metrics_test.go index b846762770..a28d636f0d 100644 --- a/tests/integration/helm_ot_metrics_test.go +++ b/tests/integration/helm_ot_metrics_test.go @@ -41,7 +41,7 @@ func Test_Helm_OT_Metrics(t *testing.T) { } installChecks := []featureCheck{ - CheckSumologicSecret(8), + CheckSumologicSecret(9), CheckOtelcolMetadataMetricsInstall, CheckOtelcolMetricsCollectorInstall, } diff --git a/tests/integration/helm_otc_fips_metadata_installation_test.go b/tests/integration/helm_otc_fips_metadata_installation_test.go index ba88440166..7f8abe13d3 100644 --- a/tests/integration/helm_otc_fips_metadata_installation_test.go +++ b/tests/integration/helm_otc_fips_metadata_installation_test.go @@ -16,7 +16,7 @@ func Test_Helm_Default_OT_FIPS(t *testing.T) { expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) installChecks := []featureCheck{ - CheckSumologicSecret(14), + CheckSumologicSecret(15), CheckOtelcolMetadataLogsInstall, CheckOtelcolMetadataMetricsInstall, CheckOtelcolEventsInstall, diff --git a/tests/integration/helm_otlp_test.go b/tests/integration/helm_otlp_test.go index 4cf16b8426..efcba74906 100644 --- a/tests/integration/helm_otlp_test.go +++ b/tests/integration/helm_otlp_test.go @@ -5,24 +5,35 @@ package integration import ( "testing" + + "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal" ) func Test_Helm_OTLP(t *testing.T) { + expectedMetrics := internal.DefaultExpectedMetrics + // we have tracing enabled, so check tracing-specific metrics + expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...) + installChecks := []featureCheck{ - CheckSumologicSecret(7), + CheckSumologicSecret(15), CheckOtelcolMetadataLogsInstall, - CheckOtelcolLogsCollectorInstall, + CheckOtelcolMetadataMetricsInstall, CheckOtelcolEventsInstall, + CheckPrometheusInstall, + CheckOtelcolLogsCollectorInstall, + CheckTracesInstall, } featInstall := GetInstallFeature(installChecks) featLogs := GetLogsFeature() + featMetrics := GetMetricsFeature(expectedMetrics, Prometheus) + featTraces := GetTracesFeature() featEvents := GetEventsFeature() - testenv.Test(t, featInstall, featLogs, featEvents, featTraces) + testenv.Test(t, featInstall, featLogs, featMetrics, featEvents, featTraces) } diff --git a/tests/integration/values/values_helm_otlp.yaml b/tests/integration/values/values_helm_otlp.yaml index 8c275a0cee..23b16538c9 100644 --- a/tests/integration/values/values_helm_otlp.yaml +++ b/tests/integration/values/values_helm_otlp.yaml @@ -1,6 +1,6 @@ sumologic: metrics: - enabled: false + sourceType: otlp events: sourceType: otlp logs: