Following the examples from documentation
https://flant.github.io/shell-operator/metrics/METRICS_FROM_HOOKS.html#custom-metrics
When adding a metric like below:
echo '{"group":"hook1", "name":"hook_metric", "action":"add", "value":1, "labels":{"kind":"pod"}}' >> $METRICS_PATH
Expected behavior (what you expected to happen):
# HELP hook_metric hook_metric
# TYPE hook_metric counter
hook_metric{hook="hook1.sh", kind="pod"} 1
Actual behavior (what actually happened):
This custom metric is not visible in the list of metrics under /metrics endpoint
Steps to reproduce:
Environment:
- Shell-operator version:
shell-operator main-8d7ed98e-2023.12.21_12:27:59
jqFilter implementation: use embedded libjq-go
- Kubernetes version:
Tested both in Docker and Kubernetes v1.26.6
- Installation type (kubectl apply, helm chart, etc.):
Docker
Anything else we should know?:
Additional information for debugging (if necessary):
Dockerfile:
FROM ghcr.io/flant/shell-operator:latest
ADD hooks /hooks
Hook script
if [[ $1 == "--config" ]]; then
cat <<EOF
configVersion: v1
settings:
executionMinInterval: 3s
executionBurst: 3
schedule:
- name: "every 10 seconds"
crontab: "*/10 * * * * *"
allowFailure: true
EOF
else
echo '{"group":"hook1", "name":"hook_metric", "action":"add", "value":1, "labels":{"kind":"pod"}}' >> $METRICS_PATH
fi
Logs
Following the examples from documentation
https://flant.github.io/shell-operator/metrics/METRICS_FROM_HOOKS.html#custom-metrics
When adding a metric like below:
echo '{"group":"hook1", "name":"hook_metric", "action":"add", "value":1, "labels":{"kind":"pod"}}' >> $METRICS_PATHExpected behavior (what you expected to happen):
Actual behavior (what actually happened):
This custom metric is not visible in the list of metrics under /metrics endpoint
Steps to reproduce:
Environment:
shell-operator main-8d7ed98e-2023.12.21_12:27:59
jqFilter implementation: use embedded libjq-go
Tested both in Docker and Kubernetes v1.26.6
Docker
Anything else we should know?:
Additional information for debugging (if necessary):
Dockerfile:
Hook script
Logs