[prometheus-users] Monitor specific application process in Linux

2020-05-19 Thread Juan Rosero
Hello,

I've been reading a lot on different sites and this User Group as well, but 
have not come up with a clear answer. I need to monitor a specific 
application process in Linux and verify if it's running and I've been 
reading about *--collector.processes* and enabling it on Node Exporter. 
Ideally, I would like to narrow down to that specific process instead of 
getting info on all running processes on the system. What's the best 
approach for this and correct syntax?

Many thanks!

-- 
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/00a0c828-6047-4cb7-a42a-2d6fa7b42d33%40googlegroups.com.


[prometheus-users] Re: Monitor specific application process in Linux

2020-05-19 Thread Juan Rosero
Thanks everyone! I'll exporte the options suggested and see what works 
best. Thanks again and have a great day/evening!

-- 
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/d14c32eb-3425-4832-960b-2e69d15bae44%40googlegroups.com.


[prometheus-users] Re: Monitor specific application process in Linux

2020-05-19 Thread Juan Rosero
Thanks everyone! I'll explore the options suggested and see what works 
best. Thanks again and have a great day/evening!

-- 
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/60e4b002-30cb-44b4-ba6e-5164bc8e4b63%40googlegroups.com.


[prometheus-users] Adding extra labels to metrics

2020-05-21 Thread Juan Rosero
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!


- job_name: apache_server
  static_configs:
  - 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: ""

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.


[prometheus-users] Re: Adding extra labels to metrics

2020-05-25 Thread Juan Rosero
Awesome! That worked! Thanks for everything. Leaving the solution here.

  - targets:
  - server1;ad-1;domain-1;emea-1
  - server2;ad-2;domain-2;emea-1
relabel_configs:
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'ad'
  replacement: '$2'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'dom'
  replacement: '$3'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'reg'
  replacement: '$4'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: '__address__'
  replacement: '$1:9117'


On Thursday, May 21, 2020 at 2:00:35 PM UTC-7, 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!
>
>
> - job_name: apache_server
>   static_configs:
>   - 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: ""
>
> 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/3a7b86ce-fa97-437d-a931-c48b17b3da96%40googlegroups.com.


[prometheus-users] Re: Adding extra labels to metrics

2020-05-26 Thread Juan Rosero
I see what you mean so I added it back into the mix. Thanks for the tip. 
Really appreciated.

  - targets:
  - server1;ad-1;domain-1;emea-1
  - server2;ad-2;domain-2;emea-1
relabel_configs:
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'instance'
  replacement: '$1'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'ad'
  replacement: '$2'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'dom'
  replacement: '$3'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'reg'
  replacement: '$4'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: '__address__'
  replacement: '$1:9117'

On Monday, May 25, 2020 at 11:00:33 PM UTC-7, Brian Candler wrote:
>
> Glad it's working!
>
> Note that if you add an extra step to set the "instance" label explicitly 
> (which you had originally), then this disables prometheus' default 
> behaviour of copying __address__ to instance.  Hence you can keep the port 
> number out of the instance label, whilst keeping it in the __address__ that 
> is scraped.
>

-- 
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/27c4da7f-86d8-4237-879f-79e5f087a094%40googlegroups.com.


[prometheus-users] Monitoring Tomcat and Alerting

2020-06-02 Thread Juan Rosero
Hello,

I need to monitor a Tomcat application and deployed the jmx_exporter with 
the tomcat.yml 

 sample 
file. I'm able to monitor the memory used and also would like to monitor 
the garbage collection, threads and classes, but I don't know how to go 
about it. Can someone advise please?

  - alert: JvmMemoryWarning
expr: jvm_memory_bytes_used{area="heap"} / 
jvm_memory_bytes_max{area="heap"} * 100 > 80
for: 5m
labels:
  severity: warning
annotations:
  summary: "JVM memory filling up on {{ $labels.instance }}"
  description: "JVM memory is over 80%."

Thank you,

-- 
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/f45f524c-f15d-4c97-af15-c51af8a562f8%40googlegroups.com.


Re: [prometheus-users] Adding extra labels to metrics

2020-05-24 Thread Juan Rosero
Thanks, Brian. I'm spinning my wheels here and getting all sorts of errors 
in Prometheus with different relabeling configurations. I've been reading 
on the topic but relabeling is still a bit obscure to me.

  - targets:
  - server1:9117;ad-1;domain-1;emea-1
  - server2:9117;ad-2;domain-2;emea-1
relabel_configs:
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'instance'
  replacement: '$1'
metric_relabel_configs:
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'ad'
  replacement: '$2'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'dom'
  replacement: '$3'
- source_labels: ['__address__']
  regex: '(.*);(.*);(.*);(.*)'
  target_label: 'reg'
  replacement: '$4'



On Friday, May 22, 2020 at 11:46:28 PM UTC-7, Brian Candler wrote:
>
> It depends where the 'ad', 'dom', 'reg' information comes from.  You can 
> embed that information in the target, e.g.
>
> - targets:
> - server1:9117/ad-1/domain-1/emea-1
> - server2:9117/ad-2/domain-2/emea-1
>
> and then use rewriting rules to extract each of the parts in turn into 
> separate labels.  But to my eye that's less clear than doing the simple 
> thing already suggested.
>
> There's a more compact way of writing YAML if you prefer:
>
> - targets: [server1:9117]
>   labels: {ad: ad-1, dom: domain-1, reg: emea-1}
>
> - targets: [server2:9117]
>   labels: {ad: ad-2, dom: domain-2, reg: emea-1}
>
>

-- 
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/6c204ffe-8f79-4d6e-9442-cbc859d6b5fa%40googlegroups.com.


Re: [prometheus-users] Adding extra labels to metrics

2020-05-22 Thread Juan Rosero
Thanks, Julien. I'm wondering if there is way to do this with relabeling. 
Thank you.

On Thursday, May 21, 2020 at 2:04:57 PM UTC-7, Julien Pivotto wrote:
>
> 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: "aaa" 
>- targets: ["server2:9117", "server3:9117"] 
>  labels: 
>env: "int" 
>dom: "bb" 
> > 
> > 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 promethe...@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/4e98020d-4311-41bc-9d7d-f6d6a34d5f1b%40googlegroups.com.