Thank you Brian,
Finally i use file_sd and its work!
Whoever have same question with me, here is the configuration that use :
*prometheus.yml - snippet *
scrape_configs:
- job_name: 'jmx'
file_sd_configs:
- files:
- jmx_targets.json
*jmx_targets.json - snippet*
[
{
"targets": ["xptcregosb01:8080"],
"labels": {
"instance": "WLS_OSB1",
"group": "CRS"
}
},
{
"targets": ["xptcregosb02:8080"],
"labels": {
"instance": "WLS_OSB2",
"group": "CRS"
}
}
]
Thanks,
Julian
On Friday, 10 April 2020 18:26:15 UTC+7, Brian Candler wrote:
>
> Use file_sd. It's the same as static_configs (i.e. list of
> targets+labels), but bundled into a separate file, which makes it easier to
> edit or generate. Also, prometheus picks up changes automatically without
> a HUP. It's true though that each group of targets will need to be
> configured with its weblogic instance.
>
> If you don't want to directly label the targets at scrape time, then make
> separate timeseries containing the mapping from instance <=> weblogic name,
> and then join on these other instances at query time. For example, using
> node_exporter and textfile_collector on each node, you can make each node
> *tell* prometheus what its weblogic instance name is.
>
> See:
>
> https://www.robustperception.io/how-to-have-labels-for-machine-roles
> https://www.robustperception.io/exposing-the-software-version-to-prometheus
>
> To make these joins possible, you want to keep the port number :8080 out
> of the instance label. See:
>
> https://www.robustperception.io/controlling-the-instance-label
>
--
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/af5a4071-2cec-4221-bbb5-10483f80b194%40googlegroups.com.