diff --git a/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml index 2413e22839..8315633e89 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml @@ -7,3 +7,25 @@ status: availableReplicas: 1 readyReplicas: 1 replicas: 1 + +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + app.kubernetes.io/instance: kuttl-otlp-metrics.cluster-collector + app.kubernetes.io/managed-by: opentelemetry-operator + app.kubernetes.io/name: cluster-collector-collector + name: cluster-collector-collector + namespace: kuttl-otlp-metrics +spec: + endpoints: + - port: monitoring + - port: prometheus + namespaceSelector: + matchNames: + - kuttl-otlp-metrics + selector: + matchLabels: + app.kubernetes.io/instance: kuttl-otlp-metrics.cluster-collector + app.kubernetes.io/managed-by: opentelemetry-operator diff --git a/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml b/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml index 83257f98a6..632b994457 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml @@ -7,10 +7,9 @@ metadata: namespace: kuttl-otlp-metrics spec: mode: deployment - ports: - - name: promexporter - port: 8889 - protocol: TCP + observability: + metrics: + enableMetrics: true config: | receivers: otlp: @@ -19,10 +18,10 @@ spec: http: processors: exporters: - jaeger: - endpoint: jaeger-allinone-collector-headless.kuttl-otlp-metrics.svc:14250 + otlp: + endpoint: jaeger-allinone-collector-headless.kuttl-otlp-metrics.svc:4317 tls: - ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt" + insecure: true prometheus: endpoint: 0.0.0.0:8889 resource_to_telemetry_conversion: @@ -32,7 +31,7 @@ spec: traces: receivers: [otlp] processors: [] - exporters: [jaeger] + exporters: [otlp] metrics: receivers: [otlp] processors: [] diff --git a/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml index faf3c91c8e..73bbb738a9 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml @@ -1,25 +1,22 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: telemetrygen-traces +status: + active: 1 + ready: 1 + --- -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor +apiVersion: batch/v1 +kind: Job metadata: - name: otel-collector - namespace: kuttl-otlp-metrics -spec: - podMetricsEndpoints: - - port: metrics - - metricRelabelings: - - action: labeldrop - regex: instance - - action: labeldrop - regex: job - port: promexporter - relabelings: - - action: labeldrop - regex: pod - - action: labeldrop - regex: container - - action: labeldrop - regex: endpoint - selector: - matchLabels: - app.kubernetes.io/name: cluster-collector-collector + name: telemetrygen-metrics +status: + active: 1 + ready: 1 + +--- +apiVersion: v1 +kind: Pod +status: + phase: Running diff --git a/tests/e2e-openshift/otlp-metrics-traces/04-metrics-traces-gen.yaml b/tests/e2e-openshift/otlp-metrics-traces/03-metrics-traces-gen.yaml similarity index 100% rename from tests/e2e-openshift/otlp-metrics-traces/04-metrics-traces-gen.yaml rename to tests/e2e-openshift/otlp-metrics-traces/03-metrics-traces-gen.yaml diff --git a/tests/e2e-openshift/otlp-metrics-traces/03-podmonitor.yaml b/tests/e2e-openshift/otlp-metrics-traces/03-podmonitor.yaml deleted file mode 100644 index b0eaf43637..0000000000 --- a/tests/e2e-openshift/otlp-metrics-traces/03-podmonitor.yaml +++ /dev/null @@ -1,26 +0,0 @@ -#https://docs.openshift.com/container-platform/4.13/monitoring/managing-metrics.html -#https://docs.openshift.com/container-platform/4.13/rest_api/monitoring_apis/podmonitor-monitoring-coreos-com-v1.html -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: otel-collector - namespace: kuttl-otlp-metrics -spec: - selector: - matchLabels: - app.kubernetes.io/name: cluster-collector-collector - podMetricsEndpoints: - - port: metrics - - port: promexporter - relabelings: - - action: labeldrop - regex: pod - - action: labeldrop - regex: container - - action: labeldrop - regex: endpoint - metricRelabelings: - - action: labeldrop - regex: instance - - action: labeldrop - regex: job diff --git a/tests/e2e-openshift/otlp-metrics-traces/04-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/04-assert.yaml index 73bbb738a9..9bec95f449 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/04-assert.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/04-assert.yaml @@ -1,22 +1,6 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: telemetrygen-traces -status: - active: 1 - ready: 1 - --- -apiVersion: batch/v1 -kind: Job -metadata: - name: telemetrygen-metrics -status: - active: 1 - ready: 1 - ---- -apiVersion: v1 -kind: Pod -status: - phase: Running +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 30 +commands: +- script: ./tests/e2e-openshift/otlp-metrics-traces/check_traces.sh diff --git a/tests/e2e-openshift/otlp-metrics-traces/05-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/05-assert.yaml index 9bec95f449..79570e05a4 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/05-assert.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/05-assert.yaml @@ -1,6 +1,5 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 30 commands: -- script: ./tests/e2e-openshift/otlp-metrics-traces/check_traces.sh +- script: ./tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh diff --git a/tests/e2e-openshift/otlp-metrics-traces/06-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/06-assert.yaml deleted file mode 100644 index 79570e05a4..0000000000 --- a/tests/e2e-openshift/otlp-metrics-traces/06-assert.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -commands: -- script: ./tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh