-
Notifications
You must be signed in to change notification settings - Fork 26
Overriding Observability
Sam Barker edited this page Jul 1, 2022
·
3 revisions
- As a developer, I want to test Observability changes
- Fork https://github.com/bf2fc6cc711aee1a0c2a/observability-resources-mk/
- Create a branch on your fork for the changes.
- Override OBSERVABILITY_CONFIG_REPO to point at your
fork
. - Override OBSERVABILITY_CONFIG_TAG to point at your
branch
- Deploy kas-install as normal.
- Patch
observability-stack
to decrease theresyncPeriod
using commandoc patch observabilities.observability.redhat.com observability-stack --type='json' -p='[{"op": "replace", "path": "/spec/resyncPeriod", "value": "60s"}]'
- Develop your observability changes locally pushing your changes to your branch
-
oc cp -c config-reloader prometheus-kafka-prometheus-0:/etc/prometheus/config_out/prometheus.env.yaml prom.yaml
Copies the rendered prometheus config file from theconfig-reloader
pod. The config-reloader is responsible for turning the operator resources into a prometheus config file.
- On a clean install
prometheus-kafka-prometheus-0
enteredCrashLoopBackOff
with2/3
containers running. This was caused by
level=error ts=2022-07-01T02:11:57.511Z caller=main.go:290 msg="Error loading config (--config.file=/etc/prometheus/config_out/prometheus.env.yaml)" err="parsing YAML file /etc/prometheus/config_out/prometheus.env.yaml: relabel configuration for replace action requires 'target_label' value"
Despite fixing the configuration error and being able to see the corrected YAML in the PodMonitor definition the pod did not recover. Deleting and re-creating the pod was required to re-generate the configuration file.
- PodMonitor YAML definitions have a different syntax to prometheus (and thus relabler.promlabs.com) for example
spec:
podMetricsEndpoints:
metricRelabelings:
- source_labels:
- __name__
- state_ordinal
target_label: state
regex: kafka_broker_state;0
separator: ;
replacement: NOT_RUNNING
action: replace
Is in valid and will result in:
spec:
podMetricsEndpoints:
metricRelabelings:
- regex: kafka_broker_state;0
separator: ;
replacement: NOT_RUNNING
action: replace
Which will make prometheus very un-happy. Obviously the fix is source_labels
-> sourceLabels
and target_label
-> targetLabel
- Relabler Gives a step by step breakdown of the evaluation of a set of
- Prometheus Operator