Skip to content
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

Populate Cassandra cluster name from cluster metadata #759

Merged

Conversation

justinmir
Copy link
Contributor

@justinmir justinmir commented Nov 9, 2022

The cluster name label allows us to map the client queries back to the cluster they are being executed on. It can be used to determine client query error rates and latencies broken down by cluster and map these back to specific queries similar to how cassandra_client_name is used.

If the metadata field is not populated, this returns an empty string. The metadata field is populated on connect and refreshed at a regular interval, however, the cluster name will not change.

Closes #

💸 TL;DR

Introduces cassandra_cluster_name prometheus label for Cassandra client request metrics.
It can be used to determine client query error rates and latencies broken down by cluster and map these back to specific queries similar to how cassandra_client_name is used.

If the cluster does not return the cluster name metadata field, this returns an empty string. However,
the cluster name is populated as part of the Cassandra driver's connect call.

📜 Details

Baseplate.spec PR
Jira

🧪 Testing Steps / Validation

Unit test and integration test introduced.

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Reddit employee

The cluster name label allows us to map the client queries back to the
cluster they are being executed on. It can be used to determine client
query error rates and latencies broken down by cluster and map these
back to specific queries similar to how `cassandra_client_name` is
used.

If the metadata field is not populated, this returns an empty string.
The metadata field is populated on connect and refreshed at a regular
interval, however, the cluster name will not change.
@justinmir justinmir requested a review from a team as a code owner November 9, 2022 22:58
Copy link
Contributor

@kylelemons kylelemons left a comment

Choose a reason for hiding this comment

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

This is the original implementaiton, not the one that asks the cluster what its own name is, right?

@justinmir
Copy link
Contributor Author

justinmir commented Nov 10, 2022

This is the one that "asks" the cluster for its own name. In this case, the python cassandra driver already queries the cluster for a bunch of metadata on connection, including the cluster name, so we just use that queried cluster name - its the same as the cluster name returned by DESCRIBE CLUSTER.

Copy link
Contributor

@kylelemons kylelemons left a comment

Choose a reason for hiding this comment

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

Cool!

@justinmir justinmir merged commit 8f06455 into reddit:develop Nov 14, 2022
@justinmir justinmir deleted the cassandra-metrics-include-cluster branch November 14, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants