Hi,

On 21 May 14:00, Juan Rosero wrote:
> Hello,
> 
> I'm trying to add location labels to my Apache Exporter metrics and other 
> exporters that don't expose them when Prometheus scrapes them from the 
> server nodes. Here is my Prometheus job and the labels (ad, dom, reg) that 
> I'm looking to add depending on the server location. Please let me know if 
> it's possible to be added on the exporter end or maybe in Prometheus while 
> it ingest those metrics. Many thanks!
> 
> 

version is a metric of the exporter: apache_version
app should be the job name, then the job label

> - job_name: apache_server
>   - targets: ["server1:9117", "server2:9117", "server3:9117", 
> "server4:9117", "server5:9117", "server6:9117",]
>     labels:
>       env: "int"
>       app: "apache"
>       version: "2.4.43"
>       ad: ""
>       dom: ""
>       reg: ""


then, static_configs is a list:

   static_configs:
   - targets: ["server1:9117", "server2:9117"]
     labels:
       env: "int"
       dom: "aaaaaaa"
   - targets: ["server2:9117", "server3:9117"]
     labels:
       env: "int"
       dom: "bbbbbb"
> 
> Here how I'm looking for the metrics to look like:
> {env="int", ad="ad-1", dom="domain-1", reg="emea-1", 
> instance="server1:9117", app="apache", version="2.4.43"}
> (env="int", ad="ad-2", dom="domain-2", reg="emea-1", 
> instance="server2:9117", app="apache", version="2.4.43"}
> (env="int", ad="ad-3", dom="domain-1", reg="emea-1", 
> instance="server3:9117", app="apache", version="2.4.43"}
> (env="int", ad="ad-3", dom="domain-1", reg="emea-1", 
> instance="server4:9117", app="apache", version="2.4.43"}
> (env="int", ad="ad-3", dom="domain-2", reg="emea-1", 
> instance="server5:9117", app="apache", version="2.4.43"}
> (env="int", ad="ad-3", dom="domain-1", reg="emea-1", 
> instance="server6:9117", app="apache", version="2.4.43"}
> 
> -- 
> 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 prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/prometheus-users/c2a3ab04-405c-4e79-a332-0ac2f02aa1d9%40googlegroups.com.

regards,

-- 
Julien Pivotto
@roidelapluie

-- 
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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/20200521210452.GA383890%40oxygen.

Reply via email to