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

no label attached for metrics #2633

Closed
reachlin opened this Issue Apr 18, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@reachlin
Copy link

reachlin commented Apr 18, 2017

What did you do?
defined labels for a static_configs

What did you expect to see?
labels attached to metrics scraped

What did you see instead? Under which circumstances?
no labels defined by me, only default labels

Environment

  • System information:

    run in a docker

  • Prometheus version:

lincai@pdbuddy:~/go/src/github.ibm.com/alchemy-containers/armada-ops-prom2graphite$ docker exec -it prometheus prometheus -version
prometheus, version 1.5.2 (branch: master, revision: bd1182d29f462c39544f94cc822830e1c64cf55b)
  build user:       root@1a01c5f68840
  build date:       20170210-16:23:28
  go version:       go1.7.5
  • Alertmanager version:

    n/a

  • 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: 'codelab-monitor'

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first.rules"
  # - "second.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: 'prom2graphite'
    static_configs:
      - targets: ['ip:9102']
      - labels:
          group: 'g1'

  • Alertmanager configuration file:
n/a
  • Logs:
n/a
@reachlin

This comment has been minimized.

Copy link
Author

reachlin commented Apr 18, 2017

2017-04-18 4 31 08

@Conorbro

This comment has been minimized.

Copy link
Contributor

Conorbro commented Apr 18, 2017

If you change your syntax for the target slightly then the label should appear:

static_configs:
- targets:
    - 'ip:9102'
  labels:
    group: 'g1'
@reachlin

This comment has been minimized.

Copy link
Author

reachlin commented Apr 19, 2017

@Conorbro thanks.

@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.