Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] Test operator metrics can be scraped by OpenShift Monitoring #3377

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion tests/e2e-openshift/monitoring/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
Expand All @@ -14,6 +13,31 @@ spec:
file: 00-workload-monitoring.yaml
- assert:
file: 00-assert.yaml
- name: Enable OpenShift platform monitoring on the OpenTelemetry operator namespace
try:
- command:
entrypoint: oc
args:
- get
- pods
- -A
- -l control-plane=controller-manager
- -l app.kubernetes.io/name=opentelemetry-operator
- -o
- jsonpath={.items[0].metadata.namespace}
outputs:
- name: OTEL_NAMESPACE
value: ($stdout)
- command:
env:
- name: otelnamespace
value: ($OTEL_NAMESPACE)
entrypoint: oc
args:
- label
- namespace
- $otelnamespace
- openshift.io/cluster-monitoring=true
- name: step-01
try:
- apply:
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-openshift/monitoring/check_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TOKEN=$(oc create token prometheus-user-workload -n openshift-user-workload-moni
THANOS_QUERIER_HOST=$(oc get route thanos-querier -n openshift-monitoring -o json | jq -r '.spec.host')

#Check metrics for OpenTelemetry collector instance.
metrics="otelcol_process_uptime otelcol_process_runtime_total_sys_memory_bytes otelcol_process_memory_rss otelcol_exporter_sent_spans otelcol_process_cpu_seconds otelcol_process_memory_rss otelcol_process_runtime_heap_alloc_bytes otelcol_process_runtime_total_alloc_bytes otelcol_process_runtime_total_sys_memory_bytes otelcol_process_uptime otelcol_receiver_accepted_spans otelcol_receiver_refused_spans"
metrics="otelcol_process_uptime otelcol_process_runtime_total_sys_memory_bytes otelcol_process_memory_rss otelcol_exporter_sent_spans otelcol_process_cpu_seconds otelcol_process_memory_rss otelcol_process_runtime_heap_alloc_bytes otelcol_process_runtime_total_alloc_bytes otelcol_process_runtime_total_sys_memory_bytes otelcol_process_uptime otelcol_receiver_accepted_spans otelcol_receiver_refused_spans opentelemetry_collector_info opentelemetry_collector_exporters opentelemetry_collector_receivers"

for metric in $metrics; do
query="$metric"
Expand Down
Loading