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

Promtool does not catch error #4825

Closed
dhbarman opened this Issue Nov 6, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@dhbarman
Copy link

dhbarman commented Nov 6, 2018

Proposal

Use case. Why is this important?

While upgrading Prometheus to 2.3.0 from 2.2.1, promtool does not catch the error.

Bug Report

What did you do?

Upgraded Prometheus to 2.3.0 which was earlier running 2.2.1. Config file and rules are as used before.

What did you expect to see?

Promtool should have caught the error.

What did you see instead? Under which circumstances?

Seeing warning messages. Note that we have been using the same config file and rules file (used in config file).

But promtool didn't report the error.

Environment

  • System information:

    Linux 4.1.12-124.19.7.el7uek.x86_64 x86_64

  • Prometheus version:

     prometheus, version 2.3.0 (branch: heads/v2.3.0, revision: 290d717)
     build user: teamcity@tca-hv07-agent039-default
     build date: 20181030-20:19:00
    go version: go1.11.1
    
  • Prometheus configuration file:

groups:
- name: interface_errors.rule.yml
  rules:
  - alert: FC_INTERFACE_INPUT_ERRORS_OVER_THRESHOLD
    expr: increase(ifInErrors{group=~"fc.*", ifAlias=~".+"}[2m]) > 1 and on(device, interface) (ifOperStatusNumeric == 1)
    for: 3m
    labels:
      component: Test Component
      item: Test Item
      project: TestProject
      severity: "2"
      interface: "{{ $labels.device }}:{{ $labels.interface }}"
    annotations:
      description: '{{ $labels.device }}:{{ $labels.interface }} {{ labels.ifAlias }}'
      summary: FC INTERFACE INPUT ERRORS OVER THRESHOLD device {{ $labels.device }} interface
        {{ $labels.interface }}
  • Logs:
level=warn ts=2018-10-30T23:44:04.575030231Z caller=alerting.go:220 component="rule manager" alert=FC_INTERFACE_INPUT_ERRORS_OVER_THRESHOLD msg="Expanding a
lert template failed" err="error parsing template __alert_FC_INTERFACE_INPUT_ERRORS_OVER_THRESHOLD: template: __alert_FC_INTERFACE_INPUT_ERRORS_OVE
R_THRESHOLD:1: function \"labels\" not defined" data="unsupported value type"
@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Nov 7, 2018

This is fixed in 2.5.0 (see #4537).

I'm closing it for now. If you have further questions, please use our user mailing list, which you can also search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.