How to rename label within a metric in Prometheus

you can use the label_replace function in promQL, but it also add the label, don’t replace it label_replace( <vector_expr>, “<desired_label>”, “$1”, “<existing_label>”, “(.+)” ) label_replace( node_systemd_unit_state{instance=”server-01″,job=”node-exporters”,name=”kubelet.service”,state=”active”}, “unit_name”,”$1″,”name”, “(.+)” ) So, to avoid the repetition you can add: sum(label_replace( node_systemd_unit_state{instance=”server-01″,job=”node-exporters”,name=”kubelet.service”,state=”active”}, “unit_name”,”$1″,”name”, “(.+)” ) )by(unit_name)

Monitoring UI for Apache kafka – kafka manager vs kafka monitor [closed]

Lenses Lenses (ex Landoop) enhances Kafka with User Interface, streaming SQL engine and cluster monitoring. It enables faster monitoring of Kafka data pipelines. They provide a free all-in-one docker (Lenses Box) which can serve a single broker for up to 25M messages. Note that this is recommended for development environments. Cloudera SMM Streams Messaging Manager … Read more

CPU utilization by database?

Sort of. Check this query out: SELECT total_worker_time/execution_count AS AvgCPU , total_worker_time AS TotalCPU , total_elapsed_time/execution_count AS AvgDuration , total_elapsed_time AS TotalDuration , (total_logical_reads+total_physical_reads)/execution_count AS AvgReads , (total_logical_reads+total_physical_reads) AS TotalReads , execution_count , SUBSTRING(st.TEXT, (qs.statement_start_offset/2)+1 , ((CASE qs.statement_end_offset WHEN -1 THEN datalength(st.TEXT) ELSE qs.statement_end_offset END – qs.statement_start_offset)/2) + 1) AS txt , query_plan FROM sys.dm_exec_query_stats … Read more

What do you monitor with JMX in your production Java application?

At the JVM level, I monitor the garbage collection duration per minute, At the Servlet Container level, I monitor the number of requests, number of exceptions (4xx & 5xx codes) , sum of request duration per minute, At the SOAP level, I monitor the number of invocations, number of exceptions & sum of invocations per … Read more

Why there are both counters and gauges in Prometheus if gauges can act as counters?

From a conceptual point of view, gauge and counter have different purposes a gauge typically represent a state, usually with the purpose of detecting saturation. the absolute value of a counter is not really meaningful, the real purpose is rather to compute an evolution (usually a utilization) with functions like irate/rate(), increase() … Those evolution … Read more

How to profile PostgreSQL Database?

“Keep an eye on” and “profile” are two quite different tasks in my view. For profiling (not a live view on what’s going on right now, but to see which queries take most time etc), check out pgFouine: http://pgfouine.projects.postgresql.org/ This will let you see which queries are resource intensive, and take appropriate action: Add missing … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)