erick dagenais <[email protected]>
2:34 AM (10 hours ago)
to *Brian*
Hey Brian appreciate the answer,

**Copying over all message from direct message**

‘First, find some label or combination of labels which matches the process
memory to the associated node memory - in this case it might just be the
"instance" label.’


This is the exact problem I have though. Since I’m mixing metrics from
different exporters (in this case ‘node-exporter’ and ‘process-exporter’,
they have different output metrics, none which overlap in all of them.
Specifically, process-exporter doesn’t have a job or instance label.

This is where the dummy_label workaround came from. Since they are two
metrics with no intersection, I created a fake intersection, I guess in
your case a fake “instance” label named “dummy_label”.

The creation of the dummy label is exactly what I’m trying to avoid here.



On 03/10/2020 10:34, erick dagenais wrote:
> Specifically, process-exporter doesn’t have a job or instance label.

It *must* have both a job and an instance label, since prometheus adds
these labels itself.

https://prometheus.io/docs/concepts/jobs_instances/#automatically-generated-labels-and-time-series

**New Message**

Hey Brian,

You're right I should have looked into these labels more, looks like I was
summing without these labels to get rid of them.

https://www.robustperception.io/controlling-the-instance-label
The relabel config solution in this post is one solution I was looking for.
The other one would be to make node-exporter and process-exporter be
scraped under the same job, so that they have the same job label.
I'll have to look into which solution is preferred, if either.

I guess the real question I should have asked first, is why don't they have
any labels in common in the first place.

Thanks Brian for the help!



On Sat, Oct 3, 2020 at 2:13 AM Brian Candler <[email protected]> wrote:

> One other thing: to do this readily, you need to use "meaningful instance
> labels":
> https://www.robustperception.io/controlling-the-instance-label
>
> That is, rather than
>
> node_info{instance="foo:9100"}
> process_info{instance="foo:9256"}
>
> you need to record
>
> node_info{instance="foo"}
> process_info{instance="foo"}
>
> This is easy to arrange using relabelling at scrape time.  Set the
> instance label to what you want, and then set __address__ to the
> address:port.  Example:
>
>   - job_name: node
>     scrape_interval: 1m
>     scrape_timeout: 50s
>     file_sd_configs:
>       - files:
>         - /etc/prometheus/targets.d/node_targets.yml  # don't include the
> port number in here
>     metrics_path: /metrics
>     relabel_configs:
>       - source_labels: [__address__]
>         target_label: instance
>       - source_labels: [__address__]
>         target_label: __address__
>         replacement: '${1}:9100'
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/74c30936-b7c8-4d4e-825b-c320db295707o%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/74c30936-b7c8-4d4e-825b-c320db295707o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAFTp1BwwiTrY14nuyM6V_3%3DOj4b60HiYfSML3PMVQhQrM7qAnA%40mail.gmail.com.

Reply via email to