Skip to content

Commit

Permalink
Add an E2E test for no prometheus config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Świątek committed May 24, 2023
1 parent c09cce3 commit 1515f43
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/e2e/prometheus-config-validation/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: promreceiver-nopromconfig-collector
status:
replicas: 1
readyReplicas: 1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: promreceiver-nopromconfig-targetallocator
status:
replicas: 1
readyReplicas: 1
---
# Print TA and operator logs if test fails
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
- selector: app.kubernetes.io/component=opentelemetry-targetallocator
- selector: app.kubernetes.io/component=opentelemetry-collector
- selector: app.kubernetes.io/name=opentelemetry-operator
namespace: opentelemetry-operator-system
container: manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: promreceiver-nopromconfig
spec:
mode: statefulset
targetAllocator:
enabled: true
image: "local/opentelemetry-operator-targetallocator:e2e"
serviceAccount: ta
prometheusCR:
enabled: true

config: |
receivers:
jaeger:
protocols:
grpc:
prometheus:
target_allocator:
endpoint: http://promreceiver-nopromconfig-targetallocator
interval: 30s
collector_id: ${POD_NAME}
http_sd_config:
refresh_interval: 10s
processors:
exporters:
logging:
extensions:
health_check:
service:
telemetry:
metrics:
address: :8888
extensions:
- health_check
pipelines:
traces:
receivers: [jaeger]
processors: []
exporters: [logging]

0 comments on commit 1515f43

Please sign in to comment.