Skip to content

Conversation

@mhl-b
Copy link
Contributor

@mhl-b mhl-b commented Feb 20, 2025

Add counters for operations and requests for each combination of OperationPurpose and Operation for GCS blob store. Align with other BlobStore implementations (AWS and Azure).

Refactored GoogleCloudStorageHttpStatsCollector. Removed indirection of trackers and trackerFactories.

ES-10213
ES-10863

Copy link
Contributor

@nicktindall nicktindall left a comment

Choose a reason for hiding this comment

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

LGTM!

@mhl-b mhl-b changed the title gcp: add operation request counters GCP: add OperationPurpose/Operation stats counters Mar 6, 2025
@mhl-b mhl-b changed the title GCP: add OperationPurpose/Operation stats counters GCS: add OperationPurpose/Operation stats counters Mar 6, 2025
@mhl-b mhl-b changed the title GCS: add OperationPurpose/Operation stats counters GCS Blob Store: add OperationPurpose/Operation stats counters Mar 6, 2025
@mhl-b mhl-b changed the title GCS Blob Store: add OperationPurpose/Operation stats counters GCS blob store: add OperationPurpose/Operation stats counters Mar 6, 2025
@mhl-b mhl-b added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Coordination Meta label for Distributed Coordination team >enhancement labels Mar 6, 2025
@mhl-b mhl-b marked this pull request as ready for review March 6, 2025 04:30
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

@elasticsearchmachine
Copy link
Collaborator

Hi @mhl-b, I've created a changelog YAML for you.

@mhl-b
Copy link
Contributor Author

mhl-b commented Mar 6, 2025

@nicktindall , please take a look at the last commit a5549e4

I updated CAS test, added assertion for ignored request, and minor refactor in the test code.

Copy link
Contributor

@nicktindall nicktindall left a comment

Choose a reason for hiding this comment

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

LGTM

this.statsTracker = statsTracker;
var respCode = response.getStatusCode();
// Some of the intermediate and error codes are still counted as "good" requests
if (((respCode >= 200 && respCode < 300) || respCode == 308 || respCode == 404) == false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: for the first condition we could use org.elasticsearch.rest.RestStatus#isSuccessful, that logic was repeated in lots of places. Unless you think that obscures it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's more readable in this form since multiple codes are handled. I'm more concerned about codes I dont handle here, but we would like to.

this.tracker = new ServerlessTracker(bucketName);
} else {
this.tracker = new StatefulTracker();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like!

Copy link
Contributor

@nicktindall nicktindall left a comment

Choose a reason for hiding this comment

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

Very nice

@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Mar 11, 2025
@mhl-b mhl-b merged commit 053b037 into elastic:main Mar 12, 2025
17 checks passed
albertzaharovits pushed a commit to albertzaharovits/elasticsearch that referenced this pull request Mar 13, 2025
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement serverless-linked Added by automation, don't add manually Team:Distributed Coordination Meta label for Distributed Coordination team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants