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

custom labels and up timeseries #4917

Open
nfrush opened this Issue Nov 26, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@nfrush
Copy link

nfrush commented Nov 26, 2018

Bug Report

What did you do?
Added a metric_relabel_config to take values out of my instance name corresponding to the relative location and though it into a "rack" and "server" tag. When I queries the up timeseries, there is no such label on the series (on any sampling series provided by Prometheus). Not sure if this is intended behavior. Note ona ny other collected metrics, these labels appear.

What did you expect to see?

The presence of the label on the up timeseries so that I could issue up({rack="some-rack"}) and get a report on how many machines within a rack we're up (or down). This also provides an ease for alerting if a rack goes down later on

What did you see instead? Under which circumstances?
The series up does not contain the custom labels as expected.

Environment

  • System information:

    Centos 6.6

  • Prometheus version:

    2.3.2

  • Alertmanager version:

    0.15.1

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Nov 26, 2018

Please share your configuration.

@nfrush

This comment has been minimized.

Copy link
Author

nfrush commented Nov 26, 2018

@simonpasquier That's not exactly possible. I can provide you a configuration that is "like" what I'm using in the codebase.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Nov 27, 2018

@nfrush sure

@learon

This comment has been minimized.

Copy link

learon commented Dec 21, 2018

Same issue here:

Prometheus version: 2.5.0

Config:

- job_name: node_exporter
metric_relabel_configs:
- source_labels: ['instance']
  action: replace
  regex: '([^:]+):\d+'
  replacement: $1
  target_label: 'instance'
scrape_interval: 10s
static_configs:
- targets: ['server-1:2100']
  labels: {location: 'xx', type: 'xx', endpoint: 'xx'}
- targets: ['server-2:2100']
  labels: {location: 'xx', type: 'xx', endpoint: 'xx'}

Result:
screenshot_2

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Dec 21, 2018

This is working as expected, metric_relabel_configs only applies to scraped metrics. You want relabel_configs.

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.