-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add ESQL telemetry collection #117282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ESQL telemetry collection #117282
Conversation
Hi @smalyshev, I've created a changelog YAML for you. |
30f6ac5
to
f193a4d
Compare
.../plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/execution/PlanExecutor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestions. Looks good!
server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java
Outdated
Show resolved
Hide resolved
return ccsMetrics; | ||
} | ||
|
||
public CCSTelemetrySnapshot getEsqlMetrics() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested renamings:
getCcsMetrics -> getSearchCcsMetrics
getEsqlMetrics -> getEsqlCcsMetrics
final String clusterUUID; | ||
private final Map<String, RemoteClusterStats> remoteClustersStats; | ||
|
||
public static final String CCS_TELEMETRY_FIELD_NAME = "_search"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename to SEARCH_TELEMETRY_FIELD_NAME?
.../plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/execution/PlanExecutor.java
Outdated
Show resolved
Hide resolved
fccea7f
to
72bdb43
Compare
Pinging @elastic/es-analytical-engine (Team:Analytics) |
.../plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
Outdated
Show resolved
Hide resolved
.../plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress! Some suggested changes/questions left.
server/src/main/java/org/elasticsearch/action/admin/cluster/stats/CCSTelemetrySnapshot.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/cluster/stats/CCSUsage.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSessionCCSUtils.java
Outdated
Show resolved
Hide resolved
.../plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few optional nits. Nice work on this! Approved.
private final Map<String, LongAdder> clientCounts; | ||
private final Map<String, PerClusterCCSTelemetry> byRemoteCluster; | ||
// Should we calculate separate metrics per MRT? | ||
private boolean useMRT = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think the standard in Elasticsearch (based on my code reading at least) is to not define the default here, but rather to do it in the constructors.
So now the no-arg constructor should just call this(true)
and move all the initializations from the no-arg constructor to the new public CCSUsageTelemetry(boolean useMRT)
constructor.
private final ClusterHealthStatus clusterStatus; | ||
private final SearchUsageStats searchUsageStats; | ||
private final RepositoryUsageStats repositoryUsageStats; | ||
private final CCSTelemetrySnapshot ccsMetrics; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we rename this to searchMetrics
or searchCcsMetrics
and esqlMetrics to esqlCcsMetrics
. Otherwise these names are potentially confusing?
ef59b3d
to
0ca7517
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small drive-by style/clarity comments for stats.asciidoc
only
|
||
====== | ||
`_esql`::: | ||
(object) Contains the information about the ES|QL <<esql-cross-clusters,{ccs}>> usage in the cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(object) Contains the information about the ES|QL <<esql-cross-clusters,{ccs}>> usage in the cluster. | |
(object) Contains information about <<esql-cross-clusters,{esql} {ccs}>> usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: you can keep "in the cluster" if you like, but it somewhat impedes readability and is also already covered by the top-level ccs
description.
Also, if you like these edits, we should apply them to the _search
object description too (lines 1393-94 in this PR), which is probably where you got the phrasing in the first place. 🙂 Happy to do that in a separate commit; just let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smalyshev Whoops, this PR was closed while I was working on my brief docs review. Please disregard and I'll make this changes separately.
Edit: I'll apply my changes to #119474
Oops accidentally closed it, reopening as #119474 |
Try to reopen this |
Adds
_esql
section toccs
metrics at_cluster/stats
. Only available when any ES|QL queries have been performed.