[prometheus-users] Need help on linux query

2022-10-13 Thread Srinu Karnati
I know this is Prometheus user group, But, i have one issue in Linux query, 
I got stucked in a query, Is anyone help me with this query, That would be 
very helpful for me

-- 
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/1e804e87-82ef-4e23-a8ce-5e11b62cb1fan%40googlegroups.com.


[prometheus-users] Re: PromQL: multiple queries with dependent values

2022-10-13 Thread Brian Candler
Sorry, second to last sentence was unclear.  What I meant was:


*If the LHS vector contains N metrics with a particular value of the 
"group" label, which correspond to exactly 1 metric on the RHS with the 
matching label value, or vice versa, then you can use N:1 matching.*
On Thursday, 13 October 2022 at 14:13:42 UTC+1 Brian Candler wrote:

> > Is it possible to have one side of a query limit the results of another 
> part of the same query?
>
> Yes, but it depends on exactly what you mean. The details are here:
> https://prometheus.io/docs/prometheus/latest/querying/operators/
> It depends on whether you can construct vectors for the LHS and RHS which 
> have corresponding labels.
>
> If you can give some specific examples of the metrics themselves - 
> including all their labels - then we can see whether it's possible to do 
> what you want in PromQL.  Right now the requirements are unclear.
>
>
> *> redis_cluster_known_nodes != 
> scalar(count(up{service=~"redis-exporter"}))*
> > 
> > The shared label value would be something like, *group="cluster-a" *and 
> should not evaluate metrics where *group="cluster-b"*
>
> You need to arrange both LHS and RHS to have some corresponding labels 
> before you can combine them with any operator such as !=.  The RHS has no 
> "group" label at the moment, in fact it's not even a vector, but you could 
> do:
>
> count by (group) (up{service="redis-exporter"})
>
> Then, assuming that redis_cluster_known_nodes also has a "group" label, 
> you can do:
>
> redis_cluster_known_nodes != on (group) count by (group) 
> (up{service="redis-exporter"})
>
> This will work as long as the LHS and RHS both have exactly *one* metric 
> for a given value of the "group" label.
>
> If the LHS has N values of "group" for 1 on the RHS, or vice versa, then 
> you can use N:1 matching as described in the documentation ("group left" or 
> "group right").
>
> If there are multiple matches on both LHS and RHS for the same value of 
> group, then the query will fail.  You will have to include some more labels 
> in the on(...) list to get a unique match.
>

-- 
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/5f17c0a4-e1aa-447c-acdc-561b0a807d9an%40googlegroups.com.


[prometheus-users] Re: PromQL: multiple queries with dependent values

2022-10-13 Thread Brian Candler
> Is it possible to have one side of a query limit the results of another 
part of the same query?

Yes, but it depends on exactly what you mean. The details are here:
https://prometheus.io/docs/prometheus/latest/querying/operators/
It depends on whether you can construct vectors for the LHS and RHS which 
have corresponding labels.

If you can give some specific examples of the metrics themselves - 
including all their labels - then we can see whether it's possible to do 
what you want in PromQL.  Right now the requirements are unclear.


*> redis_cluster_known_nodes != 
scalar(count(up{service=~"redis-exporter"}))*
> 
> The shared label value would be something like, *group="cluster-a" *and 
should not evaluate metrics where *group="cluster-b"*

You need to arrange both LHS and RHS to have some corresponding labels 
before you can combine them with any operator such as !=.  The RHS has no 
"group" label at the moment, in fact it's not even a vector, but you could 
do:

count by (group) (up{service="redis-exporter"})

Then, assuming that redis_cluster_known_nodes also has a "group" label, you 
can do:

redis_cluster_known_nodes != on (group) count by (group) 
(up{service="redis-exporter"})

This will work as long as the LHS and RHS both have exactly *one* metric 
for a given value of the "group" label.

If the LHS has N values of "group" for 1 on the RHS, or vice versa, then 
you can use N:1 matching as described in the documentation ("group left" or 
"group right").

If there are multiple matches on both LHS and RHS for the same value of 
group, then the query will fail.  You will have to include some more labels 
in the on(...) list to get a unique match.

-- 
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/09bdd5d2-59ea-451f-a431-b2d9665417afn%40googlegroups.com.


[prometheus-users] Re: to see IP in grafana dashboard

2022-10-13 Thread Brian Candler
For questions specifically about Grafana, please use the grafana 
community: https://community.grafana.com/

However I'll assume you're asking a question about PromQL.  What exactly do 
you mean by a "Newly configured IP"?

If you're asking how to write a PromQL query to show newly-added scrape 
endpoints, then you could use something like this:

up unless up offset 24h

But really, that's not telling you something about the node: it's telling 
you about how you've configured prometheus. It tells you when something has 
been added to the list of targets that prometheus scrapes in the last 24 
hours (either because you've manually added it to the list of targets, or 
via some service discovery mechanism that you've configured)

If you want to tell whether a node has assigned a new IP address to one of 
its interfaces, you'd need to get those IP addresses into a metric.  I 
don't think node_exporter gives you that, so you'd have to add some custom 
metrics (e.g. via the node_exporter textfile collector).

If you want to discover newly active IP addresses on your network, for 
other hosts which are *not* running node_exporter, then you'll need to 
scrape the ARP table of the gateway on your network.  You may be able to 
use snmp_exporter for that, although not all devices expose their ARP table 
via SNMP: e.g. Cisco ASA firewalls don't, last time I tried.

On Thursday, 13 October 2022 at 12:04:17 UTC+1 srinuka...@gmail.com wrote:

> Just we configured node_exporter on a server, How can we check Newly 
> configured IP in grafana dashboard??

-- 
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/dd315d3a-f261-4888-a91c-e25e2e4976c9n%40googlegroups.com.


Re: [prometheus-users] Mysql handshake error with blackbox tcp_connect

2022-10-13 Thread Stuart Clark

On 12/10/2022 15:46, Dimitris Tzampanakis wrote:

Hello.
When blackbox exporter makes tcp connect to mysql  on port 3306 i 
notice handshake errors and after 100 errors the host is blocked from 
mysql. It was very frustrating and difficult to spot, since other 
success connect from same host reset the error_count from mysql and 
nothing was logged. This same setup is running on other environments 
(without problem). But in this env that big traffic didn't started 
yet, locks happen.

I also found this similar
https://github.com/prometheus/blackbox_exporter/issues/505
Is there anything that i missing  in the config?
Is there any other that user tpc_connect for mysql checks with similar 
problems? 


As you are just doing a TCP connection request it will look to be some 
sort of failure from the MySQL server's perspective - you are just 
opening a connection and then not doing anything. You would need to look 
at the server configuration to whitelist the IP of the Blackbox Exporter 
so it doesn't get blocked.


Alternatively look at using the MySQL Exporter instead of using Blackbox 
Exporter, which will give you more insight above just availability too?


--
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/70708a5c-5ef8-8333-5c55-c43d1d304a4f%40Jahingo.com.


[prometheus-users] to see IP in grafana dashboard

2022-10-13 Thread Srinu Karnati
Just we configured node_exporter on a server, How can we check Newly 
configured IP in grafana dashboard??

-- 
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/0ed83524-7ab1-4905-9364-dffd036898fan%40googlegroups.com.


[prometheus-users] PromQL: multiple queries with dependent values

2022-10-13 Thread marc koser
Is it possible to have one side of a query limit the results of another 
part of the same query?

For example; I want an alert query for when the count of all instances in a 
clustered service are not equal to what the instance is reporting based on 
a label's value being equal in both sides of the query (in this case; there 
are many nodes that run the same service but are part of different 
clusters:)


*redis_cluster_known_nodes != scalar(count(up{service=~"redis-exporter"}))*

The shared label value would be something like, *group="cluster-a" *and 
should not evaluate metrics where *group="cluster-b"*

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/12403656-6f2a-4383-ae72-8a073ab993c2n%40googlegroups.com.