Skip to content

Add Remote Info to data collection to monitor remote cluster connections - #1099

Closed
rtkkroland wants to merge 4 commits into
prometheus-community:masterfrom
rtkwlf:remote_info
Closed

Add Remote Info to data collection to monitor remote cluster connections#1099
rtkkroland wants to merge 4 commits into
prometheus-community:masterfrom
rtkwlf:remote_info

Conversation

@rtkkroland

Copy link
Copy Markdown

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/info endpoint 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

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>
@rtkgjacobs

Copy link
Copy Markdown

Hello everyone. Would love to see this new feature added, is there anything we can do to help move this PR along?

@sysadmind sysadmind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread collector/remote_info.go
@@ -0,0 +1,187 @@
// Copyright 2021 The Prometheus Authors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't put dates in our files anymore.

Suggested change
// Copyright 2021 The Prometheus Authors
// Copyright The Prometheus Authors

Comment thread collector/remote_info.go
}

// RemoteInfo information struct
type RemoteInfo struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread collector/remote_info.go
Comment on lines +48 to +49
up prometheus.Gauge
totalScrapes, jsonParseFailures prometheus.Counter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been removing these metrics from collectors.

Suggested change
up prometheus.Gauge
totalScrapes, jsonParseFailures prometheus.Counter

Comment thread collector/remote_info.go

// Labels for remote info metrics
var defaulRemoteInfoLabels = []string{"remote_cluster"}
var defaultRemoteInfoLabelValues = func(remote_cluster string) []string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread collector/remote_info.go
Help: "Number of errors while parsing JSON.",
}),
// Send all of the remote metrics
remoteInfoMetrics: []*remoteInfoMetric{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics descriptions should be package vars.

Comment thread collector/remote_info.go
}
}

func (c *RemoteInfo) fetchAndDecodeRemoteInfoStats() (RemoteInfoResponse, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can all get collapsed into the Update() func

@@ -0,0 +1,28 @@
// Copyright 2021 The Prometheus Authors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response can just go in the remote_info.go file. I don't see any benefit of putting it in a separate file.

Comment thread main.go
esInsecureSkipVerify = kingpin.Flag("es.ssl-skip-verify",
"Skip SSL verification when connecting to Elasticsearch.").
Default("false").Bool()
esExportRemoteInfo = kingpin.Flag("es.remote_info",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be necessary when using the Collector interface.

Comment thread README.md
| 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change to collector.remote-info

Comment thread README.md
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section will also need to be updated with the new flag

@rtkkroland

Copy link
Copy Markdown
Author

Enough changes to create a new PR. Moving to #1148 with updates to new style of collectors.

@rtkkroland rtkkroland closed this Mar 26, 2026
@rtkkroland
rtkkroland deleted the remote_info branch March 26, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants