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

fix: clarify behaviour of influxdb.cardinality() #5629

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

btasker
Copy link
Contributor

@btasker btasker commented Oct 2, 2024

The functionality of influxdb.cardinality() is not directly analogous to SHOW SERIES CARDINALITY because it's time bounded.

Unlike the InfluxQL command, it reports the cardinality of a specific dataset, but is often the cause of confusion as a result of being interpreted as providing the cardinality of the bucket as a whole.

There are various caveats which need to be considered when using it to obtain the cardinality of the bucket as a whole

  • start needs to be earlier than the earliest timestamp (some docs pages suggest 1 which is good)
  • stop needs to be later than the latest timestamp (the default is now() which is problematic if users are writing into the future)
  • There's a small nuance on replicated systems (such as Cloud2) - the reported value may depend on which replica has respond (results will be eventually consistent, but may not always directly match). Not sure we necessarily need to squeeze that in

Note: a corresponding change will need to be made in the Flux code comments, but I thought it best to work on wording here first.

Describe your proposed changes here.

@btasker btasker requested a review from sanderson October 2, 2024 14:29
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.

2 participants