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

Missing custom metrics #557

Closed
szb640 opened this issue Nov 21, 2023 · 1 comment · Fixed by #558
Closed

Missing custom metrics #557

szb640 opened this issue Nov 21, 2023 · 1 comment · Fixed by #558

Comments

@szb640
Copy link
Contributor

szb640 commented Nov 21, 2023

Expected behavior (what you expected to happen): Metrics appended via $METRICS_PATH should appear in prometheus results.

Actual behavior (what actually happened): From v1.4.2+, metrics are added successfully (confirmed by logs), however they are not returned by prometheus.

Steps to reproduce:

  1. Add hook and deploy
  2. Inside the container run curl 127.0.0.1:9115/metrics

Environment:

  • Shell-operator version: v1.4.2+
  • Kubernetes version: v1.27.7
  • Installation type (kubectl apply, helm chart, etc.): Helm chart

Anything else we should know?: This is working as expected in ghcr.io/flant/shell-operator:v1.4.1, but seems broken in v1.4.2 and v1.4.3.

Additional information for debugging (if necessary):

Hook script
#!/usr/bin/env bash

source /shell_lib.sh

function config() {
cat <<EOF
configVersion: v1
onStartup: 1
EOF
}

function main() {
echo '{"name": "my_metric", "action": "add", "value": 0}' >> ${METRICS_PATH}
}

hook::run $@

Logs
{"level":"info","msg":"Create metric counter my_counter","operator.component":"metricStorage","time":"2023-11-20T00:00:00Z"}
{"binding":"","event":"onStartup","hook":"startup.sh","level":"info","msg":"Hook executed successfully","queue":"","task":"HookRun","time":"2023-11-21T14:38:12Z"}
@szb640
Copy link
Contributor Author

szb640 commented Nov 22, 2023

I've found #549 introduced a breaking change in how metrics are reported, they are no longer exposed on /metrics path but on /metrics/hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant