Re: [prometheus-users] Thanos deployment.

2020-05-07 Thread piyush sharma
Hi Saurabh

Helm chart is available for Thanos deployment
You can use that

On Fri, 8 May, 2020, 9:58 am Saurabh Jain, 
wrote:

> Hi Julius,
>
> Thanks for the response.
>
> Thanos setup contains only one file when downloaded from github. How
> individual components will be deployed.
>
> Is it to use same file along with different .yaml file to deploy different
> components 
>
> Pls advice.
>
> Thanks,
> Saurabh
>
> On Friday, May 8, 2020 at 3:22:29 AM UTC+5:30, Julius Volz wrote:
>>
>> Hi,
>>
>> What do you mean with "or we have to use images only"?
>>
>> You can deploy Thanos components individually, yes. For example, you
>> could start out by just deploying the sidecar component that backs up
>> Prometheus data at first. Later, you could add the querier component that
>> gives you an integrated view over data from multiple Prometheus servers.
>> And then later again, the store gateway and compactor for reading back data
>> from long-term storage and managing it.
>>
>> Cheers,
>> Julius
>>
>> On Thu, May 7, 2020 at 2:00 PM Saurabh Jain  wrote:
>>
>>>
>>> Hi Guys,
>>>
>>> Need your support in implementing Thanos in our environment.
>>>
>>> Is it possible to deploy thanos components individually or we have to
>>> use images only.
>>>
>>> Pls share any document, if available.
>>>
>>> Thanks,
>>> Saurabh
>>>
>>> --
>>> 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/558f8127-50fd-4d15-9317-baac5fa0d75a%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/29991802-0ccb-4e77-b602-8b488633579e%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/CAPz289sUzLM0XpGR%3D2xp0cLKzwKBH4F76U9Qh4GvqdqDmaaxoQ%40mail.gmail.com.


Re: [prometheus-users] Thanos deployment.

2020-05-07 Thread Saurabh Jain
Hi Julius,

Thanks for the response.

Thanos setup contains only one file when downloaded from github. How 
individual components will be deployed. 

Is it to use same file along with different .yaml file to deploy different 
components 

Pls advice.

Thanks,
Saurabh

On Friday, May 8, 2020 at 3:22:29 AM UTC+5:30, Julius Volz wrote:
>
> Hi,
>
> What do you mean with "or we have to use images only"?
>
> You can deploy Thanos components individually, yes. For example, you could 
> start out by just deploying the sidecar component that backs up Prometheus 
> data at first. Later, you could add the querier component that gives you an 
> integrated view over data from multiple Prometheus servers. And then later 
> again, the store gateway and compactor for reading back data from long-term 
> storage and managing it.
>
> Cheers,
> Julius
>
> On Thu, May 7, 2020 at 2:00 PM Saurabh Jain  > wrote:
>
>>
>> Hi Guys,
>>
>> Need your support in implementing Thanos in our environment.
>>
>> Is it possible to deploy thanos components individually or we have to use 
>> images only.
>>
>> Pls share any document, if available.
>>
>> Thanks,
>> Saurabh
>>
>> -- 
>> 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/558f8127-50fd-4d15-9317-baac5fa0d75a%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/29991802-0ccb-4e77-b602-8b488633579e%40googlegroups.com.


[prometheus-users] cluster.peer update in alertmanager -Prometheus operator

2020-05-07 Thread Radha R4
I am getting below error ,
State:   Waiting
  Reason:CrashLoopBackOff
Last State:  Terminated
  Reason:Error
  Message:   level=info ts=2020-05-08T00:12:12.177Z caller=main.go:231 
msg="Starting Alertmanager" version="(version=0.20.0, branch=HEAD, 
revision=f74be0400a6243d10bb53812d6fa408ad71ff32d)"
level=info ts=2020-05-08T00:12:12.177Z caller=main.go:232 
build_context="(go=go1.13.5, user=root@00c3106655f8, 
date=20191211-14:13:14)"
level=warn ts=2020-05-08T00:12:12.273Z caller=cluster.go:228 
component=cluster msg="failed to join cluster" err="1 error occurred:\n\t* 
Failed to resolve 
alertmanager-prometheus-operator-alertmanager-0.alertmanager-operated.kube-system.svc:9094:
 
lookup 
alertmanager-prometheus-operator-alertmanager-0.alertmanager-operated.kube-system.svc
 
on 172.20.0.10:53: no such host\n\n"
level=info ts=2020-05-08T00:12:12.273Z caller=cluster.go:230 
component=cluster msg="will retry joining cluster every 10s"
level=warn ts=2020-05-08T00:12:12.273Z caller=main.go:322 msg="unable to 
join gossip mesh" err="1 error occurred:\n\t* Failed to resolve 
alertmanager-prometheus-operator-alertmanager-0.alertmanager-operated.kube-system.svc:9094:
 
lookup 
alertmanager-prometheus-operator-alertmanager-0.alertmanager-operated.kube-system.svc
 
on 172.20.0.10:53: no such host\n\n"


*I want to know how to update the alert manager service name in this below 
config of prometheus operator,*
   Args:
  --config.file=/etc/alertmanager/config/alertmanager.yaml
  --cluster.listen-address=[$(POD_IP)]:9094
  --storage.path=/alertmanager
  --data.retention=120h
  --web.listen-address=:9093
  
--web.external-url=http://prometheus-operator-alertmanager.kube-system:9093
  --web.route-prefix=/
  
--cluster.peer=alertmanager-prometheus-operator-alertmanager-0.alertmanager-operated.kube-system.svc:9094

Here is my service:
prometheus-operator-alertmanager   ClusterIP   172.20.124.167   
9093/TCP   10m

-- 
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/690aa1c7-d86c-4885-99a7-213cfb4acf68%40googlegroups.com.


Re: [prometheus-users] Thanos deployment.

2020-05-07 Thread Julius Volz
Hi,

What do you mean with "or we have to use images only"?

You can deploy Thanos components individually, yes. For example, you could
start out by just deploying the sidecar component that backs up Prometheus
data at first. Later, you could add the querier component that gives you an
integrated view over data from multiple Prometheus servers. And then later
again, the store gateway and compactor for reading back data from long-term
storage and managing it.

Cheers,
Julius

On Thu, May 7, 2020 at 2:00 PM Saurabh Jain 
wrote:

>
> Hi Guys,
>
> Need your support in implementing Thanos in our environment.
>
> Is it possible to deploy thanos components individually or we have to use
> images only.
>
> Pls share any document, if available.
>
> Thanks,
> Saurabh
>
> --
> 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/558f8127-50fd-4d15-9317-baac5fa0d75a%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/CA%2BT6Yoxme1k74Y0BAreeiP_%2BcTT18260frQAakqs_y%2BRHagygA%40mail.gmail.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
On Thursday, 7 May 2020 17:54:47 UTC+1, piyush sharma wrote:
>
> Hey 
>
> I have a query like this 
>
> if  sum by (locale) ( expression1)/sum by (locale) ( expression2) >=0
>
> This gives me no data points and hence a broken graph 
>
>
Looks like a reasonable expression (without the "if" on the front).  Always 
check operator precedence 

 
(or add extra parentheses), but that looks OK: "/" binds more tightly than 
">="

The way I'd recommend debugging this is to run the two parts of the query 
separately in the PromQL web interface:

sum by (locale) ( expression1)
sum by (locale) ( expression2)

Use the "console" view.  Check if these two sub-expressions both generate 
results.  Check if they both have the same set of labels - which of course 
should be "locale" in this case - because a bare "/" will only combine LHS 
and RHS values with exactly the same label set.

If you want further help, you should show your *actual* query expression, 
and some examples of the *actual* metrics you are working on (complete with 
labels and values).  The Console view in prometheus' expression interface 
can help you do this.

 

> sum_over_time did not work in this case as it does not take the "by" 
> option 
> Any way I can re write this ... can I make it avg of sum by locale or 
> something like that ?
>
>
Well, you've not described in concrete terms what you're trying to achieve, 
nor what the input data looks like.

avg_over_time needs a range vector as its input: this is two-dimensional.  
It has a bunch of time series, and each timeseries has multiple data points 
at different times.  I mentioned before how to make a range vector out of 
an instant vector.

"sum" and "sum by" works over the seires dimension (i.e. combining values 
at the same time, but taken from different timeseries, meaning with 
different labels).

"sum_over_time" works over the time dimension, and sums separately for each 
timeseries.  "by" makes no sense with this, because each sum is across the 
same timeseries - in other words, every point being summed has the same set 
of labels.

-- 
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/5057f221-f67c-48fe-a33a-a6f31e6c0581%40googlegroups.com.


[prometheus-users] Re: Zendesk to prometheus integration

2020-05-07 Thread Hatos Barbosa
Any news about this problem? Still looking for a way to integrate ZenDesk 
and Alertmanager, so it can create tickets when firing an alert.

On Wednesday, August 1, 2018 at 11:41:18 AM UTC-3, 
david...@digital.cabinet-office.gov.uk wrote:
>
> Hello, 
>
> Does any body here ever had to integrate alert manager with zen desk. If 
> you have please advise on how you managed to deal with the JSON in 
> prometheus. 
>
> We are about to write a forwarder, that takes the JSON, parses it and 
> forwards it onwards to the queue. I though I would ask to save us some 
> time. 
>
> Regards,
> David J
>
>

-- 
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/8911abcf-92a5-4ed3-a0a3-b5f4ce4da739%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread piyush sharma
Hey

I have a query like this

if  sum by (locale) ( expression1)/sum by (locale) ( expression2) >=0

This gives me no data points and hence a broken graph

sum_over_time did not work in this case as it does not take the "by" option
Any way I can re write this ... can I make it avg of sum by locale or
something like that ?

Please guide

On Thu, May 7, 2020 at 9:45 PM Brian Candler  wrote:

> The first matching route wins.  If you want a matched route to continue
> onto subsequent matches, add "continue: true".  You would need to set this
> on both of your first two routes, if you want those alerts to go to
> alertnow as well as to slack.
>
> The documentation you need is here:
> https://prometheus.io/docs/alerting/configuration/#route
>
> *"Every alert enters the routing tree at the configured top-level route,
> which must match all alerts (i.e. not have any configured matchers). It
> then traverses the child nodes. If continue is set to false, it stops after
> the first matching child. If continue is true on a matching node, the alert
> will continue matching against subsequent siblings. If an alert does not
> match any children of a node (no matching child nodes, or none exist), the
> alert is handled based on the configuration parameters of the current
> node."*
>
> --
> 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/a43ba829-1460-46a2-adb1-5516fdf726c2%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/CAPz289tNPiNc0bRimUPp%2BguwbT4ceMdVM8YJOVRo-j2572hbQA%40mail.gmail.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
The first matching route wins.  If you want a matched route to continue 
onto subsequent matches, add "continue: true".  You would need to set this 
on both of your first two routes, if you want those alerts to go to 
alertnow as well as to slack.

The documentation you need is here: 
https://prometheus.io/docs/alerting/configuration/#route

*"Every alert enters the routing tree at the configured top-level route, 
which must match all alerts (i.e. not have any configured matchers). It 
then traverses the child nodes. If continue is set to false, it stops after 
the first matching child. If continue is true on a matching node, the alert 
will continue matching against subsequent siblings. If an alert does not 
match any children of a node (no matching child nodes, or none exist), the 
alert is handled based on the configuration parameters of the current 
node."*

-- 
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/a43ba829-1460-46a2-adb1-5516fdf726c2%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread piyush sharma
Hello ,

I am having an issue but nothing related to this comes up in logs

Below is my alertmanager config

alertmanager.yml:

global:
  resolve_timeout: 12h
receivers:
- name: slack-production
  slack_configs:
  - api_url:
https://hooks.slack.com/services/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
channel: '#azure-dict-prod-alerts'
send_resolved: true
text: |-
  {{ range .Alerts }}
 *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
 *Description:* {{ .Annotations.description }}
 *Details:*
 {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
 {{ end }}
{{ end }}
title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{
.Alerts.Firing
  | len }}{{ end }}] Alert|Azure|Dict|Prod|WestUS2'
- name: slack-staging
  slack_configs:
  - api_url:
https://hooks.slack.com/services/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
channel: '#azure-dict-stg-alerts'
send_resolved: true
text: |-
  {{ range .Alerts }}
 *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
 *Description:* {{ .Annotations.description }}
 *Details:*
 {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
 {{ end }}
{{ end }}
title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{
.Alerts.Firing
  | len }}{{ end }}] Alert|Azure|Dict|Stg|EastUS'
- name: alertnow
  webhook_configs:
  - send_resolved: true
url:
https://alertnowitgr.sec-alertnow.com/integration/prometheus/v1/67a54ac114e9d111ea4860650ac112ba32ebsfr43
route:
  group_by:
  - alertname
  - locale
  group_interval: 5m
  group_wait: 5m
  receiver: alertnow
  repeat_interval: 4h
  routes:
  - match:
  tier: prod
receiver: slack-production
  - match:
  tier: stg
receiver: slack-staging
  - match:
  region: EastUS
receiver: alertnow


The issue here is that I am getting alerts on slack but not on the webhook
that I have configured . Is there something wrong with my config ?
PS : Webhook URL is correct and there are no logs related to webhook :(

On Thu, May 7, 2020 at 8:11 PM Brian Candler  wrote:

> I don't know an easy way.  I guess you can do it using custom templates,
> since they are passed the list of firing and resolved alerts:
> https://prometheus.io/docs/alerting/notifications/
>
> --
> 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/1032dce7-25e2-43b9-b064-f7a507c56626%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/CAPz289tdC-xY9d4fG-1QYYmBZur_PFCUzmpbT0Lu%3DafH_jjftw%40mail.gmail.com.


Re: [prometheus-users] How to use zookeeper for service discovery

2020-05-07 Thread Julien Pivotto
On 07 May 02:24, Jeff Zhang wrote:
> Hi all,
> 
> I found zookeeper service discovery related doc in prometheus code base, 
> but didn't find any document of how to use it. Could anyone guide me how to 
> use that ? Thanks
> 
> https://github.com/prometheus/prometheus/tree/master/discovery/zookeeper

The code you look at is

https://prometheus.io/docs/prometheus/latest/configuration/configuration/#serverset_sd_config

> 
> -- 
> 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/6b47d23f-788e-4f6a-8867-ce71f740c192%40googlegroups.com.


-- 
 (o-Julien Pivotto
 //\Open-Source Consultant
 V_/_   Inuits - https://www.inuits.eu

-- 
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/20200507151959.GA501843%40oxygen.


signature.asc
Description: PGP signature


[prometheus-users] Re: InfluxQL queries for Data collected by Prometheus

2020-05-07 Thread Brian Candler
If you are using prometheus' remote_write feature to write to influxdb, 
then I would have thought you would be able to query it via prometheus' 
remote_read via the same PromQL interface - that is, you should not have to 
write influxQLqueries (I'm not sure why you've found this).  But you may 
end up having to write recording rules to do downsampling.

I'd suggest you consider using something else for long term storage which 
supports the same PromQL language natively, so your dashboards don't have 
to change.  Popular options include VictoriaMetrics (very easy to set up) 
and Thanos (a bit more work).

Thanos includes down-sampling as a built-in feature.  With VictoriaMetrics 
you can scrape the /federate endpoint as described here 
.  So either 
way, you don't have to write recording rules.

-- 
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/6a581f1b-16b7-46d9-9d79-f7ea075276e7%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
I don't know an easy way.  I guess you can do it using custom templates, 
since they are passed the list of firing and resolved alerts:
https://prometheus.io/docs/alerting/notifications/

-- 
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/1032dce7-25e2-43b9-b064-f7a507c56626%40googlegroups.com.


Re: [prometheus-users] Re: How to use zookeeper for service discovery

2020-05-07 Thread Brian Candler
You'd have to add to zookeeper whatever Nerve 
 and/or Synapse 
 adds to zookeeper.

If this isn't documented, then you may need to look at source code.
>
>

-- 
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/c6ae73d0-e932-41ad-a6cd-9fb611f74863%40googlegroups.com.


Re: [prometheus-users] Re: How to use zookeeper for service discovery

2020-05-07 Thread Jeff Zhang
Thanks Brian, this is the configuration on prometheus side, what I look for
is what kind of data format I should insert into zookeeper. Is there any
example ?

Brian Candler  于2020年5月7日周四 下午8:10写道:

> Looks like it's this one:
>
> https://prometheus.io/docs/prometheus/latest/configuration/configuration/#nerve_sd_config
>
> If you look in the source code that you found:
>
> https://github.com/prometheus/prometheus/blob/master/discovery/zookeeper/zookeeper.go
> you'll see NerveSDConfig
>
> --
> 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/ca884dc3-021c-4065-b0f3-7e1828000765%40googlegroups.com
> 
> .
>


-- 
Best Regards

Jeff Zhang

-- 
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/CAADy7x7VNa0FBxacBj%3DGKvbf04cS63s5BD4cP-Gufq0RD624NQ%40mail.gmail.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread piyush sharma
So is there any way out so that while alerting I get the value and when I
get the resolved message ,,, i get only the message and not the value ?

On Thu, May 7, 2020 at 6:18 PM Brian Candler  wrote:

> P.S. If you change your annotation from "Current value is X" to "Most
> recent triggering value is X", then the resolved message may make more
> sense.
>
> --
> 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/c3400b51-6840-4989-996e-301c414bd5ba%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/CAPz289s0kopos6LaVVOv59sJP0n2rWu630ormQ7zTUqfOsJ2zw%40mail.gmail.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
P.S. If you change your annotation from "Current value is X" to "Most 
recent triggering value is X", then the resolved message may make more 
sense.

-- 
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/c3400b51-6840-4989-996e-301c414bd5ba%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
On Thursday, 7 May 2020 13:37:43 UTC+1, piyush sharma wrote:
>
>
> Actually when there is an alerting situation , I get an alert on slack 
> with the alerting value .
> But after sometime when alert is resolved , I still get the old value 
> which is below the threshold ( ideally should be in alerting state) but 
> still I get notification as resolved
>

This one has been answered recently on the group:
https://groups.google.com/d/topic/prometheus-users/LLsPBIvLIME/discussion

but hopefully from what you've just learned you'll understand why.

An expression "foo > 90" has the value 93, when foo has the value 93

An expression "foo > 90" has no value, when foo has the value 85

So in an alerting rule,

expr: foo > 90

will have no value when the metric drops below 90, and so prometheus stops 
generating alerts.  Therefore there is no value for alertmanager to report. 
All it can tell you is that an alert which *was* firing, is no longer 
firing; and it can tell you the labels and annotations the alert had when 
it was last active.

-- 
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/f607c378-8e01-4be7-b46e-8b0906619ebb%40googlegroups.com.


[prometheus-users] InfluxQL queries for Data collected by Prometheus

2020-05-07 Thread Yogesh Jadhav


Hi All,
I am using Prometheus with SNMP exporter to fetch metrics from network 
devices like router, switch, etc. After creating dashboards in Grafana, I 
realized that Prometheus does not provide downsampling for long term 
storage over years such that footprint is fixed and small. So InfluxDB is 
installed along with Prometheus with the intention of using it for long 
term storage for Prometheus data employing different RPs & CQs for 
downsampling data depending on retention period.

I want Grafana to now display data from InfluxDB instead of Prometheus.

I find porting PromQL dashboards to InfluxQL for Prometheus collected data 
stored into InfluxDB a very challenging task. For example, In all 
dashboards, I use template variable Job (say with value=ubiquiti) to select 
from available devices and then use another template variable Instance ( 
value=ip.address.of.device) to select particular device among the pool of 
Ubiquiti devices.

But in InfluxQL I can either query Jobs or Instances not both.

show tag values from "ifInOctets" with key="instance" 
show tag values from "ifInOctets" with key="job"

Any pointers are welcome.

I have enabled both remote read and write in Prometheus for InfluxDB. Is it 
possible to keep existing PromQL dashboards with the ability to read 
historic and current data simultaneously?

Thanks in advance

-- 
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/d0d0cd33-7150-45c7-8bab-708680b54911%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread piyush sharma
Thanks for such a comprehensive answer to the query :)

I have one more doubt
Actually when there is an alerting situation , I get an alert on slack with
the alerting value .
But after sometime when alert is resolved , I still get the old value which
is below the threshold ( ideally should be in alerting state) but still I
get notification as resolved

[RESOLVED] Cloud|Azure|Monitoring Event Notification(opens in new tab)

*Alert:* Overall Health of  dict-service  is down - warning
  *Description:* Attention !!!  Overall Health of dict-service is down !!!.
Current value is 93.99 %
  *Details:*
   • *alertname:* Overall Health down Alert
   • *rampcode:* dict

I want the new value when after the alert gets resolved

On Thu, May 7, 2020 at 1:53 PM Brian Candler  wrote:

> P.S. if you want to get "an average over 5 minutes" you need to use a
> range vector, which is a collection of metrics with all their values over a
> range of time: then you can do
>
> avg_over_time( ... range vector ...)
>
> You can get a range vector directly from an individual metric:
>
> foo[5m]
>
> Or you can use a subquery on an arbitrary PromQL expression:
>
> ( ... some expression ...)[5m:1m]
>
> The latter will evaluate whatever subexpression you give, over the
> previous 5 minutes at 1 minute intervals, giving a range vector.
>
> --
> 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/bd3c2c7e-36ea-4af2-a8ba-d6e168f2879c%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/CAPz289t7xo%3DQcZpa8geQf%2BC%3DazSUJEKOSkd2%3D5kA197xP9OAUw%40mail.gmail.com.


[prometheus-users] Re: How to use zookeeper for service discovery

2020-05-07 Thread Brian Candler
Looks like it's this one:
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#nerve_sd_config

If you look in the source code that you found:
https://github.com/prometheus/prometheus/blob/master/discovery/zookeeper/zookeeper.go
you'll see NerveSDConfig

-- 
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/ca884dc3-021c-4065-b0f3-7e1828000765%40googlegroups.com.


[prometheus-users] Thanos deployment.

2020-05-07 Thread Saurabh Jain

Hi Guys,

Need your support in implementing Thanos in our environment.

Is it possible to deploy thanos components individually or we have to use 
images only.

Pls share any document, if available.

Thanks,
Saurabh

-- 
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/558f8127-50fd-4d15-9317-baac5fa0d75a%40googlegroups.com.


[prometheus-users] Re: Monitor Java spring boot app without instrumenting the code

2020-05-07 Thread Ketan Talreja
Also, after using @Times annotation at the method level, I am getting 
metrics consist of  of 
*http_server_requests_seconds_count{exception="None",method="GET",status="200",uri="/students",}
 
2.0* 

While I was hoping this will return tags from Http request and response as 
per the default implementation inside class DefaultWebMvcTagsProvider 

@Override
public Iterable getTags(HttpServletRequest request, HttpServletResponse 
response, Object handler,
Throwable exception) {
Tags tags = Tags.of(WebMvcTags.method(request), WebMvcTags.uri(request, 
response, this.ignoreTrailingSlash),
WebMvcTags.exception(exception), WebMvcTags.status(response), WebMvcTags.
outcome(response));
for (WebMvcTagsContributor contributor : this.contributors) {
tags = tags.and(contributor.getTags(request, response, handler, exception));
}
return tags;
} Any idea what am I missing here? Also, I have added custom class to 
override the behavior but did not work. @Bean WebMvcTagsProvider 
webMvcTagsProvider() { return new WebMvcTagsProvider() { 
@SuppressWarnings("unchecked") @Override public Iterable 
getTags(HttpServletRequest request, HttpServletResponse response, Object 
handler, Throwable exception) { return ((Map) 
request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE)) 
.entrySet() .stream() .map(entry -> new ImmutableTag(entry.getKey(), 
entry.getValue())) .collect(Collectors.toList()); } @Override public 
Iterable getLongRequestTags(HttpServletRequest request, Object 
handler) { return new ArrayList<>(); } }; } 

Any advise on what I am doing wrong? 

Appreciate your help!

Thanks,
Ketan
On Thursday, 7 May 2020 12:22:39 UTC+5:30, Ketan Talreja wrote:
>
> Hi Guys, 
>
> Hope everyone is doing well! 
>
> I have started using Prometheus to collect metrics for my application 
> which is implemented in Java spring boot 2.x framework. I have used 
> "micrometer-registry-prometheus" library but this required some annotation 
> to be done in the code and moreover customize the bean configuration. 
>
> *Monitoring use-case for my application -* 
> *1*. I have to count the number of time REST API/Endpoint has been invoked
> *2.* I have to also capture REST request Input/response Output generated 
> and scrape it to metrics server i.e. Prometheus and using this metrics I 
> have to calculate i.e. number of time the "value" is returned in the 
> response output and same for request input i.e. number of time the specific 
> "value" is passed as in the input payload. 
>
> Could you please help how can I achieve above two points using Prometheus 
> and its client-libraries? And is there a way to achieve without 
> instrumenting the app code? This will help to decouple the application 
> codebase from instrumentation.
>
> Thanks!!
> Ketan
>

-- 
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/97dcff39-d1a2-405d-b281-1fa4b7f78fcf%40googlegroups.com.


Re: [prometheus-users] Kafka exporter vs JMX exporter

2020-05-07 Thread Ankit Rohilla
Please follow this thread. I've given a few links.

Regards

On Friday, 11 January 2019 16:32:36 UTC+5:30, kunaa...@gmail.com wrote:
>
> Hi Ankit,
>
> Can you help me with,setting up monitoring for kafka.
> I was using JMX exporter ,but I couldn't see proper logs in promethes.
>  Can you tell me how to have downloaded kafka exporter and how you managed 
> to run.
>
> Thanks
> Aarun
>
>
> On Tuesday, 11 September 2018 14:29:26 UTC+2, Ankit Rohilla wrote:
>>
>> Thanks for the reply,
>> So, like node_exporter I need to run jmx_exporter on each broker, while 
>> kafka_exporter can be run on any of the broker in the cluster because it 
>> will get only the general information.
>> Please correct me if I am wrong. Explain a bit if I got it wrong. How to 
>> configure jmx_exporter and if possible can you give example of metrics 
>> exposed by jmx_exporter specific to kafka because memory and other related 
>> things I can also get through node_exporter.
>>
>> Regards
>> Ankit Rohilla
>>
>>
>> On Monday, 10 September 2018 16:57:41 UTC+5:30, Brian Brazil wrote:
>>>
>>> On 10 September 2018 at 12:21,  wrote:
>>>
 Hi,
 I am confused between kafka exporter and jmx exporter. Both export 
 metrics related to kafka brokers in prometheus format so that prometheus 
 can use it later for further processing.
 So, do I need to run both exporters or just any exporter will work to 
 monitor my kafka cluster?

>>>
>>> You probably want both.
>>>  
>>>
 Is there any difference between the metrics exposed by these two 
 exporters?

>>>
>>> The JMX exporter will give you the metrics of each individual broker, 
>>> such as memory, GC and kafka external metrics. The Kafka exporter is more 
>>> overall state, such as the offsets of partitions.
>>>
>>> Brian
>>>  
>>>
 Please help. Any pointers would be useful.

 Thanks and regards
 Ankit Rohilla

 -- 
 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 post to this group, send email to promethe...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/prometheus-users/c48ee010-96b0-4889-a791-778efaf5cef2%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> Brian Brazil
>>> www.robustperception.io
>>>
>>

-- 
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/72031995-c1ad-47e1-9273-b0f229ea68b7%40googlegroups.com.


[prometheus-users] Re: Kafka exporter vs JMX exporter

2020-05-07 Thread Ankit Rohilla
Hi,
I don't clearly remember how I did it back then. But I found a few links 
that I referred to run all these things. Here are the links:
https://alex.dzyoba.com/blog/jmx-exporter/
https://subscription.packtpub.com/book/big_data_and_business_intelligence/9781783981328/7/ch07lvl1sec51/monitoring-the-storm-cluster-using-jmx

Hope you find them useful.

Regards
Ankit Rohilla

On Wednesday, 4 March 2020 11:09:46 UTC+5:30, Shah Darpan wrote:
>
> Hi,
>
> How to configure Kafka exporter for kafka monitoring WITHOUT using DOCKER.
>
> Thanks,
> Darpan Shah
>
> On Monday, September 10, 2018 at 4:51:57 PM UTC+5:30, ankit.r...@gmail.com 
> wrote:
>>
>> Hi,
>> I am confused between kafka exporter and jmx exporter. Both export 
>> metrics related to kafka brokers in prometheus format so that prometheus 
>> can use it later for further processing.
>> So, do I need to run both exporters or just any exporter will work to 
>> monitor my kafka cluster?
>> Is there any difference between the metrics exposed by these two 
>> exporters?
>> Please help. Any pointers would be useful.
>>
>> Thanks and regards
>> Ankit Rohilla
>>
>>

-- 
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/bf1b7af2-3141-4cb3-8b28-c7ef73a706c4%40googlegroups.com.


[prometheus-users] Re: Kafka exporter vs JMX exporter

2020-05-07 Thread Himanshu Ganatra
You can use the binary, it's on their official github. 

On Wednesday, 4 March 2020 11:09:46 UTC+5:30, Shah Darpan wrote:
>
> Hi,
>
> How to configure Kafka exporter for kafka monitoring WITHOUT using DOCKER.
>
> Thanks,
> Darpan Shah
>
> On Monday, September 10, 2018 at 4:51:57 PM UTC+5:30, ankit.r...@gmail.com 
> wrote:
>>
>> Hi,
>> I am confused between kafka exporter and jmx exporter. Both export 
>> metrics related to kafka brokers in prometheus format so that prometheus 
>> can use it later for further processing.
>> So, do I need to run both exporters or just any exporter will work to 
>> monitor my kafka cluster?
>> Is there any difference between the metrics exposed by these two 
>> exporters?
>> Please help. Any pointers would be useful.
>>
>> Thanks and regards
>> Ankit Rohilla
>>
>>

-- 
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/3651a00f-68c5-46be-be07-f8e27d062d2f%40googlegroups.com.


[prometheus-users] How to use zookeeper for service discovery

2020-05-07 Thread Jeff Zhang
Hi all,

I found zookeeper service discovery related doc in prometheus code base, 
but didn't find any document of how to use it. Could anyone guide me how to 
use that ? Thanks

https://github.com/prometheus/prometheus/tree/master/discovery/zookeeper

-- 
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/6b47d23f-788e-4f6a-8867-ce71f740c192%40googlegroups.com.


[prometheus-users] Re: no main manifest attribute, in jmx_prometheus_javaagent-0.12.0.jar

2020-05-07 Thread sathish kumar


java -javaagent:./jmx_prometheus_javaagent-0.12.0.jar=8080:config.yaml -jar 
yourJar.jar


Looks like your last argument need to point to the JAVA application you are 
trying to Monitor.

Thanks.

On Friday, April 24, 2020 at 6:26:42 PM UTC+5:30, Jayesh Patel wrote:
>
> Hello guys,
>
> I want to setup JMX exporter in my linux system and I am following 
> https://github.com/prometheus/jmx_exporter.
>
> I have download the jmx_prometheus_javaagent-0.12.0.jar also version 
> 0.11.0 and also created config.yml file in my linux system.
> Java 1.8 is installed in my linux system.
> I was trying to setup jmx_exporter as agent using below command.
>
> java -javaagent:./jmx_prometheus_javaagent-0.12.0.jar=8080:config.yml -jar 
> jmx_prometheus_javaagent-0.12.0.jar
>
> But it gives the error.
>
> *no main manifest attribute, in jmx_prometheus_javaagent-0.12.0.jar*
>
> what is the problem for this and how can I fix this ?
>
> 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/e353abc8-9d83-440a-9077-d0491b719ef2%40googlegroups.com.


[prometheus-users] alertmanager mail notification with value in mail

2020-05-07 Thread sunil sagar
Hi 

I have setup alert-manager , which sends alert notification by mail. 

This gives all key values which was used to form query , but doesn't 
display the value in mail . 

Is it possible to show the value also . For example for CPU alert , below 
alerts were generated by current utilization is 80% or 90% etc . 
But I see only hyperlink "Source" of Prometheus . 

For ex. I receive mail : 


Server : server1
Value: 90
Source


Server : server2
Value: 91
Source

-- 
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/05a78286-3266-4162-9abb-52788082838f%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
P.S. if you want to get "an average over 5 minutes" you need to use a range 
vector, which is a collection of metrics with all their values over a range 
of time: then you can do

avg_over_time( ... range vector ...)

You can get a range vector directly from an individual metric:

foo[5m]

Or you can use a subquery on an arbitrary PromQL expression:

( ... some expression ...)[5m:1m]

The latter will evaluate whatever subexpression you give, over the previous 
5 minutes at 1 minute intervals, giving a range vector.

-- 
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/bd3c2c7e-36ea-4af2-a8ba-d6e168f2879c%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread Brian Candler
Firstly, comparison operators 

 
don't work the way you imagine.  They are more like filters.  The 
expression "foo" is a vector of zero or more timeseries all with the metric 
name "foo".  So for example:

foo >= 80

returns all the timeseries for metric "foo" whose value is >= 80.  If none 
of the timeseries have this value, it returns nothing.  Try it in the 
PromQL browser in prometheus, and look at the graph view: you'll see 
timeseries values at the times where they are over 80, and gaps where they 
are below.

To filter to a range is therefore easy: you filter the results of the 
filter.

foo >= 80 < 95

Secondly, an alert is generated if the timeseries is present with any 
value.  If there's no value, there's no alert.  You can think of it as the 
presence of any value is treated as "true" from the point of view of 
generating an alert.

Thirdly:

expr: avg(...)
for: 5m

does not mean "taking average for 5 min" as you said.  What it means is:

- the expression is tested every 1 minute (your "evaluation_interval" for 
the rule group - defaults to global evaluation interval if not set)
- if the expression returns a value *every time* over a 5 minute period 
(i.e. for 6 evaluations consecutively), the alert is generated
- if there are any gaps, the alert is not generated

Fourthly, the AND, OR and UNLESS logical operators don't work how you 
imagine either; they are documented here 
.
  
For example:

foo AND bar

returns all the timeseries for metric "foo" for which there is a metric 
"bar" with an exactly matching label set (disregarding the value of "bar").

Filling in "default" values is not straightforward, because a metric like 
"foo" refers to a variable set of timeseries - each combination of labels 
is a different timeseries, and these can come and go over time.  So what 
you need is some other metric which you know is always present with the 
same set of labels, and can be used to force the missing value.  For 
example,

foo OR ((up * 0 + 1)

The metric "up" is generated on every scrape, with the value 1 if scrape is 
successful and 0 if not successful, so it reflects all the labels in your 
scrape job plus the "job" and "instance" labels added automatically.  If 
your metric foo has the same set of labels, then the expression above will 
fill in gaps with the value 1.

For more information see:
https://www.robustperception.io/existential-issues-with-metrics
https://www.robustperception.io/left-joins-in-promql

However I *strongly* recommend you play around with this in the PromQL 
expression browser - and try not to be distracted by pre-existing ideas 
about how booleans work.  Prometheus expressions work with vectors (i.e. 
multiple timeseries with different labels), not individual values.

-- 
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/8973ffd1-0565-45aa-8774-7bf62417d131%40googlegroups.com.


Re: [prometheus-users] Re: Alert manager looping in firing -> resolved -> firing

2020-05-07 Thread piyush sharma
Hey Guys ,

I have a doubt on how the result of an alert condition is evaluated.
Below is my configuration for prometheus

 *evaluation_interval: 1m*
* scrape_interval: 1m*

Now my query is as below

avg(metric_first_asr{locale=~"en-gb"}) by (locale)   >= 80 AND
avg(metric_first_asr{locale=~"en-gb"}) by (locale) < 95 OR
absent(metric_first_asr{locale=~"en-gb"}) == 1
for: 5m
labels:
  severity: warning

Here i want to define a warning threshold when condition evaluates to a
value of 80-95
I have specified absent condition so that when there is no data , value in
that case is equal to 1
now given my evaluation period is 1 min and I  am taking average for 5 min
... will my condition evaluated like this as below

100 + 100 + 1 + 100 +100 / 5
Considering data is evaluated after one minute and after each minute value
was 100 in 4 cases and there was no data in one instance so that value will
be replaced by 1 so my actual value will be

401/5 = 80.02

Am I doing he right calculations ? or the way Prometheus calculates value
is different ? Please suggest


On Sun, May 3, 2020 at 2:22 AM Brian Candler  wrote:

> Why not try it in the PromQL expression browser built in to prometheus (in
> the prometheus web interface at port 9090)
>
> --
> 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/0de10032-0ae8-43d5-8ea1-faef17a3e07b%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/CAPz289tmiXyi4xSNsECiL3Lpe0ighVHPMDRvukQ-RVzyUXHnkA%40mail.gmail.com.


[prometheus-users] Monitor Java spring boot app without instrumenting the code

2020-05-07 Thread Ketan Talreja
Hi Guys, 

Hope everyone is doing well! 

I have started using Prometheus to collect metrics for my application which 
is implemented in Java spring boot 2.x framework. I have used 
"micrometer-registry-prometheus" library but this required some annotation 
to be done in the code and moreover customize the bean configuration. 

*Monitoring use-case for my application -* 
*1*. I have to count the number of time REST API/Endpoint has been invoked
*2.* I have to also capture REST request Input/response Output generated 
and scrape it to metrics server i.e. Prometheus and using this metrics I 
have to calculate i.e. number of time the "value" is returned in the 
response output and same for request input i.e. number of time the specific 
"value" is passed as in the input payload. 

Could you please help how can I achieve above two points using Prometheus 
and its client-libraries? And is there a way to achieve without 
instrumenting the app code? This will help to decouple the application 
codebase from instrumentation.

Thanks!!
Ketan

-- 
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/7fcc0fae-366c-457b-a0c4-6a9483f642a2%40googlegroups.com.


[prometheus-users] Re: Prometheus HTTPs setup questions

2020-05-07 Thread Brian Candler
On Thursday, 7 May 2020 01:27:14 UTC+1, H T wrote:
>
> In my case, remote server is using a self-signed certificate and based on 
> your comments I tried the below approach which worked and other which 
> didn't.
>
> *Working Scenario  -> (Both remote server and Prometheus using same CA 
> certs but separate private and crt files)*
>
> 1.) Self-signed CA certs were generated first(crt and key files)
> 2.) Remote server (Node.js app) used above CA to generated its crt and key 
> files.
> 3.) Prometheus server running on a separate box used above CA to generated 
> its crt and key files.
>
>
For clarity, this isn't what I'd describe as the server using a 
"self-signed cert".  All CA root certificates are self-signed, by 
definition.

This is what I'd describe as a private CA, which is issuing certs for both 
the remote server and the prometheus server.

 

>
> *Not working Scenario  -> (Remote server and Prometheus using their own CA 
> certs) -*  I think this is expected behavior.
>
>
Do you mean, two different private CAs?

This should work fine.  At each end, the "ca_cert" setting that you give is 
the *other* CA, i.e. the one you need to use to verify the peer's 
certificate.

e.g. at the prometheus end:

tls_config:
key_file: "server.key" # my key
cert_file: "server.crt" # my certificate, signed by CA 1
ca_file: "ca.crt" # CA 2's root certificate, used to verify exporter's cert
 
At the exporter side it's the other way round.

Should we always use the same CA to generate Remote server and Prometheus 
> certs for HTTPS communications? Also, should both remote servers and 
> Prometheus client use the same key and cert files?
>

Don't use the same key and cert for both ends.  This would mean that the 
node's certificate could be used to pretend to be prometheus.

Actually, that's a good reason for using two different CAs.  At the moment, 
prometheus verifies the identity of the exporter's certificate matches the 
hostname in the HTTPS scrape URL (you can override the identity using the 
"server_name:" setting); but node_exporter doesn't verify the identity of 
prometheus' certificate.  So any node could use its own cert to scrape any 
other node.

You can workaround this by signing prometheus' certificate by a different 
CA, and then node_exporter only trusts *that* CA.  However if you are 
writing your own custom exporter, you can add a check to verify the client 
certificate's identity is the one which belongs to prometheus.

 

>
> Lastly, our remote server is running on a VM and we have other apps 
> running inside a docker container and pods. As of now, I am we are using 
> DNS names like (test.server.com) and it works. But I would like to know 
> if we can generate certs for IP address(127.0.0.1), localhost, and use them 
> instead of DNS name. Our goal is that the remote server will expose 
> /metrics api at  default IP like 127.0.0.1 and generate certs which 
> Prometheus uses to connect- but we are not sure how can we generate certs 
> for default IP or loccalhost
>

Well, you technically you *can* issue certs for an IP address - there is a 
SAN IP address extension.  It's unconventional and I wouldn't recommend it, 
and I wouldn't be surprised if not all software supports it.  Better to use 
/etc/hosts if you need to force the IP address.

Also, using SSL for communication to 127.0.0.1 or localhost is pretty 
pointless.

-- 
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/02dab5a6-7363-4714-8946-c0ef69ec8bf1%40googlegroups.com.