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

Alertmanager doesn't template pagerduty service key #1168

Closed
zeeshen opened this issue Dec 25, 2017 · 2 comments
Closed

Alertmanager doesn't template pagerduty service key #1168

zeeshen opened this issue Dec 25, 2017 · 2 comments

Comments

@zeeshen
Copy link

zeeshen commented Dec 25, 2017

What did you do?
Send alerts to pagerduty via alertmanager

What did you expect to see?
Send alerts

What did you see instead? Under which circumstances?

level=error ts=2017-12-25T09:11:28.340342692Z caller=dispatch.go:266 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="cancelling notify retry for \"pagerduty\" due to unrecoverable error: unexpected status code 400"

Environment

  • System information:

    Linux 3.13.0-48-generic x86_64

  • Alertmanager version:

alertmanager, version 0.12.0 (branch: HEAD, revision: fc33cc78036f82ef8d4734c197a96f7cb6c952a3)
  build user:       root@c9169eb10d06
  build date:       20171215-14:13:20
  go version:       go1.9.2
  • Alertmanager configuration file:
...
- name: 'pd-application'
  pagerduty_configs:
    - send_resolved: true
      service_key: '{{ template "pagerduty.XXX.app_key" . }}'
  • Logs:
level=error ts=2017-12-25T09:11:28.340342692Z caller=dispatch.go:266 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="cancelling notify retry for \"pagerduty\" due to unrecoverable error: unexpected status code 400

I think this 400 is caused by this commit. In pagerduty api v1 implement, the ServiceKey is template-expanded but the new implement does't expand it. Same for RoutingKey field.

And according to docs, this service_key should be a tmpl_secret field. Besides, in pagerduty faq, it's API V1 not Event API v1 that will be deprcated. So many people may still use this ServiceKey field.

stuartnelson3 added a commit that referenced this issue Jan 8, 2018
The tmpl() call was removed when migrating to
support pd v2 events api.
stuartnelson3 added a commit that referenced this issue Jan 8, 2018
The tmpl() call was removed when migrating to
support pd v2 events api.
@reachlin
Copy link

@zeeshen could you tell me what is pagerduty.XXX.app_key and where you define this?

@zeeshen
Copy link
Author

zeeshen commented Oct 31, 2018

@reachlin pagerduty.XXX.app_key is just template that defined in my customer template files.

hh pushed a commit to ii/alertmanager that referenced this issue Nov 30, 2018
* Update CHANGELOG
* Update VERSION

Signed-off-by: Ben Kochie <superq@gmail.com>
hh pushed a commit to ii/alertmanager that referenced this issue Nov 30, 2018
* collector/diskstats: don't fail if there are extra stats, just ignore… (prometheus#1125)

* collector/diskstats: don't fail if there are extra stats, just ignore them

Signed-off-by: Paul Gier <pgier@redhat.com>
Signed-off-by: Ben Kochie <superq@gmail.com>

* collector/hwmon_linux: handle temperature sensor file which doesn't have item suffix (prometheus#1123)

In some cases the file might be called "temp" instead of the usual format "temp<index>_<item>"
as described in the kernel docs: https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
In this case, treat this as an _input file containing the current temperature reading.

Fixes prometheus#1122

Signed-off-by: Paul Gier <pgier@redhat.com>
Signed-off-by: Ben Kochie <superq@gmail.com>

* Handle 'Unknown' as measurement value. (prometheus#1113)

We use the output-compatible perccli and storcli.py does not handle 'Unknown' as a result:
```
sg="Error parsing \"/var/lib/node_exporter/perccli.prom\": text format parsing error in line 222: expected float as value, got \"Unknown\"" source="textfile.go:212"
```
I know, the perccli should not return 'Unknown' but this error breaks all other useful measurements because the prom file is not parsable. My if condition fixes this.

Signed-off-by: Andreas Wirooks <4233401+nudgegoonies@users.noreply.github.com>
Signed-off-by: Ben Kochie <superq@gmail.com>

* circleci: switch to 2.1 config

Signed-off-by: Ben Kochie <superq@gmail.com>

* Convert to Go modules (prometheus#1178)

* Convert to Go modules

* Update promu config.
* Convert to Go modules.
* Update vendoring.
* Update Makefile.common.
* Update circleci config.
* Use Prometheus release tar for promtool.
* Fixup unpack

* Use temp dir for unpacking tools.
* Use BSD compatible tar command.
* OpenBSD mkdir doesn't support `-v`.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add fallback for missing /proc/1/mounts (prometheus#1172)

* Add fallback for missing /proc/1/mounts

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add tests.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add CHANGELOG entry.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Release v0.17.0 (prometheus#1168)

* Update CHANGELOG
* Update VERSION

Signed-off-by: Ben Kochie <superq@gmail.com>
hh pushed a commit to ii/alertmanager that referenced this issue Dec 3, 2018
* Update CHANGELOG
* Update VERSION

Signed-off-by: Ben Kochie <superq@gmail.com>
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

No branches or pull requests

3 participants