Re: [prometheus-users] server uptime

2023-02-17 Thread Julius Volz
Assuming you are monitoring your servers via something like the Node
Exporter, and you want the trailing 30-day upness percentage, you could use
the Node Exporters "up" metric like this:

avg_over_time(up{job="node"}[30d]) * 100

This is assuming that the scrape interval is not changing over those 30d,
as otherwise you would be weighting some periods (the ones with a higher
scrape frequency) more than others.

On Fri, Feb 17, 2023 at 5:25 AM sri L  wrote:

> Hi all,
>
> I am looking for server uptime percentage metrics on a monthly basis
> Example: If server is down for 60hrs out of 720hrs of a month the uptime
> has to show 91.66% in dashboard
>
> Please suggest if you have a relevant expression to serve this purpose
>
> 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/e34b891c-a5ea-43c8-b567-83588354f831n%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/CAObpH5yQLYm-o-WCucJSB9i2vO2Ah2Br7fKdc8hbbd2vTC2qUg%40mail.gmail.com.


Re: [prometheus-users] targetmissing alert is fooled by two endpoints on one job

2023-02-17 Thread Stuart Clark

On 17/02/2023 16:16, Mario Cornaccini wrote:

hi,

i have a job 'node-tools'ansible',
with two endpoints.. one for each node- and shell exporter.

in prometheus/targets i see the same set of labels for each endpoint.

for testing i stoppped the node exporter, but the alert is based on 
the following expr:

up{} == 0

on the graph i can see that the up{}==0 expr has value 0 for a few 
seconds, then gaps;

when i remove the ==0 i can see it goes from 0 to 1.

so it seems to me that the other (shell) exporter mixes into the up 
metric;

and that is because the endpoint have the same labels, right ?

so in my scrape defintion i need to specify one differing label for 
the shell exporter..

i could make an exporter label, setting it to 'node'/'shell' i guess..
or how do you guys handle that?

They can't have identical labels. Even if the job label is the same the 
instance label should be different.


--
Stuart Clark

--
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/9c013f7c-ab3f-b33b-f972-d5507e2536ad%40Jahingo.com.


[prometheus-users] targetmissing alert is fooled by two endpoints on one job

2023-02-17 Thread Mario Cornaccini
hi,

i have a job 'node-tools'ansible',
with two endpoints.. one for each node- and shell exporter.

in prometheus/targets i see the same set of labels for each endpoint.

for testing i stoppped the node exporter, but the alert is based on the 
following expr:
up{} == 0

on the graph i can see that the up{}==0 expr has value 0 for a few seconds, 
then gaps;
when i remove the ==0 i can see it goes from 0 to 1.

so it seems to me that the other (shell) exporter mixes into the up metric;
and that is because the endpoint have the same labels, right ?

so in my scrape defintion i need to specify one differing label for the 
shell exporter..
i could make an exporter label, setting it to 'node'/'shell' i guess..
or how do you guys handle that?

TIA; cheers,
fil

-- 
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/837281e4-1ab7-4931-8795-b5b4a52aa378n%40googlegroups.com.


Re: [prometheus-users] Can't access specific metrics

2023-02-17 Thread 'Morgan WAHBI' via Prometheus Users
Good catch my friend.

We were not scraping prometheus itself. i added the localhost:9090 as 
target and i have my metrics !

Thanks again.

Le vendredi 17 février 2023 à 14:50:44 UTC+1, Morgan WAHBI a écrit :

> Hi !
>
> Thanks for quick answer i will check the targets and come back here ! ty
>
> Le vendredi 17 février 2023 à 14:40:22 UTC+1, sayf eddine Hammemi a écrit :
>
>> Prometheus does not implement any multi-tenancy to prevent you from 
>> accessing such metrics, you are in one of the following case
>> - Prometheus is not scraping itself (meta monitoring), in that case you 
>> need to add prometheus as target
>> - These metrics are intentionally dropped in the prometheus configuration
>> - You have another system on top of Prometheus that is applying access 
>> policies
>>
>> The first one is the most probable
>>
>> On Fri, Feb 17, 2023 at 2:02 PM 'Morgan WAHBI' via Prometheus Users <
>> promethe...@googlegroups.com> wrote:
>>
>>> Hi guys,
>>>
>>> on the prometheus server's of my company i can't access to the metrics 
>>> to estimate the disk used for a month
>>>
>>> so i can't access all prometheus_tsdb_* like
>>>
>>> prometheus_tsdb_head_samples_appended_total
>>>
>>> i was trying this command
>>> 2592000* (rate(prometheus_tsdb_head_samples_appended_total[1d]) *
>>> (rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d]) / 
>>> rate(prometheus_tsdb_compaction_chunk_samples_sum[1d])))
>>>
>>> I precise that im not admin of the platform maybe this metrics are 
>>> available just when you are admin? 
>>>
>>> If you have any idea, im interested to dive in
>>>
>>> Ty
>>> morgan
>>>
>>>
>>> -- 
>>> 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/663266ea-fe64-4871-a63e-0538eacd001en%40googlegroups.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/5ce545c9-e8d5-4d96-ac15-13c2f4f1a913n%40googlegroups.com.


Re: [prometheus-users] Can't access specific metrics

2023-02-17 Thread 'Morgan WAHBI' via Prometheus Users
Hi !

Thanks for quick answer i will check the targets and come back here ! ty

Le vendredi 17 février 2023 à 14:40:22 UTC+1, sayf eddine Hammemi a écrit :

> Prometheus does not implement any multi-tenancy to prevent you from 
> accessing such metrics, you are in one of the following case
> - Prometheus is not scraping itself (meta monitoring), in that case you 
> need to add prometheus as target
> - These metrics are intentionally dropped in the prometheus configuration
> - You have another system on top of Prometheus that is applying access 
> policies
>
> The first one is the most probable
>
> On Fri, Feb 17, 2023 at 2:02 PM 'Morgan WAHBI' via Prometheus Users <
> promethe...@googlegroups.com> wrote:
>
>> Hi guys,
>>
>> on the prometheus server's of my company i can't access to the metrics to 
>> estimate the disk used for a month
>>
>> so i can't access all prometheus_tsdb_* like
>>
>> prometheus_tsdb_head_samples_appended_total
>>
>> i was trying this command
>> 2592000* (rate(prometheus_tsdb_head_samples_appended_total[1d]) *
>> (rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d]) / 
>> rate(prometheus_tsdb_compaction_chunk_samples_sum[1d])))
>>
>> I precise that im not admin of the platform maybe this metrics are 
>> available just when you are admin? 
>>
>> If you have any idea, im interested to dive in
>>
>> Ty
>> morgan
>>
>>
>> -- 
>> 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/663266ea-fe64-4871-a63e-0538eacd001en%40googlegroups.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/875dca79-f6f8-4a79-a2b9-2f6b03a86060n%40googlegroups.com.


Re: [prometheus-users] Can't access specific metrics

2023-02-17 Thread sayf eddine Hammemi
Prometheus does not implement any multi-tenancy to prevent you from
accessing such metrics, you are in one of the following case
- Prometheus is not scraping itself (meta monitoring), in that case you
need to add prometheus as target
- These metrics are intentionally dropped in the prometheus configuration
- You have another system on top of Prometheus that is applying access
policies

The first one is the most probable

On Fri, Feb 17, 2023 at 2:02 PM 'Morgan WAHBI' via Prometheus Users <
prometheus-users@googlegroups.com> wrote:

> Hi guys,
>
> on the prometheus server's of my company i can't access to the metrics to
> estimate the disk used for a month
>
> so i can't access all prometheus_tsdb_* like
>
> prometheus_tsdb_head_samples_appended_total
>
> i was trying this command
> 2592000* (rate(prometheus_tsdb_head_samples_appended_total[1d]) *
> (rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d]) /
> rate(prometheus_tsdb_compaction_chunk_samples_sum[1d])))
>
> I precise that im not admin of the platform maybe this metrics are
> available just when you are admin?
>
> If you have any idea, im interested to dive in
>
> Ty
> morgan
>
>
> --
> 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/663266ea-fe64-4871-a63e-0538eacd001en%40googlegroups.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/CALnV8Wiy4eRswk3z%2Bh4veeg8dj7oJv8UGev0L0AVOcJUwFy1Jg%40mail.gmail.com.


[prometheus-users] Can't access specific metrics

2023-02-17 Thread 'Morgan WAHBI' via Prometheus Users
Hi guys,

on the prometheus server's of my company i can't access to the metrics to 
estimate the disk used for a month

so i can't access all prometheus_tsdb_* like

prometheus_tsdb_head_samples_appended_total

i was trying this command
2592000* (rate(prometheus_tsdb_head_samples_appended_total[1d]) *
(rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d]) / 
rate(prometheus_tsdb_compaction_chunk_samples_sum[1d])))

I precise that im not admin of the platform maybe this metrics are 
available just when you are admin? 

If you have any idea, im interested to dive in

Ty
morgan


-- 
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/663266ea-fe64-4871-a63e-0538eacd001en%40googlegroups.com.


[prometheus-users] Re: prometheus actuator integration with springboot

2023-02-17 Thread Prashant Singh
my pom.xml

   

 org.springframework.boot

 spring-boot-starter-actuator

   

-



io.micrometer

micrometer-registry-prometheus

   

application.proprties:

Management.endpoints.web.exposure.include=*

Management.endpoint.health.show.details=always
management.server.port=9090
management.server.ssl.enabled=false


after retstart spring boot.

*getting error :  accessing  actuator endpoint : 
http://localhost:9090/actuator*

*403 forbiden /actuator*


thanks,
Prashant 
On Friday, February 17, 2023 at 1:45:30 PM UTC+5:30 Prashant Singh wrote:

> spring boot application with TLS . 
> need your support for what actuator code will be add with TLS .
> pom.xml and application.properties. 
>
> springboot application running with port 7499 with TLS(SSL)
>
>
>
>
> thanks.
> prashant 
>

-- 
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/1f7509bf-030b-46d5-bca2-6c93960dd8fan%40googlegroups.com.


[prometheus-users] prometheus actuator integration with springboot

2023-02-17 Thread Prashant Singh
spring boot application with TLS . 
need your support for what actuator code will be add with TLS .
pom.xml and application.properties. 

springboot application running with port 7499 with TLS(SSL)




thanks.
prashant 

-- 
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/e7f2ee41-986f-440e-9700-99e2bc045a57n%40googlegroups.com.