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

can't pass alertmanager url to prometheus 2.0.0 #3201

Closed
kanewinter opened this Issue Sep 21, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@kanewinter
Copy link

kanewinter commented Sep 21, 2017

What did you do?

Per: https://prometheus.io/docs/operating/configuration/#

<alertmanager_config>
Sep 21 01:00:54 prometheus prometheus[1515]: time="2017-09-21T01:00:54Z" level=error msg="Error loading config: couldn't load configuration (--config.file=prometheus.yml): unknown fields in config: alertmanager_config" source="main.go:279"

And other docs
[root@prometheus prometheus]# ./prometheus --alertmanager.url
prometheus: error: unknown long flag '--alertmanager.url'
[root@prometheus prometheus]# ./prometheus -alertmanager.url
prometheus: error: unknown short flag '-a'

What did you expect to see?
a successful connection to the alertmanager

There does not seem to be a way to connect prometheus to alertmanager.

Environment

  • System information:

[root@prometheus prometheus]# uname -srm
Linux 3.10.0-693.2.2.el7.x86_64 x86_64

  • Prometheus version:

    insert output of prometheus -version here
    [root@prometheus prometheus]# ./prometheus -version
    prometheus: error: unknown short flag '-v'

  • Alertmanager version:

[root@prometheus alertmanager]# ./alertmanager -version
alertmanager, version 0.8.0 (branch: HEAD, revision: 74e7e48d24bddd2e2a80c7840af9b2de271cc74c)
build user: root@439065dc2905
build date: 20170720-14:14:06
go version: go1.8.3

  • Prometheus configuration file:
# my global config
global:
#  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
#  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
      monitor: 'miner-monitor'

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
    - miner.rules

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'miner-monitor'
    static_configs:
      - targets: ['localhost:7979']

alertmanager_config:
  static_configs:
    targets: ['localhost:9093']

  • Alertmanager configuration file:
[root@prometheus alertmanager]# cat simple.yml | grep -v '#' | grep -v '^$'
global:
  smtp_smarthost: 'localhost:25'
  smtp_from: 'alertmanager@example.org'
  smtp_auth_username: 'alertmanager'
  smtp_auth_password: 'password'
  hipchat_auth_token: '1234556789'
  hipchat_url: 'https://hipchat.foobar.org/'
templates: 
- '/etc/alertmanager/template/*.tmpl'
route:
  group_by: ['alertname', 'cluster', 'service']
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 3h 
  receiver: kane
  routes:
inhibit_rules:
- source_match:
    severity: 'critical'
  target_match:
    severity: 'warning'
  equal: ['alertname', 'cluster', 'service']
receivers:
- name: 'kane'
  email_configs:
  - to: 'x653shuyzavc+2@nmamail.net'
- name: 'team-X-mails'
  email_configs:
  - to: 'team-X+alerts@example.org'
- name: 'team-X-pager'
  email_configs:
  - to: 'team-X+alerts-critical@example.org'
  pagerduty_configs:
  - service_key: <team-X-key>
- name: 'team-Y-mails'
  email_configs:
  - to: 'team-Y+alerts@example.org'

  • Logs:
insert Prometheus and Alertmanager logs relevant to the issue here
@JorritSalverda

This comment has been minimized.

Copy link
Contributor

JorritSalverda commented Sep 21, 2017

In version 2 the urls towards your alertmanager(s) have moved from a flag towards the config file. In our case it looks like this:

    # alert managers
    alerting:
      alertmanagers:
      - scheme: http
        static_configs:
        - targets:
          - "alertmanager-0.alertmanager-headless:9093"
          - "alertmanager-1.alertmanager-headless:9093"
          - "alertmanager-2.alertmanager-headless:9093"
@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Sep 21, 2017

What @JorritSalverda said. The flag has already been deprecated in 1.x for a while now and for 2.0 we removed it entirely.

@fabxc fabxc closed this Sep 21, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

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