From fa86db610f8b80eabe9797e2df98bb85af635f2d Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 20 May 2022 13:47:27 -0700 Subject: [PATCH] InfluxDB 2.x & Cloud FAQ (#4040) * WIP FAQ, add flux version query, closes #4032 * faq page for 2.x and cloud, closes #4029 * Apply suggestions from code review Co-authored-by: sunbryely-influxdata <101659702+sunbryely-influxdata@users.noreply.github.com> Co-authored-by: sunbryely-influxdata <101659702+sunbryely-influxdata@users.noreply.github.com> --- assets/js/content-interactions.js | 7 +- assets/styles/layouts/article/_buttons.scss | 36 + .../styles/layouts/modals/_url-selector.scss | 38 - .../cloud/query-data/flux/flux-version.md | 24 + content/influxdb/cloud/reference/faq.md | 10 + content/influxdb/cloud/reference/glossary.md | 2 +- .../influxdb/v2.1/users/change-password.md | 7 +- .../v2.2/query-data/flux/flux-version.md | 145 +++ .../v2.2/reference/contributing/_index.md | 2 +- content/influxdb/v2.2/reference/faq.md | 930 ++++++++++++++++++ content/influxdb/v2.2/reference/glossary.md | 4 +- .../influxdb/v2.2/users/change-password.md | 5 +- .../resolve-high-cardinality.md | 4 +- .../influxdb/v2.2/write-data/delete-data.md | 4 + 14 files changed, 1168 insertions(+), 50 deletions(-) create mode 100644 content/influxdb/cloud/query-data/flux/flux-version.md create mode 100644 content/influxdb/cloud/reference/faq.md create mode 100644 content/influxdb/v2.2/query-data/flux/flux-version.md create mode 100644 content/influxdb/v2.2/reference/faq.md diff --git a/assets/js/content-interactions.js b/assets/js/content-interactions.js index 04662df32..08dcd7c73 100644 --- a/assets/js/content-interactions.js +++ b/assets/js/content-interactions.js @@ -5,8 +5,11 @@ $(".article--content h2, \ .article--content h4, \ .article--content h5, \ .article--content h6" ).each(function() { - var link = "" - $(this).wrapInner( link ); + function getLink(element) { + return ((element.attr('href') === undefined ) ? $(element).attr("id") : element.attr('href')) + } + var link = "" + $(this).wrapInner( link ); }) ///////////////////////////////// Smooth Scroll ///////////////////////////////// diff --git a/assets/styles/layouts/article/_buttons.scss b/assets/styles/layouts/article/_buttons.scss index 3c2f0e27b..dd884dc63 100644 --- a/assets/styles/layouts/article/_buttons.scss +++ b/assets/styles/layouts/article/_buttons.scss @@ -48,3 +48,39 @@ a.btn { font-size: 1.1rem; } } + +///////////////////////////// InfluxDB URL Triggers //////////////////////////// + +.select-url { + margin: -2.5rem 0 1rem; + text-align: right; + display: none; +} + +.url-trigger { + padding: .25rem .5rem; + display: inline-block; + font-size: .85rem; + font-style: italic; + color: rgba($article-tab-code-text, .5); + background: $article-code-bg; + border-radius: 0 0 $radius $radius; + + &:before { + content: "\e924"; + display: inline-block; + margin-right: .35rem; + font-family: "icomoon-v2"; + font-style: normal; + font-size: .8rem; + } + + &:hover { + color: $article-tab-code-text; + } +} +li .url-trigger { padding: 0rem .5rem; } + +.code-tab-content { + .select-url{margin-top: -3.25rem} +} diff --git a/assets/styles/layouts/modals/_url-selector.scss b/assets/styles/layouts/modals/_url-selector.scss index b11c8ab11..4a753e42c 100644 --- a/assets/styles/layouts/modals/_url-selector.scss +++ b/assets/styles/layouts/modals/_url-selector.scss @@ -244,44 +244,6 @@ label:after { &.inactive { display: none; } } -///////////////////////////// InfluxDB URL Triggers //////////////////////////// - -.article--content { - .select-url { - margin: -2.5rem 0 1rem; - text-align: right; - display: none; - } - - .url-trigger { - padding: .25rem .5rem; - display: inline-block; - font-size: .85rem; - font-style: italic; - color: rgba($article-tab-code-text, .5); - background: $article-code-bg; - border-radius: 0 0 $radius $radius; - - &:before { - content: "\e924"; - display: inline-block; - margin-right: .35rem; - font-family: "icomoon-v2"; - font-style: normal; - font-size: .8rem; - } - - &:hover { - color: $article-tab-code-text; - } - } - li .url-trigger { padding: 0rem .5rem; } - - .code-tab-content { - .select-url{margin-top: -3.25rem} - } -} - ///////////////////////////////// MEDIA QUERIES //////////////////////////////// @include media(small) { diff --git a/content/influxdb/cloud/query-data/flux/flux-version.md b/content/influxdb/cloud/query-data/flux/flux-version.md new file mode 100644 index 000000000..ff44ac1ac --- /dev/null +++ b/content/influxdb/cloud/query-data/flux/flux-version.md @@ -0,0 +1,24 @@ +--- +title: Query the Flux version +seotitle: Query the version of Flux installed in InfluxDB Cloud +list_title: Query the Flux version +description: > + Use `runtime.version()` to return the version of Flux installed in InfluxDB Cloud. +weight: 221 +menu: + influxdb_cloud: + parent: Query with Flux + name: Flux version +influxdb/cloud/tags: [query] +related: + - /{{< latest "flux" >}}/stdlib/runtime/version/ +list_code_example: | + ```js + import "array" + import "runtime" + + array.from(rows: [{version: runtime.version()}]) + ``` +--- + +{{< duplicate-oss >}} diff --git a/content/influxdb/cloud/reference/faq.md b/content/influxdb/cloud/reference/faq.md new file mode 100644 index 000000000..7e18b0774 --- /dev/null +++ b/content/influxdb/cloud/reference/faq.md @@ -0,0 +1,10 @@ +--- +title: Frequently asked questions +description: Find answers to common questions related to InfluxDB OSS. +menu: + influxdb_cloud_ref: + name: Frequently asked questions +weight: 9 +--- + +{{< duplicate-oss >}} diff --git a/content/influxdb/cloud/reference/glossary.md b/content/influxdb/cloud/reference/glossary.md index 6fbc3619f..5cbdbeb83 100644 --- a/content/influxdb/cloud/reference/glossary.md +++ b/content/influxdb/cloud/reference/glossary.md @@ -2,7 +2,7 @@ title: Glossary description: > Terms related to InfluxData products and platforms. -weight: 8 +weight: 9 menu: influxdb_cloud_ref: name: Glossary diff --git a/content/influxdb/v2.1/users/change-password.md b/content/influxdb/v2.1/users/change-password.md index ee365c64b..41cd83090 100644 --- a/content/influxdb/v2.1/users/change-password.md +++ b/content/influxdb/v2.1/users/change-password.md @@ -17,19 +17,20 @@ User passwords cannot be updated in the InfluxDB UI. ## Change your password using the influx CLI -Use the [`influx user password` command](/influxdb/v2.1/reference/cli/influx/user/password) +Use the [`influx user password` command](/influxdb/v2.2/reference/cli/influx/user/password) to update a password for a user. To update a password, you need the following: - Username or user ID _(provided in the output of `influx user list`)_ - New password +- [Operator token](/influxdb/v2.2/security/tokens/#operator-token) ##### Update a password ```sh # Syntax -influx user password -n +influx user password -n -t # Example -influx user password -n johndoe +influx user password -n johndoe -t My5uPErSecR37t0k3n ``` When prompted, enter and confirm the new password. diff --git a/content/influxdb/v2.2/query-data/flux/flux-version.md b/content/influxdb/v2.2/query-data/flux/flux-version.md new file mode 100644 index 000000000..f8526c8db --- /dev/null +++ b/content/influxdb/v2.2/query-data/flux/flux-version.md @@ -0,0 +1,145 @@ +--- +title: Query the Flux version +seotitle: Query the version of Flux installed in InfluxDB +list_title: Query the Flux version +description: > + Use `runtime.version()` to return the version of Flux installed in InfluxDB. +weight: 221 +menu: + influxdb_2_2: + parent: Query with Flux + name: Flux version +influxdb/v2.2/tags: [query] +related: + - /{{< latest "flux" >}}/stdlib/runtime/version/ +list_code_example: | + ```js + import "array" + import "runtime" + + array.from(rows: [{version: runtime.version()}]) + ``` +--- + +InfluxDB {{< current-version >}} includes specific version of Flux that may or +may not support documented Flux functionality. +It's important to know what version of Flux you're currently using and what +functions are supported in that specific version. + +To query the version of Flux installed with InfluxDB, use `array.from()` to +create an ad hoc stream of tables and `runtime.version()` to populate a column +with the Flux version. + +{{% note %}} +Because the InfluxDB `/api/v2/query` endpoint can only return a stream of tables +and not single scalar values, you must use `array.from()` to create a stream of tables. +{{% /note %}} + +Run the following query in the **InfluxDB user interface**, with the **`influx` CLI**, +or **InfluxDB API**: + +```js +import "array" +import "runtime" + +array.from(rows: [{version: runtime.version()}]) +``` + +{{< tabs-wrapper >}} +{{% tabs %}} +[InfluxDB UI](#) +[influx CLI](#) +[InfluxDB API](#) +{{% /tabs %}} +{{% tab-content %}} + +To return the version of Flux installed with InfluxDB using the InfluxDB UI: + +1. Click **Data Explorer** in the left navigation bar. + + {{< nav-icon "data-explorer" >}} + +2. Click **{{% caps %}}Script Editor{{% /caps %}}** to manually create and + edit a Flux query. +3. Enable the **View Raw Data {{< icon "toggle" >}}** toggle or select one of the + following visualization types: + + - [Single Stat](/influxdb/v2.2/visualize-data/visualization-types/single-stat/) + - [Table](/influxdb/v2.2/visualize-data/visualization-types/table/) + +4. Enter and run the following query: + + ```js + import "array" + import "runtime" + + array.from(rows: [{version: runtime.version()}]) + ``` + +{{% /tab-content %}} +{{% tab-content %}} + +To return the version of Flux installed with InfluxDB using the `influx` CLI, +use the `influx query` command. Provide the following: + +- InfluxDB **host**, **organization**, and **API token** + _(the example below assumes that a + [CLI configuration](/influxdb/v2.2/reference/cli/influx/#provide-required-authentication-credentials) + is set up and active)_ +- Query to execute + +```sh +$ influx query \ + 'import "array" + import "runtime" + + array.from(rows: [{version: runtime.version()}])' + +# Output +Result: _result +Table: keys: [] + version:string +---------------------- + v0.161.0 +``` +{{% /tab-content %}} + +{{% tab-content %}} + +To return the version of Flux installed with InfluxDB using the InfluxDB API, +use the [`/api/v2/query` endpoint](/influxdb/v2.2/api/#tag/Query). + +{{< api-endpoint method="POST" endpoint="http://localhost:8086/api/v2/query" >}} +Provide the following: + +- InfluxDB {{% cloud-only %}}Cloud{{% /cloud-only %}} host +- InfluxDB organization name or ID as a query parameter +- `Authorization` header with the `Token` scheme and your API token +- `Accept: application/csv` header +- `Content-type: application/vnd.flux` header +- Query to execute as the request body + +```sh +curl --request POST \ + http://localhost:8086/api/v2/query?orgID=INFLUX_ORG_ID \ + --header 'Authorization: Token INFLUX_TOKEN' \ + --header 'Accept: application/csv' \ + --header 'Content-type: application/vnd.flux' \ + --data 'import "array" + import "runtime" + + array.from(rows: [{version: runtime.version()}])' + +# Output +,result,table,version +,_result,0,v0.161.0 +``` + +{{% /tab-content %}} + +{{% warn %}} +#### Flux version in the Flux REPL +When you run `runtime.version()` in the [Flux REPL](/influxdb/v2.2/tools/repl/), +the function returns the version of Flux the REPL was built with, not the version +of Flux installed in the instance of InfluxDB you're querying. +{{% /warn %}} \ No newline at end of file diff --git a/content/influxdb/v2.2/reference/contributing/_index.md b/content/influxdb/v2.2/reference/contributing/_index.md index 8c75f8e13..459e20547 100644 --- a/content/influxdb/v2.2/reference/contributing/_index.md +++ b/content/influxdb/v2.2/reference/contributing/_index.md @@ -4,7 +4,7 @@ description: Find important information about what's included in new versions of menu: influxdb_2_2_ref: name: Contribute to InfluxDB - weight: 10 + weight: 11 --- To contribute to the InfluxDB OSS project, complete the following steps: diff --git a/content/influxdb/v2.2/reference/faq.md b/content/influxdb/v2.2/reference/faq.md new file mode 100644 index 000000000..50b7e4126 --- /dev/null +++ b/content/influxdb/v2.2/reference/faq.md @@ -0,0 +1,930 @@ +--- +title: Frequently asked questions +description: Find answers to common questions related to InfluxDB OSS. +menu: + influxdb_2_2_ref: + name: Frequently asked questions +weight: 9 +--- + +##### Account management {href="account-management-1"} +- [How do I reset my password?](#how-do-i-reset-my-password) +- {{% cloud-only %}}[How do I switch between InfluxDB Cloud accounts?](#how-do-i-switch-between-influxdb-cloud-accounts){{% /cloud-only %}} + +{{% cloud-only %}} + +##### Billing and usage {href="billing-and-usage-1"} +- [How do I manage payment methods?](#how-do-i-manage-payment-methods) +- [Who do I contact for billing issues?](#who-do-i-contact-for-billing-issues) +- [How do I view data my data usage?](#how-do-i-view-data-my-data-usage) +- [How do I increase my organization's rate limits and quotas?](#how-do-i-increase-my-organizations-rate-limits-and-quotas) + +{{% /cloud-only %}} + +{{% cloud-only %}} + +##### InfluxDB Cloud service health {href="influxdb-cloud-service-health-1"} +- [Where can I see the current status of InfluxDB Cloud?](#where-can-i-see-the-current-status-of-influxdb-cloud) + +{{% /cloud-only %}} + +{{% oss-only %}} + +##### InfluxDB service health {href="influxdb-service-health-1"} +- [Where can I see the current status of my InfluxDB instance?](#where-can-i-see-the-current-status-of-my-influxdb-instance) + +{{% /oss-only %}} + +##### Security {href="security-1"} +- [What different types of API tokens exist?](#what-different-types-of-api-tokens-exist) +- [Can I use InfluxDB with authentication disabled?](#can-i-use-influxdb-with-authentication-disabled) +- {{% cloud-only %}}[Can you change the permission level of members in your organization?](#can-you-change-the-permission-level-of-members-in-your-organization){{% /cloud-only %}} + +##### Administration {href="administration-1"} +- {{% oss-only %}}[How can I identify my InfluxDB version?](#how-can-i-identify-my-influxdb-version){{% /oss-only %}} +- [How can I identify the version of Flux I'm using in InfluxDB?](#how-can-i-identify-the-version-of-flux-im-using-in-influxdb) +- {{% oss-only %}}[Where can I find InfluxDB logs?](#where-can-i-find-influxdb-logs){{% /oss-only %}} +- {{% oss-only %}}[What is the relationship between shard group durations and retention periods?](#what-is-the-relationship-between-shard-group-durations-and-retention-periods){{% /oss-only %}} +- [Why isn't data dropped after I update a bucket's retention period?](#why-isnt-data-dropped-after-i-update-a-buckets-retention-period) + +##### Data types {href="data-types-1"} +- [What are the minimum and maximum integers that InfluxDB can store?](#what-are-the-minimum-and-maximum-integers-that-influxdb-can-store) +- [What are the minimum and maximum timestamps that InfluxDB can store?](#what-are-the-minimum-and-maximum-timestamps-that-influxdb-can-store) +- [Can I change a field's data type?](#can-i-change-a-fields-data-type) + +##### Writing data {href="writing-data"} +- [How do I write integer and unsigned integer field values?](#how-do-i-write-integer-and-unsigned-integer-field-values) +- [How does InfluxDB handle duplicate points?](#how-does-influxdb-handle-duplicate-points) +- [What newline character does the InfluxDB write API require?](#what-newline-character-does-the-influxdb-write-api-require) +- [When should I single quote and when should I double quote when writing data?](#when-should-i-single-quote-and-when-should-i-double-quote-when-writing-data) +- [Does the precision of the timestamp matter?](#does-the-precision-of-the-timestamp-matter) +- {{% oss-only %}}[What are the configuration recommendations and schema guidelines for writing sparse, historical data?](#what-are-the-configuration-recommendations-and-schema-guidelines-for-writing-sparse-historical-data){{% /oss-only %}} + +##### Querying data {href="querying-data-1"} +- [Flux](#flux) + - [How do I structure fields as columns (like InfluxQL)?](#how-do-i-structure-fields-as-columns-like-influxql) + - [How can I derive a state from multiple field values?](#how-can-i-derive-a-state-from-multiple-field-values) +- [InfluxQL](#influxql) + - {{% cloud-only %}}[How do I use InfluxQL with InfluxDB Cloud?](#how-do-i-use-influxql-with-influxdb-cloud){{% /cloud-only %}} + - {{% oss-only %}}[How do I use InfluxQL with InfluxDB v2.x?](#how-do-i-use-influxql-with-influxdb-v2x){{% /oss-only %}} + - [How do I perform mathematical operations in an InfluxQL function?](#how-do-i-perform-mathematical-operations-in-an-influxql-function) + - [Why does my query return epoch 0 as the timestamp?](#why-does-my-query-return-epoch-0-as-the-timestamp) + - [Which InfluxQL functions support nesting?](#which-influxql-functions-support-nesting) + - [What determines the time intervals returned by `GROUP BY time()` queries?](#what-determines-the-time-intervals-returned-by-group-by-time-queries) + - [Why do my queries return no data or partial data?](#why-do-my-queries-return-no-data-or-partial-data) + - [Why don't my `GROUP BY time()` queries return timestamps that occur after `now()`?](#why-dont-my-group-by-time-queries-return-timestamps-that-occur-after-now) + - [Can I perform mathematical operations against timestamps?](#can-i-perform-mathematical-operations-against-timestamps) + - [Can I identify write precision from returned timestamps?](#can-i-identify-write-precision-from-returned-timestamps) + - [When should I use single quote versus double quotes in a query?](#when-should-i-use-single-quote-versus-double-quotes-in-a-query) + - [Why is my query with a `WHERE OR` time clause returning empty results?](#why-is-my-query-with-a-where-or-time-clause-returning-empty-results) + - [Why does `fill(previous)` return empty results?](#why-does-fillprevious-return-empty-results) + - [How do I query data with an identical tag key and field key?](#how-do-i-query-data-with-an-identical-tag-key-and-field-key) + - [How do I query data across measurements?](#how-do-i-query-data-across-measurements) + - [Does the order timestamps in a query matter?](#does-the-order-timestamps-in-a-query-matter) + - [How do I query data by a tag with a null value?](#how-do-i-query-data-by-a-tag-with-a-null-value) + +##### Series and series cardinality {href="series-and-series-cardinality-1"} +- [What is series cardinality?](#what-is-series-cardinality) +- [Why does series cardinality matter?](#why-does-series-cardinality-matter) +- {{% oss-only %}}[How do I remove series from the index?](#how-do-i-remove-series-from-the-index){{% /oss-only %}} + +--- + +## Account management + +#### How do I reset my password? + +{{% cloud-only %}} + +Use the **Forgot Password** link on the InfluxDB Cloud login page to update your +password. For more information, see +[Change your password](/influxdb/cloud/account-management/change-password/). + +{{% /cloud-only %}} + +{{% oss-only %}} + +Use the [`influx` CLI](/influxdb/v2.2/reference/cli/influx/) and the +[`influx user password` command](/influxdb/v2.2/reference/cli/influx/user/password/) +command to update a user's password. +For more information, see +[Change your password](/influxdb/v2.2/users/change-password/). + +{{% /oss-only %}} + +{{% cloud-only %}} + +#### How do I switch between InfluxDB Cloud accounts? +Use the **Switch Accounts** functionality in your InfluxDB Cloud account settings +to switch between InfluxDB Cloud accounts. +For more information, see [Switch InfluxDB Cloud accounts](/influxdb/cloud/account-management/switch-account/). + +--- + +## Billing and usage + +#### How do I manage payment methods? +- If you subscribed to InfluxDB Cloud through InfluxData, you can manage payment + methods in the [Billing section](https://cloud2.influxdata.com/me/billing) of + your InfluxDB Cloud account. +- If you subscribed to InfluxDB Cloud through a cloud provider marketplace + (**AWS Marketplace**, **Azure Marketplace**, or **GCP Marketplace**), + use your cloud provider's billing administration to manage payment methods. + +For more information, see [Manage InfluxDB Cloud billing](/influxdb/cloud/account-management/billing/). + +#### Who do I contact for billing issues? +For billing issues, please [contact InfluxData support](https://support.influxdata.com/s/contactsupport). + +#### How do I view data my data usage? +To view your InfluxDB Cloud organization's data usage, view the [Usage page](https://cloud2.influxdata.com/me/usage) +in the InfluxDB Cloud user interface. For more information, see +[View InfluxDB Cloud data usage](/influxdb/cloud/account-management/data-usage/). + +#### How do I increase my organization's rate limits and quotas? +- If using the InfluxDB Cloud [Free Plan](/influxdb/cloud/account-management/pricing-plans/#free-plan), + for increased rate limits and quotas, upgrade to a + [Usage-Based](/influxdb/cloud/account-management/pricing-plans/#usage-based-plan) + or [Annual Plan](/influxdb/cloud/account-management/pricing-plans/#annual-plan). +- If using a **Usage-Based** or **Annual** Plan, [contact InfluxData support](https://support.influxdata.com/s/contactsupport) + and request rate limit and quota adjustments. + +{{% /cloud-only %}} + +--- + +{{% cloud-only %}} + +## InfluxDB Cloud service health + +#### Where can I see the current status of InfluxDB Cloud? +InfluxDB Cloud regions and underlying services are monitored at all times. +To see the current status of InfluxDB Cloud, view the [InfluxDB Cloud status page](https://status.influxdata.com). +To receive outage alerts and updates, subscribe to our status page. + +{{% /cloud-only %}} + +{{% oss-only %}} + +## InfluxDB service health + +#### Where can I see the current status of my InfluxDB instance? +InfluxDB {{< current-version >}} provides different ways to monitor its status: + +- The [`/health` API endpoint](/influxdb/v2.2/api/#tag/Health) returns a JSON + body with a summary of the current status of your InfluxDB instance. + +{{% expand-wrapper %}} +{{% expand "View example health summary" %}} +``` +{ + "name": "influxdb", + "message": "ready for queries and writes", + "status": "pass", + "checks": [], + "version": "{{< latest-patch >}}", + "commit": "xx00x0x000" +} +``` +{{% /expand %}} +{{% /expand-wrapper %}} + +- The [`/metrics` API endpoint](/influxdb/v2.2/api/#tag/Metrics) provides internal + InfluxDB metrics in Prometheus exposition format. Use [Telegraf](/{{< latest "telegraf" >}}/), + [InfluxDB scrapers](/influxdb/v2.2/write-data/no-code/scrape-data/), or the Flux + [`prometheus.scrape()` function](/flux/v0.x/stdlib/experimental/prometheus/scrape/) + to scrape these metrics and store them in InfluxDB where you can monitor and + alert on any anomalies. + + You can also use the [InfluxDB Open Source (OSS) Metrics template](https://github.com/influxdata/community-templates/tree/master/influxdb2_oss_metrics) + quickly setup InfluxDB OSS monitoring. + + For more information, see [Monitor InfluxDB OSS using a template](/influxdb/v2.2/monitor-alert/templates/monitor/) + +{{% /oss-only %}} + +--- + +## Security + +#### What different types of API tokens exist? +InfluxDB {{< current-version >}} supports the following token types: + +- {{% oss-only %}}Operator tokens{{% /oss-only %}} +- All-Access tokens +- {{% cloud-only %}}Custom tokens{{% /cloud-only %}} +- {{% oss-only %}}Read/Write tokens{{% /oss-only %}} + +For more information about each token type, see [Manage API tokens](/influxdb/v2.2/security/tokens/). + +#### Can I use InfluxDB with authentication disabled? +InfluxDB {{< current-version >}} enforces security best practices by requiring +API requests to be authenticated. Authentication cannot be disabled. + +{{% cloud-only %}} + +#### Can you change the permission level of members in your organization? +InfluxDB Cloud has only one permission level for users: Owner. +With Owner permissions, a user can delete resources and other users from your organization. +Take care when inviting a user. + +{{% /cloud-only %}} + +--- + +## Administration + +{{% oss-only %}} + +#### How can I identify my InfluxDB version? + +Use one of the following methods to identify the version of InfluxDB OSS you're using: + +- **Use the InfluxDB UI**: + - On the user login page + - In the right column of the main landing page + +- **Use the `influxd version` command** + + ```bash + $ influxd version + + InfluxDB {{< latest-patch >}} (git: x0x000xx0x) build_date: YYYY-MM-DDThh:mm:ssZ + ``` + +- **Use the `/health` API endpoint**. + + The following example uses [`jq`](https://stedolan.github.io/jq/) to process the + JSON body returned from the `/health` API endpoint and extract the InfluxDB version. + You don't have to process the JSON with `jq`. For an example of the JSON + returned by the `/health` endpoint, see [View example health summary](#view-example-health-summary). + + ```bash + $ curl -s http://localhost:8086/health | jq -r '.version' + + {{< latest-patch >}} + ``` + +{{% /oss-only %}} + +#### How can I identify the version of Flux I'm using in InfluxDB? +To see what version of Flux is used in InfluxDB {{< current-version >}}, +run the following query: + +```js +import "array" +import "runtime" + +array.from(rows: [{version: runtime.version()}]) +``` + +For more information, see [Query the Flux version](/influxdb/cloud/query-data/flux/flux-version/). + +{{% oss-only %}} + +#### Where can I find InfluxDB logs? +All InfluxDB logs are output by the `influxd` service. +To store logs to a file, pipe the output of `influxd` to a file. For example: + +``` +influxd 2>~/path/to/influxd-errors.log +``` + +#### What is the relationship between shard group durations and retention periods? +InfluxDB buckets store data in shard groups. +A single shard group covers a specific time interval. +InfluxDB determines that time interval by using the retention period of the bucket. +The table below outlines the default relationship between the bucket retention +period and the time interval of a shard group: + +| Bucket retention period | Default shard group duration | +| :-------------------------- | ---------------------------: | +| less than 2 days | 1h | +| between 2 days and 6 months | 1d | +| greater than 6 months | 7d | + +For more information, see [InfluxDB Shards and shard groups](/influxdb/v2.2/reference/internals/shards/). + +{{% /oss-only %}} + +#### Why isn't data dropped after I update a bucket's retention period? +Below are reasons why data may not be dropped immediately after updating +the retention period of a bucket: + +- **The retention enforcement service runs {{% cloud-only %}}hourly{{% /cloud-only %}}{{% oss-only %}}every 30 minutes (by default){{% /oss-only %}}**. + You may need to wait for the next retention enforcement cycle to run. + +- {{% oss-only %}} + + **InfluxDB drops shard groups, not individual points**. + Shard groups cover a specific time interval assigned to the shard group on creation. + The retention service will only delete a shard group when the entire time + range covered by the shard group is beyond the bucket retention period. + + If the bucket's new retention period is less than the old shard group duration + and InfluxDB is currently writing data to the old, longer shard group, the + the retention service will not drop old shard group until its assigned + interval is fully expired. + + {{% /oss-only %}} + +For more information, see [Data retention](/influxdb/v2.2/reference/internals/data-retention/). + + + +--- + +## Data types + +#### What are the minimum and maximum integers that InfluxDB can store? +InfluxDB stores all integers as signed 64bit integers. + +**Minimum integer**: `-9023372036854775808` +**Maximum integer**: `9023372036854775807` + +Values close to but within those limits may lead to unexpected behavior. +Some query operations convert 64bit integers to 64bit float values +which can cause overflow issues. + +#### What are the minimum and maximum timestamps that InfluxDB can store? +InfluxDB uses 64bit integers to represent Unix nanosecond timestamps. + +**Minimum timestamp**: `-9223372036854775806` or `1677-09-21T00:12:43.145224194Z` +**Maximum timestamp**: `9223372036854775806` or `2262-04-11T23:47:16.854775806Z` + +Timestamps outside that range return a parsing error. + +#### Can I change a field's data type? +[Flux type-conversion functions](/flux/v0.x/function-types/#type-conversions) let +you change a fields data type at query time. +However, you cannot change the type of a field on disk. +Below are some possible workarounds: + +- **Copy a field to a new field as a different type.** + The example below does the following: + + - Queries the `example-string-field`. + - Converts field values to booleans. + - Changes the field name to `example-boolean-field`. + - Writes the new field to the source bucket. + + ```javascript + from(bucket: "example-bucket") + |> range(start: -30d) + |> filter(fn: (r) => r._measurement == "exampled-measurement") + |> filter(fn: (r) => r._field == "example-string-field") + |> toBool() + |> set(key: "_field", as: "example-boolean-field") + |> to(bucket: "example-bucket") + ``` + +- **Copy a field to a new bucket as a different type.** + The example below does the following: + + - Queries the `example-int-field` from the `example-bucket-1` bucket. + - Converts field values to float values. + - Changes the field name to `example-float-field`. + - Writes the new field to the `example-bucket-2` bucket. + + ```javascript + from(bucket: "example-bucket-1") + |> range(start: -30d) + |> filter(fn: (r) => r._measurement == "exampled-measurement") + |> filter(fn: (r) => r._field == "example-int-field") + |> toFloat() + |> set(key: "_field", as: "example-float-field") + |> to(bucket: "example-bucket-2") + ``` + +--- + +## Writing data + +#### How do I write integer and unsigned integer field values? + +In line protocol, identify **integers** with a trailing `i` and **unsigned integers** +with a trailing `u`. Without these, numeric field values are parsed as floats. + +```sh +# Integer +value=100i + +# Unsigned integer +value=100u + +# Float +value=100 +``` + +#### How does InfluxDB handle duplicate points? + +InfluxDB uniquely identifies a point by its **measurement**, **tag set**, and **timestamp**. +If you submit a new point with the same measurement, tag set, and timestamp as +an existing point, InfluxDB unions the old field with the new field set, and +any ties go to the new field set. + +For more information, see [Handle duplicate data points](/influxdb/v2.2/write-data/best-practices/duplicate-points/). + +#### What newline character does the InfluxDB write API require? + +InfluxDB line protocol relies on line feed (`\n`, which is ASCII `0x0A`) to +indicate the end of one line and the beginning of a new line. +Files or data that use a newline character other than `\n` will result in errors +similar to `bad timestamp` or `unable to parse`. + +{{% note %}} +##### Windows newlines +Windows uses carriage return and line feed (`\r\n`) as the newline character which +will result in an error if you manually write line protocol on a Windows machine. +Strip out any carriage returns (`\r`) before submitting the line protocol to the +InfluxDB write API. +{{% /note %}} + +#### When should I single quote and when should I double quote when writing data? + +Line protocol quote usage guidelines are provided in the +[line protocol documentation](/influxdb/cloud/reference/syntax/line-protocol/#quotes). + +#### Does the precision of the timestamp matter? + +Yes. Timestamp precision affects ingest performance. +The more precise the timestamp, the longer it takes to write the point. +To maximize performance, use the coarsest possible timestamp precision when +writing data to InfluxDB. However, if too coarse, you risk writing points from +the same series with the same timestamp, which would be treated as +[duplicate points](/influxdb/v2.2/write-data/best-practices/duplicate-points/). + +{{% oss-only %}} + +#### What are the configuration recommendations and schema guidelines for writing sparse, historical data? + +For sparse historical data, we recommend: + +- **Use a longer [shard group duration](/influxdb/v2.2/reference/internals/shards/#shard-group-duration) + on the bucket you're writing historical data to.** + Historical shard group durations can and should cover several years. + If your historical data spans many years, but your bucket's shard group duration + is 1 week, InfluxDB will create many shards, negatively affecting overall performance. + +- **Temporarily lower the + [`storage-cache-snapshot-write-cold-duration` configuration setting](/influxdb/v2.2/reference/config-options/#storage-cache-snapshot-write-cold-duration) + while ingesting historical data**. + The default setting (`10m`) can cause the system cache all of your data for every shard. + Temporarily lowering the `storage-cache-snapshot-write-cold-duration` setting + to `10s` while you write the historical data makes the process more efficient. + +{{% /oss-only %}} + +--- + +## Querying data + +### Flux + +#### How do I structure fields as columns (like InfluxQL)? +A `SELECT` statement in InfluxQL returns data with a column for each queried tag and field. +The Flux [`from()`](/flux/v0.x/stdlib/influxdata/influxdb/from/) function returns +data with a column for each tag as well as a `_field` column that contains the +field key. Each field is grouped into a different table. + +To structure each field as a column, use either [`pivot()`](/flux/v0.x/stdlib/universe/pivot/) +or [`schema.fieldsAsCols()`](/flux/v0.x/stdlib/influxdata/influxdb/schema/fieldsascols/). + +{{< code-tabs-wrapper >}} +{{% code-tabs %}} +[pivot()](#) +[schema.fieldsAsCols](#) +{{% /code-tabs %}} +{{% code-tab-content %}} +```js +exampleData + |> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value") +``` +{{% /code-tab-content %}} +{{% code-tab-content %}} +```js +import "influxdata/influxdb/schema" + +exampleData + |> schema.fieldsAsCols() +``` +{{% /code-tab-content %}} +{{< /code-tabs-wrapper >}} + +###### Example data returned by from() +| _measurement | sensor_id | location | _field | _time | _value | +| :----------- | :-------- | :-------- | :----- | :------------------- | -----: | +| machine | abc123 | station20 | temp | 2022-01-01T00:00:00Z | 150.1 | +| machine | abc123 | station20 | temp | 2022-01-01T00:00:10Z | 152.8 | +| machine | abc123 | station20 | temp | 2022-01-01T00:00:20Z | 153.3 | + +| _measurement | sensor_id | location | _field | _time | _value | +| :----------- | :-------- | :-------- | :----- | :------------------- | -----: | +| machine | abc123 | station20 | flow | 2022-01-01T00:00:00Z | 12.2 | +| machine | abc123 | station20 | flow | 2022-01-01T00:00:10Z | 14.9 | +| machine | abc123 | station20 | flow | 2022-01-01T00:00:20Z | 16.1 | + +###### Example pivoted data +| _measurement | sensor_id | location | _time | temp | flow | +| :----------- | :-------- | :-------- | :------------------- | ----: | ---: | +| machine | abc123 | station20 | 2022-01-01T00:00:00Z | 150.1 | 12.2 | +| machine | abc123 | station20 | 2022-01-01T00:00:10Z | 152.8 | 14.9 | +| machine | abc123 | station20 | 2022-01-01T00:00:20Z | 153.3 | 16.1 | + +#### How can I derive a state from multiple field values? +To compare multiple field values and derive a state: + +1. Query all fields necessary to derive a state. +1. Use `pivot()` or `schema.fieldsAsCols()` to pivot fields into columns. +2. Use `map()` to iterate over each input row assign a new column value based + on values in the field columns. + + The `fn` parameter of `map()` defines a + functions that outputs a record for each input row. Use conditional + logic to assign a state. + +```js +from(bucket: "example-bucket") + |> range(start: -1h) + |> filter(fn: (r) => r._measurement == "example-measurement") + |> filter(fn: (r) => r._field == "field1" or r._field == "field2") + |> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value") + |> map( + fn: (r) => + ({r with state: + if r.field1 > 90 and r.field2 < 10 then + "critical" + else if r.field1 > 70 and r.field2 < 30 then + "warning" + else if r.field1 > 40 and r.field2 < 60 then + "info" + else + "ok", + }), + ) +``` + +### InfluxQL + +{{% cloud-only %}} + +#### How do I use InfluxQL with InfluxDB Cloud? + +{{% /cloud-only %}} + +{{% oss-only %}} + +#### How do I use InfluxQL with InfluxDB v2.x? + +{{% /oss-only %}} + +Using InfluxQL with InfluxDB {{< current-version >}} is made possible by the +[1.x compatiblity API](/influxdb/v2.2/reference/api/influxdb-1x/) which replicates +the `/query` endpoint from InfluxDB 1.x. This allows all InfluxDB 1.x-compatible +clients to work with InfluxDB {{< current-version >}}. However, InfluxQL relies +on a database and retention policy data model doesn't exist in InfluxDB +{{< current-version >}}, but has been replaced by [buckets](influxdb/v2.2/reference/glossary/#bucket). + +InfluxDB {{< current-version >}} lets you map unique database and retention +policy combinations used in InfluxQL to specific buckets using DBRP mappings. + +For detailed instructions on using InfluxQL with InfluxDB {{< current-version >}} +and configuring DBRP mapping, see [Query with InfluxQL](influxdb/v2.2/query-data/influxql/). + +#### How do I perform mathematical operations in an InfluxQL function? +InfluxQL does not support mathematical operations within functions. +Use a [subquery](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#subqueries) to perform +the mathematical calculation. + +For example, InfluxQL does not support the following syntax: + +```sql +SELECT MEAN("dogs" - "cats") from "pet_daycare" +``` + +Instead, use a subquery to get the same result: + +```sql +SELECT MEAN("difference") FROM (SELECT "dogs" - "cat" AS "difference" FROM "pet_daycare") +``` + +#### Why does my query return epoch 0 as the timestamp? +In InfluxQL, epoch 0 (`1970-01-01T00:00:00Z`) is often used as a null timestamp equivalent. +If you request a query that has no timestamp to return, such as an aggregation +function with an unbounded time range, InfluxDB returns epoch 0 as the timestamp. + +#### Which InfluxQL functions support nesting? +The following InfluxQL functions support nesting: + +- [`COUNT()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#count) with [`DISTINCT()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#distinct) +- [`CUMULATIVE_SUM()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#cumulative-sum) +- [`DERIVATIVE()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#derivative) +- [`DIFFERENCE()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#difference) +- [`ELAPSED()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#elapsed) +- [`MOVING_AVERAGE()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#moving-average) +- [`NON_NEGATIVE_DERIVATIVE()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#non-negative-derivative) +- [`HOLT_WINTERS()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#holt-winters) and [`HOLT_WINTERS_WITH_FIT()`](/{{< latest "influxdb" "v1" >}}/query_language/functions/#holt-winters) + +For information on how to use subqueries as substitutes for nested functions, see +[InfluxQL data exploration](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#subqueries). + +#### What determines the time intervals returned by `GROUP BY time()` queries? +The time intervals returned by `GROUP BY time()` queries conform to the InfluxDB +database's preset time windows or to the user-specified +[offset interval](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#advanced-group-by-time-syntax). + +###### Preset time windows +For example, the following query calculates the average value of `sunflowers` between +6:15pm and 7:45pm and groups those averages into one hour intervals: + +```sql +SELECT mean("sunflowers") +FROM "flower_orders" +WHERE time >= '2016-08-29T18:15:00Z' AND time <= '2016-08-29T19:45:00Z' GROUP BY time(1h) +``` + +InfluxQL uses the duration specified in the `GROUP BY time()` clause to partition +data based on time. Preset time window boundaries fall on the duration unit specified. + +For example: + +| GROUP BY time() duration | Resulting window boundaries | +| :----------------------- | :--------------------------------------------- | +| 1s | 00:00:00 - 00:00:01, 00:00:01 - 00:00:02, etc. | +| 1m | 00:00:00 - 00:01:00, 00:01:00 - 00:02:00, etc. | +| 5m | 00:00:00 - 00:05:00, 00:05:00 - 00:10:00, etc. | +| 1h | 00:00:00 - 01:00:00, 01:00:00 - 02:00:00, etc. | + +Although window boundaries may fall outside of the queried time range, only +points within the queried time range are used in the calculation for each window. + +###### Offset time windows +As another example, the following query calculates the average value of +`sunflowers` between 6:15pm and 7:45pm and groups those averages into one hour intervals. +It offsets the InfluxDB database's preset time windows by `15` minutes. + +```sql +SELECT mean("sunflowers") +FROM "flower_orders" +WHERE time >= '2016-08-29T18:15:00Z' AND time <= '2016-08-29T19:45:00Z' GROUP BY time(1h,15m) + --- + | + offset interval +``` + +InfluxQL uses the duration and offset specified in the `GROUP BY time()` clause to partition +data based on time. Time boundaries begin at the specified offset. + +For example: + +| GROUP BY time() duration and offset | Resulting window boundaries | +| :---------------------------------- | :--------------------------------------------- | +| 1m,30s | 00:30:00 - 01:30:00, 01:30:00 - 02:30:00, etc. | +| 5m,15s | 00:00:15 - 00:05:15, 00:05:15 - 00:10:15, etc. | +| 1h,20m | 00:20:00 - 01:20:00, 01:20:00 - 02:20:00, etc. | + +#### Why do my queries return no data or partial data? + +The most common reasons why your query returns no data or partial data: + +- [Querying the wrong retention policy](#querying-the-wrong-retention-policy) (no data returned) +- [No field key in the SELECT clause](#no-field-key-in-the-select-clause) (no data returned) +- [SELECT query includes `GROUP BY time()`](#select-query-includes-group-by-time) (partial data before `now()` returned) +- [Tag and field key with the same name](#tag-and-field-key-with-the-same-name) + +##### Querying the wrong retention policy + +InfluxDB automatically queries data in a database’s default retention policy +(configured as part of a [DBRP mapping](/influxdb/v2.2/query-data/influxql/)). +If your data is associated another retention policy, you must specify the correct +retention policy to get results. + +##### No field key in the SELECT clause + +An InfluxQL query requires at least one **field key** in the `SELECT` clause. +If the `SELECT` clause includes only **tag keys**, the query returns an empty response. +For more information, see +[InfluxQL Data exploration](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#common-issues-with-the-select-statement). + +##### SELECT query includes `GROUP BY time()` + +If your `SELECT` query includes a [`GROUP BY time()` clause](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#group-by-time-intervals), +only data points between `1677-09-21 00:12:43.145224194` and +[`now()`](/{{< latest "influxdb" "v1" >}}/concepts/glossary/#now) are returned. +If any of your data points occur after `now()`, specify +[an alternative upper bound](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#time-syntax) +in your time interval. + +##### Tag and field key with the same name + +Avoid using the same name for a tag and field key. +If you inadvertently add the same name for a tag and field key, and then query +both together, the query results show the second key queried (tag or field) +appended with `_1`. To query a tag or field key appended with `_1`, +you **must drop** the appended `_1` **and include** the syntax `::tag` or `::field`. +For example: + +```sql +-- Query duplicate keys using the correct syntax +SELECT "leaves"::tag, "leaves"::field FROM db.rp."grape" + +name: grape +time leaves leaves_1 +---- -------- ---------- +1574128162128468000 species 6.00 +1574128238044155000 5.00 +``` + +#### Why don't my `GROUP BY time()` queries return timestamps that occur after `now()`? + +`SELECT` statements without a time range defined in the `WHERE` clause have a +default time range of `1677-09-21 00:12:43.145224194` to `2262-04-11T23:47:16.854775806Z` UTC. +For `SELECT` statements that don't specify a time range but have a +[`GROUP BY time()` clause](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#group-by-time-intervals), +the default time range is `1677-09-21 00:12:43.145224194` UTC to [`now()`](/influxdb/v2.2/reference/glossary/#now). + +To query data with timestamps that occur after `now()`, `SELECT` statements with +a `GROUP BY time()` clause must provide an alternative **upper** bound in the +[`WHERE` clause](/influxdb/v1.8/query_language/explore-data/#the-where-clause). +For example: + +```sql +SELECT MEAN("boards") FROM "hillvalley" +WHERE time >= '2022-01-01T00:00:00Z' AND time <= now() + 10d +GROUP BY time(12m) fill(none) +``` + +Note that the `WHERE` clause must provide an alternative **upper** bound to +override the default `now()` upper bound. The following query merely resets +the lower bound to `now()` such that the query's time range is between +`now()` and `now()`: + +```sql +SELECT MEAN("boards") FROM "hillvalley" +WHERE time >= now() +GROUP BY time(12m) fill(none) +``` + +For for more on time syntax in queries, see [InfluxQL data Exploration](/{{< latest "influxdb" "v1" >}}/query_language/explore-data/#time-syntax). + +#### Can I perform mathematical operations against timestamps? + +InfluxQL does not support mathematical operators against timestamp values. +Most time calculations must be carried out by the client receiving the query results. + +There is limited support for using InfluxQL functions against timestamp values. +The [ELAPSED()](/{{< latest "influxdb" "v1" >}}/query_language/functions/#elapsed) +function returns the difference between subsequent timestamps in a single field. + +#### Can I identify write precision from returned timestamps? + +InfluxDB stores all timestamps as nanosecond values, regardless of the write precision supplied. +InfluxQL silently drops trailing zeros from timestamps which obscures the initial write precision. +Because InfluxDB silently drops trailing zeros on returned timestamps, the write +precision is not recognizable in the returned timestamps. + +#### When should I use single quote versus double quotes in a query? + +Follow these general rules for quotes in InfluxQL queries: + +###### Single quotes +- Use to quote literal string values, like tag values. +- Do **not** use on identifiers like database names, retention policy names, + user names, measurement names, tag keys, and field keys. +- Use on date-time strings. + +###### Double quotes +- Use on identifiers that start with a digit, contain characters other than `[A-z,0-9,_]`, + or that are an [InfluxQL keyword](/{{< latest "influxdb" "v1" >}}/query_language/spec/#keywords). + We generally recommend using double quotes on all identifiers, even if they + don't meet these criteria. +- Do **not** use on date-time strings. + + +```sql +-- Correctly quote usage + +SELECT bikes_available FROM bikes WHERE station_id='9' + +SELECT "bikes_available" FROM "bikes" WHERE "station_id"='9' + +SELECT MIN("avgrq-sz") AS "min_avgrq-sz" FROM telegraf + +SELECT * from "cr@zy" where "p^e"='2' + +SELECT "water_level" FROM "h2o_feet" WHERE time > '2015-08-18T23:00:01.232000000Z' AND time < '2015-09-19' + +-- Incorrect quote usage + +SELECT 'bikes_available' FROM 'bikes' WHERE 'station_id'="9" + +SELECT * from cr@zy where p^e='2' + +SELECT "water_level" FROM "h2o_feet" WHERE time > "2015-08-18T23:00:01.232000000Z" AND time < "2015-09-19" +``` + +#### Why is my query with a `WHERE OR` time clause returning empty results? + +InfluxQL does not support using `OR` in the `WHERE` clause to specify multiple +time ranges and returns an empty response if multiple are specified. +For example, the following query will return an empty response: + +```sql +SELECT * FROM "absolutismus" +WHERE time = '2016-07-31T20:07:00Z' OR time = '2016-07-31T23:07:17Z' +``` + +#### Why does `fill(previous)` return empty results? + +`fill(previous)` doesn't fill a null value if there is no previous value inside +the queried time range. + +#### How do I query data with an identical tag key and field key? + +Use the `::` syntax to specify if the key is a field key or tag key. For example: + +```sql +SELECT * FROM "candied" WHERE "almonds"::field > 51 +SELECT * FROM "candied" WHERE "almonds"::tag='true' +``` + +#### How do I query data across measurements? + +InfluxQL does not support querying multiple measurements +All data must be under a single measurement to query it together. +To perform cross-measurement queries, +[use Flux](/influxdb/v2.2/reference/syntax/flux/flux-vs-influxql/#math-across-measurements). + +#### Does the order timestamps in a query matter? + +No, it doesn't. There is a only a _negligible_ difference between the following queries: + +```sql +SELECT ... FROM ... WHERE time > 'timestamp1' AND time < 'timestamp2' +SELECT ... FROM ... WHERE time < 'timestamp2' AND time > 'timestamp1' +``` + +#### How do I query data by a tag with a null value? + +In your `WHERE` clause, specify an empty or null tag value with `''`. For example: + +```sql +SELECT * FROM "vases" WHERE priceless='' +``` + +--- + +## Series and series cardinality + +#### What is series cardinality? + +[Series cardinality](/influxdb/v2.2/reference/glossary/#series-cardinality) is +the total number of unique +{{% cloud-only %}}**measurement**, **tag set**, and **field key** combinations{{% /cloud-only %}} +{{% oss-only %}}**measurement** and **tag set** combinations{{% /oss-only %}} +(series) stored on disk and indexed in memory. + +#### Why does series cardinality matter? + +{{% oss-only %}} + +InfluxDB maintains an in-memory index of every [series](/influxdb/v2.2/reference/glossary/#series)\. +As the number of unique series grows, so does the memory usage. +High series cardinality can force the host operating system to kill the InfluxDB +process with an out of memory (OOM) exception. + +{{% /oss-only %}} + +{{% cloud-only %}} + +InfluxDB maintains an in-memory index of every [series](/influxdb/v2.2/reference/glcloudary/#series). +As the number of unique series grows, it can negatively affect query performance. +Each InfluxDB Cloud organization has a series cardinality limit to prevent +runaway cardinality. For information about adjusting cardinality limits, see +[How do I increase my organization’s rate limits and quotas?](#how-do-i-increase-my-organizations-rate-limits-and-quotas). + +{{% /oss-only %}} + +Use [`influxdb.cardinality()`](/flux/v0.x/stdlib/influxdata/influxdb/cardinality/) in Flux +or [`SHOW SERIES CARDINALITY`](/{{< latest "influxdb" "v1" >}}/query_language/spec/#show-series-cardinality) +in InfluxQL to measure the series cardinality in a bucket. +See [Resolve high series cardinality](/influxdb/v2.2/write-data/best-practices/resolve-high-cardinality/) +for information about reducing series cardinality. + +{{% oss-only %}} + +#### How do I remove series from the index? + +To remove a series from an index: + +1. Use the **`influx` CLI** or **InfluxDB {{< current-version >}} API** to delete points + associated with the series. See [Delete data](/influxdb/v2.2/write-data/delete-data/) + for more information. +2. Use the [`influxd inspect build-tsi` tool](/influxdb/v2.2/reference/cli/influxd/inspect/build-tsi/) + to rebuild your index. + +{{% /oss-only %}} diff --git a/content/influxdb/v2.2/reference/glossary.md b/content/influxdb/v2.2/reference/glossary.md index 02b7b375c..0aaa29bab 100644 --- a/content/influxdb/v2.2/reference/glossary.md +++ b/content/influxdb/v2.2/reference/glossary.md @@ -863,7 +863,9 @@ Related entries: [aggregate](#aggregate), [function](#function), [transformation ### series -A collection of data in the InfluxDB data structure that shares a measurement, tag set, and bucket. +A collection of data in the InfluxDB data structure that share a common +{{% cloud-only %}}**measurement**, **tag set**, and **field key**.{{% /cloud-only %}} +{{% oss-only %}}**measurement** and **tag set**.{{% /oss-only %}} Related entries: [field set](#field-set), [measurement](#measurement), [tag set](#tag-set) diff --git a/content/influxdb/v2.2/users/change-password.md b/content/influxdb/v2.2/users/change-password.md index e12cb1872..b5f53c930 100644 --- a/content/influxdb/v2.2/users/change-password.md +++ b/content/influxdb/v2.2/users/change-password.md @@ -22,14 +22,15 @@ to update a password for a user. To update a password, you need the following: - Username or user ID _(provided in the output of `influx user list`)_ - New password +- [Operator token](/influxdb/v2.2/security/tokens/#operator-token) ##### Update a password ```sh # Syntax -influx user password -n +influx user password -n -t # Example -influx user password -n johndoe +influx user password -n johndoe -t My5uPErSecR37t0k3n ``` When prompted, enter and confirm the new password. diff --git a/content/influxdb/v2.2/write-data/best-practices/resolve-high-cardinality.md b/content/influxdb/v2.2/write-data/best-practices/resolve-high-cardinality.md index 683b2d12a..bac73cc59 100644 --- a/content/influxdb/v2.2/write-data/best-practices/resolve-high-cardinality.md +++ b/content/influxdb/v2.2/write-data/best-practices/resolve-high-cardinality.md @@ -9,7 +9,7 @@ menu: parent: write-best-practices --- -If reads and writes to InfluxDB have started to slow down, high [series cardinality](/influxdb/v2.1/reference/glossary/#series-cardinality) (too many series) may be causing memory issues. {{% cloud-only %}}Cardinality can also cause writes to fail if it exceeds your [plan’s adjustable service quota](/influxdb/cloud/account-management/limits/).{{% /cloud-only %}} +If reads and writes to InfluxDB have started to slow down, high [series cardinality](/influxdb/v2.2/reference/glossary/#series-cardinality) (too many series) may be causing memory issues. {{% cloud-only %}}Cardinality can also cause writes to fail if it exceeds your [plan’s adjustable service quota](/influxdb/cloud/account-management/limits/).{{% /cloud-only %}} Take steps to understand and resolve high series cardinality. @@ -44,7 +44,7 @@ High series cardinality is a primary driver of high memory usage for many databa Use the following to measure series cardinality of your buckets: - [`influxdb.cardinality()`](/{{< latest "flux" >}}/stdlib/influxdata/influxdb/cardinality): Flux function that returns the number of unique [series keys](/influxdb/v2.2/reference/glossary/#series) in your data. -- [`SHOW SERIES CARDINALITY`](/influxdb/v2.2/query_language/spec/#show-series-cardinality): InfluxQL command that returns the number of unique [series keys](/influxdb/v2.2/reference/glossary/#series) in your data. +- [`SHOW SERIES CARDINALITY`](/{{< latest "influxdb" "v1" >}}/query_language/spec/#show-series-cardinality): InfluxQL command that returns the number of unique [series keys](/influxdb/v2.2/reference/glossary/#series) in your data. ## Resolve high cardinality diff --git a/content/influxdb/v2.2/write-data/delete-data.md b/content/influxdb/v2.2/write-data/delete-data.md index 7e17762bc..ed8e000f0 100644 --- a/content/influxdb/v2.2/write-data/delete-data.md +++ b/content/influxdb/v2.2/write-data/delete-data.md @@ -38,16 +38,20 @@ InfluxDB {{< current-version >}} does not support deleting data by field. {{% /oss-only %}} {{% cloud-only %}} + In InfluxDB Cloud, writes and deletes are asynchronous and eventually consistent. Once InfluxDB validates your request and queues the delete, it sends a _success_ (HTTP `204` status code) response as an acknowledgement. To ensure that InfluxDB handles writes and deletes in the order you request them, wait for the acknowledgement before you send the next request. Once InfluxDB executes a queued delete, the deleted data is no longer queryable, but will remain on disk until the compaction service runs. + {{% /cloud-only %}} {{% oss-only %}} + Once a delete request completes successfully, the deleted data is no longer queryable, but will remain on disk until the compaction service runs. + {{% /oss-only %}} ## Delete data using the influx CLI