[prometheus-users] Re: passwords in config file

2022-12-17 Thread Brian Candler
If you're talking about basic_auth in scrape jobs 
,
 
then use password_file instead of password.

Otherwise, please clarify, or give an example of the embedded 
username+password config you're talking about.

On Saturday, 17 December 2022 at 08:49:30 UTC natach...@gmail.com wrote:

> Hey guys,
>
> I'm looking for some best practices advice for securing my prometheus 
> stack, because I don't wanna have username+password for my targets in my 
> prometheus.yml file
>
> I've looked for environment variables because this is one way that I know 
> of, and that turned out to be a huge discussion and a dead end. 
>
> So what is you recommendation? What should I study/do ?
>
> Regards,
> Nat
>

-- 
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/fe336a1b-f5f3-42ad-9ac1-c7965a223953n%40googlegroups.com.


Re: [prometheus-users] Issue getting data in time range

2022-12-17 Thread Stuart Clark

On 13/12/2022 10:19, Yogita Bhardwaj wrote:
I m not able to fetch metrics counts in given time range using 
Prometheus client.


I'm not really clear about exactly what you are trying to do & what is 
happening.


Could you please show what you are running, the query, what you are 
expecting & what you actually see?


--
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/2f286411-6ae8-1e4e-c535-7660c481a05d%40Jahingo.com.


Re: [prometheus-users] Null value in alerts

2022-12-17 Thread Yashaswini K
Hi Team

On Sunday, 11 December 2022 at 23:20:24 UTC+5:30 matt...@prometheus.io 
wrote:

> When you say "the value is missing", what condition exactly do you want to 
> alert on?
>
> To detect that there is *no* metric matching your selector, you can use 
> the absent(…) function. It returns 1 when … is nothing.
>
> It gets more complicated and difficult if you want to detect that a single 
> series has disappeared. In this case, you need to very specific in telling 
> Prometheus which series *should* exist. Common ways to do this are
>
> - listing them all out with separate absent(x) clauses and specific 
> positive matchers
> - comparing to a previous time (x offset 15m unless x)
> - use some other metric that lets you determine what should be there
> - generate recording rules to create such a metric
>
> The fundamental challenge here is to distinguish between "this went 
> missing" and "this went away because of expected changes".
>
> In general, I prefer splitting "metric indicates there is a problem " and 
> "metric is missing" into two different alerts with separate names and 
> descriptions. To the one investigating, the difference matters. 
> Additionally using absent() often results in different label sets because 
> it cannot know labels for a time series that is absent. This causes trouble 
> with templating that you sidestep by using separate alert definitions to 
> begin with.
>
> /MR
>
>
> On Fri, 9 Dec 2022, 08:31 Sebastian Glock,  wrote:
>
>> Hi,
>>
>> I'm having trouble setting up an alert that will send a notification when 
>> a value is different from 0 and the value is missing (i.e. null).
>>
>> expression:
>> windows_mscluster_resourcegroup_state {name!~"Available Storage"} != 0 or 
>> on() vector(0)
>>
>> The alert goes off non-stop. How can I set the metric to send an alert 
>> when the value is different from 0 and is null?
>>
>> I tried with sum() but not working anyway:
>> sum(windows_mscluster_resourcegroup_state {name!~"Available Storage"} != 
>> 0) or on() vector(0)
>>
>> Thanks for replies!
>>
>> -- 
>>
> 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/9fbc7d5d-c7ce-4b93-b653-733cac798956n%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/06c25a97-ca2f-4fd7-bd1a-82902864bd84n%40googlegroups.com.


[prometheus-users] Prometheus Users

2022-12-17 Thread Yashaswini K
Hi Team,


Need one help, i would need to write a query which will check pod status 
for all cluster operator pods for all operator namespaces and trigger an 
alert along with details all of them are down or whichever pod is down.

below query can be used for the same? will it print whichever pod is down 

absent(kube_pod_info{pod=~".*authentication-operator.*|.*etcd-operator.*|.*ingress-operator.*|.*kube-apiserver-operator.*|.*kube-controller-manager-operator.*|.*kube-scheduler-operator.*|.*kube-storage-version-migrator-operator.*|.*monitoring-operator.*|.*network-operator.*|.*openshift-apiserver-operator.*|.*openshift-controller-manager-operator.*|.*cloud-credential-operator.*|.*cluster-autoscaler-operator.*|.*openshift-config-operator.*|.*console-operator.*|.*machine-api-operator.*|.*machine-approver.*|.*machine-config-operator.*|.*node-tuning-operator.*|.*storage-operator.*|.*prometheus-operator.*"})
 
== 1

 

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/cbd21e2a-910c-4e51-a18a-99f39996967cn%40googlegroups.com.


[prometheus-users] Error opening zip file or JAR manifest missing

2022-12-17 Thread bharath naik
Hi team,
i just downloaded the latest jmx exporter of version 0.17.2 in lib folder 
of tomcat directory. and in catalina.sh file i just added this line.

CATALINA_OPTS=" 
-javaagent:/opt/app/tomcat8/lib/jmx_prometheus_javaagent-0.17.2.jar=9088:/opt/app/tomcat8/lib/config.yaml"

and my config.yaml file is as below.
---
lowercaseOutputName: true
whitelistObjectNames: ["java.lang:type=OperatingSystem", "Catalina:*"]
blacklistObjectNames: []
rules:
  - pattern: 'Catalina<>serverInfo: (.+)'
name: tomcat_serverinfo
value: 1
labels:
  serverInfo: "$1"
type: COUNTER
  - pattern: 'Catalina<>(\w+):'
name: tomcat_$3_total
labels:
  port: "$2"
  protocol: "$1"
help: Tomcat global $3
type: COUNTER
  - pattern: 'Catalina<>(requestCount|processingTime|e$
name: tomcat_servlet_$3_total
labels:
  module: "$1"
  servlet: "$2"
help: Tomcat servlet $3 total
type: COUNTER
  - pattern: 'Catalina<>(currentThreadCount|currentThreadsBusy|keepAliveCount|connectionCount|acceptCount|acceptorThreadCount|pollerThreadCount|maxThreads|minSpareThread$
name: tomcat_threadpool_$3
labels:
  port: "$2"
  protocol: "$1"
help: Tomcat threadpool $3
type: GAUGE
  - pattern: 'Catalina<>(processingTime|sessionCounter|rejectedSessions|expiredSessions):'
name: tomcat_session_$3_total
labels:
  context: "$2"
  host: "$1"
help: Tomcat session $3 total
type: COUNTER
  - pattern: '.*'
...

-
the i run ./catalina.sh start, it says tomcat started but unable to see the 
metrics and sometimes i come across the error below like no manifest. 
needed help for just running.

Error opening zip file or JAR manifest missing : 
/jmx/jmx_prometheus_javaagent-0.17.2.jar:8088:/home/naikvad/jmx/config.yml

-- 
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/e34c572f-71d0-4fbd-ac11-1c874d49d59an%40googlegroups.com.


[prometheus-users] Why does the federate endpoint return all metrics as untyped?

2022-12-17 Thread 心若寒江雪
prometheus federate api

# TYPE hermes_req_proc_time untyped
hermes_req_proc_time{statsdtype="timers",gs_app="someapp",job="aggregator_10s",instance="
172.24.0.7:9080",gs_dc="us-east-1",gs_svcuser="svcuser2",gs_statistics="lower",gs_service="hermes",gs_hostname="someapp-01",gs_env="dev",gs_instanceid="8ef31bcd",id="prom-1"}
 
156 1473292292860
# TYPE netdev untyped
netdev{dev="eth0",gs_svcuser="svcuser2",gs_env="dev",gs_instanceid="aabd3924",type="byteout",instance="container-metrics:9092",gs_dc="us-east-1",job="promclient_triton_5s",id="prom-1"}
 
2.198199005e+09 1473292299525
# TYPE hermes_req_proc_time untyped
hermes_req_proc_time{gs_dc="us-east-1",job="aggregator_10s",gs_statistics="sum",gs_service="hermes",gs_instanceid="8ef31bcd",gs_svcuser="svcuser2",statsdtype="timers",gs_env="dev",instance="
172.24.0.7:9080",gs_app="someapp",gs_hostname="someapp-01",id="prom-1"} 
6778 1473292292860


How does upper Prometheus in the Prometheus federated cluster know what 
kind of Metrics they are getting from the federate interface of lower 
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/c398da36-8d31-480f-b0b3-c587ffd54801n%40googlegroups.com.


[prometheus-users] Why does the federate endpoint return all metrics as untyped?

2022-12-17 Thread 心若寒江雪
curl http://127.0.0.1:9090/federate?match[]={job!=""}
output:
# TYPE scrape_duration_seconds untyped 
scrape_duration_seconds{instance="172.31.24.196:18080",job="rs"} 
0.000687693 1671095235507 # TYPE scrape_samples_post_metric_relabeling 
untyped 
scrape_samples_post_metric_relabeling{instance="172.31.24.196:18080",job="rs"} 
0 1671095235507 # TYPE scrape_samples_scraped untyped 
scrape_samples_scraped{instance="172.31.24.196:18080",job="rs"} 0 
1671095235507 # TYPE scrape_series_added untyped 
scrape_series_added{instance="172.31.24.196:18080",job="rs"} 0 
1671095235507 # TYPE up untyped up{instance="172.31.24.196:18080",job="rs"} 
0 1671095235507

How does upper Prometheus in the Prometheus federated cluster know what 
kind of Metrics they are getting from the federate interface of lower 
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/7dafc047-aaf7-4c78-b1c0-c19c164f2145n%40googlegroups.com.


[prometheus-users] passwords in config file

2022-12-17 Thread Natacha Souza
Hey guys,

I'm looking for some best practices advice for securing my prometheus 
stack, because I don't wanna have username+password for my targets in my 
prometheus.yml file

I've looked for environment variables because this is one way that I know 
of, and that turned out to be a huge discussion and a dead end. 

So what is you recommendation? What should I study/do ?

Regards,
Nat

-- 
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/c1c3ff4b-cd60-4154-a12e-c5a4e9362dbbn%40googlegroups.com.


[prometheus-users] Get data in Prometheus

2022-12-17 Thread Yogita Bhardwaj
I am facing issues in fetching data from Prometheus in given time range 
using Prometheus client.

-- 
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/17f5aed9-1d8c-4f21-9bdb-4ffd1d848530n%40googlegroups.com.


[prometheus-users] Issue getting data in time range

2022-12-17 Thread Yogita Bhardwaj
I m not able to fetch metrics counts in given time range using Prometheus 
client.
 

-- 
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/be7d034c-c654-48c7-b72f-944f753ffce1n%40googlegroups.com.