Re: [prometheus-users] Can prometheus detect the periodicity of a metric?

2023-04-18 Thread Stuart Clark
That's definitely something that can be done _using_ Prometheus, but not 
something done _within_ it.

You'd have an application which uses the query API (or is sent live data via 
remote write) to fetch metrics and then does whatever calculations are needed 
(for example using machine learning methods). You might then expose back new 
metrics to represent the outcome of those calculations (via scraping, remote 
read or remote write) which can then be used for visualisation and alerting.

Broadly what you are talking about is anomaly detection, which have a lot of 
ideas, PoCs, tools and blog articles created - you will find various ideas and 
ways to achieve such things from talks given at PromCon over the past years for 
example. 

On 17 April 2023 07:51:21 BST, "Jónás Jurásek"  wrote:
>I want to create alerts based on if a periodic signal(not perfectly 
>periodic) has changed significantly from its previous behaviour. For 
>example: A size of a table in a db is growing a certain amount every hour, 
>but then every day it goes back to the size it was a day before. I want to 
>alert if this table grew twice as much, or hasn't grown at all, or if if 
>doesn't go back to it's original size. But rather than me giving the 1 day 
>periodicity, I want prometheus to detect it, because different tables can 
>have different periods. 
>Is there any way to do that with prometheus? Or is the any other way to 
>detect the change of the behaviour?
>
>-- 
>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/efa79410-f645-4bea-b0d9-9a9afc153244n%40googlegroups.com.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
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/FAAF6777-9BC3-4D24-ABF4-A13BCCBE6436%40Jahingo.com.


Re: [prometheus-users] Custom metric timestamps

2023-04-18 Thread Stuart Clark
The timestamp feature is only really designed for limited situations, such as 
ingesting metrics from another metric system. Scraping is generally expected to 
be returning the metric value from "now" (or in the case of coming via another 
metric system within the last few minutes). As Prometheus is primarily a metric 
system for metrics around operational systems you want alerts to appear in a 
timely manner if issues occur.

Ingesting really old data is often needed to backfill metrics, but this is done 
via a different method to scraping.

Are you able to give a bit more insight around the ingestion of really old 
data? 

On 12 April 2023 08:55:39 BST, Ahmed Kooli  wrote:
>I am using theprometheus_client library on Python to monitor some metrics 
>and these were created in the past (months ago). When I fetch them with 
>Prometheus they are displayed at collection time and I would like to 
>specify a custom timestamp. I tried to create custom metrics and override 
>built-in functions to specify a timestamp but it seems to only work for a 
>short time shift (= custom timestamp - time at collection), does anyone 
>have an idea ? 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/92cceaaf-3dcf-4484-b490-97493e9f3203n%40googlegroups.com.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
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/73397A39-FC51-471A-A00E-B3FADAEA513A%40Jahingo.com.


[prometheus-users] Re: Step by Step Documentation needed for configuring SNMP on DELL N 2048 series Open manage switch for prometheus

2023-04-18 Thread Brian Candler
Prometheus doesn't handle snmp traps at all.  Traps are events, not 
metrics.  You will need some sort of NMS with a trap receiver.

On Tuesday, 18 April 2023 at 14:37:14 UTC+1 Ajay Kumar wrote:

> Hello Team 
>
> Greetings
>
> We need help on configuring the SNMP on DELL N 2048 series so that we can 
> receive the snmp traps on prometheus
>
>
>

-- 
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/02f31f2d-2216-43ba-80e6-e286652cf666n%40googlegroups.com.


[prometheus-users] Step by Step Documentation needed for configuring SNMP on DELL N 2048 series Open manage switch for prometheus

2023-04-18 Thread Ajay Kumar
Hello Team 

Greetings

We need help on configuring the SNMP on DELL N 2048 series so that we can 
receive the snmp traps on prometheus


-- 
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/0c209aac-2d10-416a-8fec-37f648032638n%40googlegroups.com.


[prometheus-users] Go client pushgateway delete by instance

2023-04-18 Thread Aaron Reisman
The Pushgateway's documentation includes the ability to delete all metrics 
for a given job and instance label.

curl -X DELETE 
http://pushgateway.example.org:9091/metrics/job/some_job/instance/some_instance

The Prometheus go client has support for making a pusher for a specific job 
label, but doesn't appear to have anywhere to specify the instance label. 
Does anyone know if there is a way, using the go library, to delete metrics 
for a specific job and instance label pair?

Thanks,
Aaron

-- 
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/6e8eadf6-cba1-4838-afce-1f0546805674n%40googlegroups.com.


[prometheus-users] Can prometheus detect the periodicity of a metric?

2023-04-18 Thread Jónás Jurásek
I want to create alerts based on if a periodic signal(not perfectly 
periodic) has changed significantly from its previous behaviour. For 
example: A size of a table in a db is growing a certain amount every hour, 
but then every day it goes back to the size it was a day before. I want to 
alert if this table grew twice as much, or hasn't grown at all, or if if 
doesn't go back to it's original size. But rather than me giving the 1 day 
periodicity, I want prometheus to detect it, because different tables can 
have different periods. 
Is there any way to do that with prometheus? Or is the any other way to 
detect the change of the behaviour?

-- 
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/efa79410-f645-4bea-b0d9-9a9afc153244n%40googlegroups.com.


[prometheus-users] Re: Observing CLOSE_WAIT connections when using JMX Exporter

2023-04-18 Thread Dan Gherman
Did you solve this? I know it's a very old message, but I'm facing similar 
issues.
Using jmx-exporter-javaagent version 0.2.0.
Thanks!

On Wednesday, July 7, 2021 at 3:50:12 AM UTC-4 Angelin Christina wrote:

> Hi ,
>
> We are using JMX exporter with Kafka and Prometheus to scrape the metrics. 
> When Kafka is on high load, JMX exporter takes long time to respond and 
> Prometheus scrape times out ending up in lots of CLOSE_WAIT sockets. 
>
> Is there any timeout that we can set on JMX exporter to clear those 
> sockets? 
> Or is there any alternate solution? 
>
> Thanks,
> Angelin
>

-- 
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/9c356c0b-b613-4ade--4d2d16d2986en%40googlegroups.com.


[prometheus-users] Custom metric timestamps

2023-04-18 Thread Ahmed Kooli
I am using theprometheus_client library on Python to monitor some metrics 
and these were created in the past (months ago). When I fetch them with 
Prometheus they are displayed at collection time and I would like to 
specify a custom timestamp. I tried to create custom metrics and override 
built-in functions to specify a timestamp but it seems to only work for a 
short time shift (= custom timestamp - time at collection), does anyone 
have an idea ? 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/92cceaaf-3dcf-4484-b490-97493e9f3203n%40googlegroups.com.


Re: [prometheus-users] file_cd_config - label for each target

2023-04-18 Thread Brian Candler
Alternatively, you use rewriting rules.

- targets:
  - SVR-DS01 172.25.X0.XXX
  - SRV-DS02 172.21.X1.XXX
... etc

and the corresponding relabel_configs in your scrape job could be something 
like this:

relabel_configs:
  # When __address__ consists of just a name or IP address,
  # copy it to the "instance" label.  This keeps the port
  # number out of the instance label.
  - source_labels: [__address__]
regex: '([^ ]+)'
target_label: instance

  # When __address__ is of the form "name address", extract
  # name to "instance" label and address to "__address__"
  - source_labels: [__address__]
regex: '(.+) (.+)'
target_label: instance
replacement: '${1}'
  - source_labels: [__address__]
regex: '(.+) (.+)'
target_label: __address__
replacement: '${2}'

  # Append port number to __address__ so that scrape gets
  # sent to the right port
  - source_labels: [__address__]
target_label: __address__
replacement: '${1}:9182'

On Tuesday, 18 April 2023 at 11:14:23 UTC+1 Julius Volz wrote:

> The labels in the SD file can only be provided for each target group (the 
> top-level list item type of the YAML file), so you'd have to do something 
> like this:
>
> - targets:
>   - [...first list of targets...]
>   labels:
> instance: "A"
> - targets:
>   - [...second list of targets...]
>   labels:
> instance: "B"
> - targets:
>   - [...third list of targets...]
>   labels:
> instance: "C"
>   
>
> On Tue, Apr 18, 2023 at 11:20 AM Kolja Krückmann  
> wrote:
>
>> Hi y'all I'm trying to get a label for each target in my file_sd_config
>>
>> my prom.yml is:
>> (redacted)
>>
>> # my global config
>> global:
>>   scrape_interval: 1m # Set the scrape interval to every 15 seconds. 
>> Default is every 1 minute.
>>   evaluation_interval: 30s # Evaluate rules every 15 seconds. The default 
>> is every 1 minute.
>>   scrape_timeout: 30s
>>
>> scrape_configs:
>>   # The job name is added as a label `job=` to any timeseries 
>> scraped from this config.
>>   - job_name: 'node'
>> file_sd_configs:
>>   - files:
>> - 
>> C:/Prometheus/prometheus-2.41.0.windows-amd64/target_cluster_b.yml
>>
>> my target_cluster_b.yml:
>> - targets:
>> - 172.25.X0.XXX:9182
>> labels:
>> instance: "SVR-DS01"
>> - 172.21.X1.XXX:9182   
>> - 172.25.X2.XXX:9182
>> - 172.25.X3.XXX:9182
>>
>> as seen in the target.yml I want to try to get a label to each target - 
>> to see in the prom dashboard which ip is which targetname
>>
>> Thanks in advance.
>> Kind regards Kolja
>>
>> -- 
>> 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-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/fa4e5c9e-807b-4680-9640-592c8172e568n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Julius Volz
> PromLabs - promlabs.com
>

-- 
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/efe049ba-a02b-407e-a842-8c6dd02bb5ean%40googlegroups.com.


Re: [prometheus-users] file_cd_config - label for each target

2023-04-18 Thread Julius Volz
The labels in the SD file can only be provided for each target group (the
top-level list item type of the YAML file), so you'd have to do something
like this:

- targets:
  - [...first list of targets...]
  labels:
instance: "A"
- targets:
  - [...second list of targets...]
  labels:
instance: "B"
- targets:
  - [...third list of targets...]
  labels:
instance: "C"


On Tue, Apr 18, 2023 at 11:20 AM Kolja Krückmann 
wrote:

> Hi y'all I'm trying to get a label for each target in my file_sd_config
>
> my prom.yml is:
> (redacted)
>
> # my global config
> global:
>   scrape_interval: 1m # Set the scrape interval to every 15 seconds.
> Default is every 1 minute.
>   evaluation_interval: 30s # Evaluate rules every 15 seconds. The default
> is every 1 minute.
>   scrape_timeout: 30s
>
> scrape_configs:
>   # The job name is added as a label `job=` to any timeseries
> scraped from this config.
>   - job_name: 'node'
> file_sd_configs:
>   - files:
> -
> C:/Prometheus/prometheus-2.41.0.windows-amd64/target_cluster_b.yml
>
> my target_cluster_b.yml:
> - targets:
> - 172.25.X0.XXX:9182
> labels:
> instance: "SVR-DS01"
> - 172.21.X1.XXX:9182
> - 172.25.X2.XXX:9182
> - 172.25.X3.XXX:9182
>
> as seen in the target.yml I want to try to get a label to each target - to
> see in the prom dashboard which ip is which targetname
>
> Thanks in advance.
> Kind regards Kolja
>
> --
> 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/fa4e5c9e-807b-4680-9640-592c8172e568n%40googlegroups.com
> 
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
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/CAObpH5z%2B%3DMLjoJ65Low1n5WyfA31iCJS8v3Og%3DYaodPh03mj6A%40mail.gmail.com.


[prometheus-users] file_cd_config - label for each target

2023-04-18 Thread Kolja Krückmann
Hi y'all I'm trying to get a label for each target in my file_sd_config

my prom.yml is:
(redacted)

# my global config
global:
  scrape_interval: 1m # Set the scrape interval to every 15 seconds. 
Default is every 1 minute.
  evaluation_interval: 30s # Evaluate rules every 15 seconds. The default 
is every 1 minute.
  scrape_timeout: 30s

scrape_configs:
  # The job name is added as a label `job=` to any timeseries 
scraped from this config.
  - job_name: 'node'
file_sd_configs:
  - files:
- C:/Prometheus/prometheus-2.41.0.windows-amd64/target_cluster_b.yml

my target_cluster_b.yml:
- targets:
- 172.25.X0.XXX:9182
labels:
instance: "SVR-DS01"
- 172.21.X1.XXX:9182   
- 172.25.X2.XXX:9182
- 172.25.X3.XXX:9182

as seen in the target.yml I want to try to get a label to each target - to 
see in the prom dashboard which ip is which targetname

Thanks in advance.
Kind regards Kolja

-- 
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/fa4e5c9e-807b-4680-9640-592c8172e568n%40googlegroups.com.