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

vmalert: datasource.roundDigits Parameter does not work #4340

Closed
gsakun opened this issue May 24, 2023 · 3 comments · Fixed by #4341
Closed

vmalert: datasource.roundDigits Parameter does not work #4340

gsakun opened this issue May 24, 2023 · 3 comments · Fixed by #4341
Assignees
Labels
bug Something isn't working vmalert

Comments

@gsakun
Copy link
Contributor

gsakun commented May 24, 2023

Describe the bug

When I set -datasource.roundDigits="2",I expect the request to be sent to carry parameters round_digits=2. But it does not work

To Reproduce

cat <<EOF >> pod.yaml
groups:
  - name: cadvisor
    rules:
      - alert: ContainerMemoryUsage
        expr: '(sum(container_memory_working_set_bytes{name!=""}) BY (instance, name) / sum(container_spec_memory_limit_bytes > 0) BY (instance, name) * 100) > 80'
        for: 2m
        labels:
          severity: warning
        annotations:
          summary: Container Memory usage (instance {{ $labels.instance }})
          description: "Container Memory usage is above 80%\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
        debug: true
EOF
./vmalert -rule=pod.yaml -datasource.url=http://vmselect.vm.svc.cluster.local:8421/select/0/prometheus -d
atasource.roundDigits=2 -notifier.url=http://10.2.112.25:30717 -evaluationInterval=10s

Version

./vmalert-prod --version

vmalert-20230518-212228-tags-v1.91.0-0-g73dfb030d

Logs

./vmalert -rule=pod.yaml -datasource.url=http://vmselect.vm.svc.cluster.local:8421/select/0/prometheus -d
atasource.roundDigits=2 -notifier.url=http://10.2.112.25:30717 -evaluationInterval=10s
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:12 build version:
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:13 command-line flags
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:20 -datasource.roundDigits="2"
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:20 -datasource.url="secret"
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:20 -evaluationInterval="10s"
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:20 -notifier.url="http://10.2.112.25:30717"
2023-05-24T06:26:41.207Z info VictoriaMetrics/lib/logger/flag.go:20 -rule="pod.yaml"
2023-05-24T06:26:41.211Z info VictoriaMetrics/app/vmalert/main.go:162 reading rules configuration file from "pod.yaml"
2023-05-24T06:26:41.218Z info VictoriaMetrics/lib/httpserver/httpserver.go:99 starting http server at http://127.0.0.1:8880/
2023-05-24T06:26:41.219Z info VictoriaMetrics/lib/httpserver/httpserver.go:100 pprof handlers are exposed at http://127.0.0.1:8880/debug/pprof/
2023-05-24T06:26:46.267Z info VictoriaMetrics/app/vmalert/group.go:264 group "cadvisor" started; interval=10s; concurrency=1
2023-05-24T06:26:46.268Z info VictoriaMetrics/app/vmalert/datasource/vm.go:162 DEBUG datasource request: executing POST request with params "query=%28su
m%28container_memory_working_set_bytes%7Bname%21%3D%22%22%7D%29+BY+%28instance%2C+name%29+%2F+sum%28container_spec_memory_limit_bytes+%3E+0%29+BY+%28instance%2C+name%29+
%2A+100%29+%3E+80&step=300s&time=1684909600"

Screenshots

No response

Used command-line flags

No response

Additional information

No response

@gsakun gsakun added the bug Something isn't working label May 24, 2023
@dmitryk-dk dmitryk-dk self-assigned this May 24, 2023
hagen1778 pushed a commit that referenced this issue Jun 1, 2023
app/vmalert: fix querybuild clone and extraParams merge logic

See #4340
@f41gh7 f41gh7 reopened this Jun 1, 2023
@gsakun gsakun closed this as completed Jun 2, 2023
@hagen1778
Copy link
Collaborator

Hello @gsakun! The fix should be available starting from https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.91.1

hagen1778 pushed a commit that referenced this issue Jun 2, 2023
app/vmalert: fix querybuild clone and extraParams merge logic

See #4340

(cherry picked from commit 20dc3db)
hagen1778 pushed a commit that referenced this issue Jun 5, 2023
app/vmalert: fix querybuild clone and extraParams merge logic

See #4340

(cherry picked from commit 20dc3db)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
hagen1778 pushed a commit that referenced this issue Jun 5, 2023
app/vmalert: fix querybuild clone and extraParams merge logic

See #4340

(cherry picked from commit 20dc3db)
Signed-off-by: hagen1778 <roman@victoriametrics.com>
hagen1778 pushed a commit that referenced this issue Jun 5, 2023
app/vmalert: fix querybuild clone and extraParams merge logic

See #4340

(cherry picked from commit 20dc3db)
hagen1778 pushed a commit that referenced this issue Jun 5, 2023
app/vmalert: fix querybuild clone and extraParams merge logic

See #4340

(cherry picked from commit 20dc3db)
@valyala
Copy link
Collaborator

valyala commented Aug 12, 2023

FYI, the bugfix has been included also into long-term support release v1.79.14.

@valyala
Copy link
Collaborator

valyala commented Aug 12, 2023

The bugfix has been also back-ported to long-term support release v1.87.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vmalert
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants