Comments (8)
@zsrinivas for a single stat panel in grafana you can do something like
max(elasticsearch_cluster_health_status{color="green",cluster=~"my_cluster"}) + ON(cluster)
max(elasticsearch_cluster_health_status{color="yellow",cluster=~"my_cluster"})* 2 + ON(cluster)
max(elasticsearch_cluster_health_status{color="red",cluster=~"my_cluster"}) * 3
and then create value mappings in the grafana dashboard to map the values 1, 2, 3 to green, yellow, and red respectively.
from elasticsearch_exporter.
@QuanTran91 you can think of them as SQL joins, i.e. "join results from left side with right side where cluster
is the same". if you do not include the ON(<labels>)
, then the left side will "join" only with a metric that has the EXACT same set of labels. ON(<labels>)
lets you specify the label(s) to join on. it's not always necessary but it's recommended since labels are very dynamic and it is possible that the green
metric may have labels that the yellow
metric does not have, or vice versa.
read more here: https://prometheus.io/docs/prometheus/latest/querying/operators/#many-to-one-and-one-to-many-vector-matches
from elasticsearch_exporter.
see https://github.com/justwatchcom/elasticsearch_exporter/blob/master/collector/cluster_health.go#L195 and
https://github.com/justwatchcom/elasticsearch_exporter/blob/master/collector/cluster_health.go#L275
So the values are for example
elasticsearch_cluster_health_status{cluster="elasticsearch",color="green"} 1
elasticsearch_cluster_health_status{cluster="elasticsearch",color="red"} 0
elasticsearch_cluster_health_status{cluster="elasticsearch",color="yellow"} 0
from elasticsearch_exporter.
wait,, both read AND yellow are 0 ??
from elasticsearch_exporter.
from elasticsearch_exporter.
we chose this representation to avoid a made up mapping like
green = 1
yellow = 2
red = 3
(you can't have string values in prometheus. The json from ES contains a string in the cluster-health-status value).
I hope the explanation makes it clear, closing the issue. If there are further questions, just reopen the ticket
from elasticsearch_exporter.
hey @zwopir , any idea on how I can make a single stat panel in grafana with this kind of value format. also thought about a bit on how I can make an alert on this but still confused.
from elasticsearch_exporter.
Hi @jpdstan , I am just curios since I am a Promql newbie
What does the "ON(cluster) " mean here?
Thank a lot
from elasticsearch_exporter.
Related Issues (20)
- Refactor ClusterInfo package
- Incorrect Metric Type for elasticsearch_data_stream_store_size_bytes
- number_of_shards
- elasticsearch_exporter error: connection refused HOT 1
- Usage of environment variables
- can't query elasticsearch_cluster_health_number_of_nodes HOT 1
- failed to fetch and decode X err="HTTP Request failed with code 401" HOT 1
- Request to release security fix for version v1.6.0 HOT 3
- Configuring Liveness/Readiness probes (httpGet -> scheme) is not working as expected through values file
- When will support elasticsearch 8 HOT 2
- Elasticsearch Exporter not reporting master node as down HOT 2
- The exporter is many times OOMKilled HOT 4
- Raise version for Debian HOT 1
- Is there a relationship between index names and instances? HOT 1
- elasticsearchv8 cluster_settings unmarshal error HOT 4
- In the latest version 1.7.0, is the code Envar("ES_URI") missing for retrieving the value of es.uri? Currently, when transmitted via ES_URI, it is still bound to the default address. HOT 2
- Metric `elasticsearch_cluster_health_up` removed in v1.7.0
- Elastisearch Export 1.1.0 not collecting many metrics on elasticsearch 7.17
- elasticsearch exporter used too much memory ,is it normal
- msg="failed to get cluster info" err="Get \"http://localhost:9200/\": dial tcp 127.0.0.1:9200: connect: connection refused" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch_exporter.