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 b774b95
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/prometheus-config-validation/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: promreceiver-nopromconfig-collector
name: promreceiver-noscrapeconfigs-collector
status:
replicas: 1
readyReplicas: 1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: promreceiver-nopromconfig-targetallocator
name: promreceiver-noscrapeconfigs-targetallocator
status:
replicas: 1
readyReplicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: promreceiver-nopromconfig
name: promreceiver-noscrapeconfigs
spec:
mode: statefulset
targetAllocator:
Expand Down
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 b774b95

Please sign in to comment.