Add Remote Info to data collection to monitor remote cluster connections - #1099
Add Remote Info to data collection to monitor remote cluster connections#1099rtkkroland wants to merge 4 commits into
Conversation
Signed-off-by: rtkkroland <ken.roland@arcticwolf.com>
Signed-off-by: rtkkroland <ken.roland@arcticwolf.com>
Signed-off-by: rtkkroland <ken.roland@arcticwolf.com>
Signed-off-by: rtkkroland <ken.roland@arcticwolf.com>
4624606 to
e6b1e02
Compare
|
Hello everyone. Would love to see this new feature added, is there anything we can do to help move this PR along? |
sysadmind
left a comment
There was a problem hiding this comment.
I think it looks okay overall, it just needs to fit our current collector design. I think what happened is that you used an older collector as your reference. I would suggest the data_stream collector as a much better reference: https://github.com/prometheus-community/elasticsearch_exporter/blob/master/collector/data_stream.go
| @@ -0,0 +1,187 @@ | |||
| // Copyright 2021 The Prometheus Authors | |||
There was a problem hiding this comment.
We don't put dates in our files anymore.
| // Copyright 2021 The Prometheus Authors | |
| // Copyright The Prometheus Authors |
| } | ||
|
|
||
| // RemoteInfo information struct | ||
| type RemoteInfo struct { |
There was a problem hiding this comment.
This should implement the Collector interface https://github.com/prometheus-community/elasticsearch_exporter/blob/master/collector/collector.go#L65
| up prometheus.Gauge | ||
| totalScrapes, jsonParseFailures prometheus.Counter |
There was a problem hiding this comment.
We have been removing these metrics from collectors.
| up prometheus.Gauge | |
| totalScrapes, jsonParseFailures prometheus.Counter |
|
|
||
| // Labels for remote info metrics | ||
| var defaulRemoteInfoLabels = []string{"remote_cluster"} | ||
| var defaultRemoteInfoLabelValues = func(remote_cluster string) []string { |
There was a problem hiding this comment.
I don't see a lot of value in the func here. It just makes the input a single element slice. This should just get handled where it's used.
| Help: "Number of errors while parsing JSON.", | ||
| }), | ||
| // Send all of the remote metrics | ||
| remoteInfoMetrics: []*remoteInfoMetric{ |
There was a problem hiding this comment.
Metrics descriptions should be package vars.
| } | ||
| } | ||
|
|
||
| func (c *RemoteInfo) fetchAndDecodeRemoteInfoStats() (RemoteInfoResponse, error) { |
There was a problem hiding this comment.
This can all get collapsed into the Update() func
| @@ -0,0 +1,28 @@ | |||
| // Copyright 2021 The Prometheus Authors | |||
There was a problem hiding this comment.
The response can just go in the remote_info.go file. I don't see any benefit of putting it in a separate file.
| esInsecureSkipVerify = kingpin.Flag("es.ssl-skip-verify", | ||
| "Skip SSL verification when connecting to Elasticsearch."). | ||
| Default("false").Bool() | ||
| esExportRemoteInfo = kingpin.Flag("es.remote_info", |
There was a problem hiding this comment.
This won't be necessary when using the Collector interface.
| | collector.health-report | 1.10.0 | If true, query the health report (requires elasticsearch 8.7.0 or later) | false | | ||
| | es.slm | | If true, query stats for SLM. | false | | ||
| | es.data_stream | | If true, query state for Data Steams. | false | | ||
| | es.remote_info | 2.x.x | If true, query stats for configured remote clusters in the Elasticsearch cluster. Exposes connection metrics for cross-cluster search and replication. | false | |
There was a problem hiding this comment.
This will change to collector.remote-info
| - Any `options:` under an auth module will be appended as URL query parameters to the target URL. | ||
| - The `tls` auth module (client certificate authentication) is intended for self‑managed Elasticsearch/OpenSearch deployments. Amazon OpenSearch Service typically authenticates at the domain edge with IAM/SigV4 and does not support client certificate authentication; use the `aws` auth module instead when scraping Amazon OpenSearch Service domains. | ||
|
|
||
| ### Remote Cluster Monitoring |
There was a problem hiding this comment.
This section will also need to be updated with the new flag
|
Enough changes to create a new PR. Moving to #1148 with updates to new style of collectors. |
The remote info collector (
es.remote_info) provides monitoring capabilities for Elasticsearch cross-cluster search and cross-cluster replication configurations. This collector queries the/_remote/infoendpoint to gather connection statistics for configured remote clusters.Why?
Allows for monitoring remote clusters disappearing or in a degraded state due to lack of connections to the cross-cluster search remote clusters