Skip to content

Conversation

smalyshev
Copy link
Contributor

@smalyshev smalyshev commented Nov 21, 2024

Adds _esql section to ccs metrics at _cluster/stats. Only available when any ES|QL queries have been performed.

@elasticsearchmachine
Copy link
Collaborator

Hi @smalyshev, I've created a changelog YAML for you.

@smalyshev smalyshev force-pushed the esql-telemetry branch 2 times, most recently from 30f6ac5 to f193a4d Compare November 22, 2024 22:25
Copy link
Contributor

@quux00 quux00 left a 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!

return ccsMetrics;
}

public CCSTelemetrySnapshot getEsqlMetrics() {
Copy link
Contributor

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";
Copy link
Contributor

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?

@smalyshev smalyshev force-pushed the esql-telemetry branch 4 times, most recently from fccea7f to 72bdb43 Compare December 14, 2024 04:22
@smalyshev smalyshev changed the title WIP: Add ESQL telemetry collection Add ESQL telemetry collection Dec 23, 2024
@smalyshev smalyshev added the auto-backport Automatically create backport pull requests when merged label Dec 23, 2024
@smalyshev smalyshev marked this pull request as ready for review December 23, 2024 22:40
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 23, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@smalyshev smalyshev requested a review from quux00 December 26, 2024 20:57
Copy link
Contributor

@quux00 quux00 left a 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.

Copy link
Contributor

@quux00 quux00 left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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?

Copy link
Contributor

@marciw marciw left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

fyi here's how this renders locally for me
Screenshot 2025-01-02 at 1 11 03 PM

Copy link
Contributor

@marciw marciw Jan 2, 2025

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

@smalyshev
Copy link
Contributor Author

Oops accidentally closed it, reopening as #119474

@smalyshev
Copy link
Contributor Author

Try to reopen this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants