Go to file
Christopher M. Wolff 4acc733019
build(flux): update flux to v0.194.3 (#24252)
2023-05-30 14:21:20 -07:00
.circleci chore: upgrade changelogger to latest version (#24244) 2023-05-26 12:09:44 -04:00
.github chore: cleanup codeowners file (#23940) 2022-11-22 10:28:40 -05:00
annotations test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
assets chore(readme): add resource links and logo (#23735) 2022-10-20 09:04:22 -04:00
authorization chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
authorizer chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
backup refactor: delete old backup/restore CLI commands, replace with dependency on new CLI repo (#21703) 2021-06-17 09:18:55 -04:00
bolt test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
checks build(flux): update flux to v0.180.1 (#23666) 2022-08-24 11:59:16 -07:00
cmd test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
context fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
dashboards build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
dbrp fix: fixes an error querying virtual dbrps (#23731) 2022-10-13 14:58:07 -04:00
docker chore: pin base Debian image in Docker builds (#22222) 2021-08-17 09:43:10 -07:00
etc test(flux): use vanilla flagger for fluxtest (#23762) 2022-10-05 13:42:38 -07:00
flux build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
fluxinit fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
gather fix: scraping failed when Content-Type header is not set (#24135) 2023-03-14 10:13:28 -04:00
http fix: add error message when attempting to delete by field (#24131) 2023-03-10 09:13:24 -05:00
influxql chore: fix typo in functions.go (#24133) 2023-03-09 12:40:17 -05:00
inmem fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
internal chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
jsonweb build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
kit test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
kv chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
label test(label): Invalid closure capture (#23353) 2022-07-13 15:15:13 +01:00
logger docs(logger): fix incorrect doc string (#23442) 2022-09-13 11:00:52 -05:00
mock chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
models chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
notebooks test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
notification build(flux): update flux to v0.180.1 (#23666) 2022-08-24 11:59:16 -07:00
pkg test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
pkger chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
pprof chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
predicate build: upgrade protobuf library (#22654) 2021-11-02 16:00:54 -05:00
prometheus chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
query chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
rand refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
releng chore: add protoc-gen script to releng (2.x) (#23697) 2022-09-13 11:00:51 -05:00
remotes test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
replications test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
resource fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
scripts chore: update UI to latest version (#24171) 2023-04-04 12:13:29 -04:00
secret build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
session feat(security): set SameSite=strict on session cookie (#23723) 2022-09-15 15:30:19 -05:00
snowflake chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
source chore: delete the rest of chronograf (#21998) 2021-08-02 09:02:54 -06:00
sqlite test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
static build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
storage test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
task test: use `T.TempDir` to create temporary test directory (#23258) 2023-03-21 16:22:11 -04:00
telegraf chore: remove duplicate word in comments (#23685) 2022-09-13 11:00:52 -05:00
telemetry feat: Add remotes and replications to telemetry (#23456) 2022-06-16 14:48:06 -04:00
tenant chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
testing fix: fixes an error querying virtual dbrps (#23731) 2022-10-13 14:58:07 -04:00
tests chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
toml build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
tools/tmpl build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
tsdb fix: chmod'ing the manifest is unnecessary (#24165) 2023-04-03 13:09:01 -04:00
ui chore: remove dead source code from UI folder (#21446) 2021-05-11 10:11:07 -04:00
uuid chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
v1 chore: update to go 1.20 (#24088) 2023-02-09 14:14:35 -05:00
vault chore: bump testcontainers to latest released version (#23858) 2022-11-23 13:18:10 -05:00
zap fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
.editorconfig chore(editorconfig): revert editorconfig changes, too much work 2020-06-25 18:16:57 +01:00
.gitignore feat: Add remotes and replications to telemetry (#23456) 2022-06-16 14:48:06 -04:00
CHANGELOG.md chore: omit VCS commands for changelog in favor of s3-only approach (#22423) 2021-09-10 08:38:40 -07:00
CHANGELOG_OLD.md build: generate nightly changelog from commit history (#22377) 2021-09-07 08:07:04 -07:00
CONTRIBUTING.md docs: cleanup CONTRIBUTING.md - clarify instructions and output. (#23743) 2022-09-27 14:21:40 -05:00
FUZZ.md docs: Update FUZZ.md 2020-10-26 10:43:21 -07:00
GNUmakefile build: allow to build on FreeBSD (#22285) 2021-11-24 08:42:36 -05:00
LICENSE Initial commit 2018-05-09 09:17:31 -07:00
README.md chore(readme): add resource links and logo (#23735) 2022-10-20 09:04:22 -04:00
SECURITY.md chore: Update table of supported security updates 2020-09-28 15:19:25 -07:00
annotation.go build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
annotation_test.go feat(annotations): storage service (#21690) 2021-06-15 18:36:11 -04:00
api-compat.Jenkinsfile chore(Jenkins): Update Golang build container to 1.12 2019-04-12 15:51:21 -04:00
appveyor.yml fix(tasks): Add a log message for run transition clairity (#14321) 2019-07-12 10:10:11 -06:00
auth.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
authz.go feat: add the concept of an instance owner (#23497) 2022-08-01 09:42:06 -04:00
authz_test.go feat(annotations): authorization service (#21665) 2021-06-11 17:39:51 -04:00
backup.go refactor: rename Lock/Unlock on KV stores to RLock/RUnlock (#22357) 2021-08-31 17:03:54 -04:00
bucket.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
build.go feat(influxdb): Add global BuildInfo 2019-03-14 09:23:53 -07:00
check.go refactor: refactor for tasks backport (#21117) 2021-04-07 14:42:55 -04:00
cliff.toml build: generate nightly changelog from commit history (#22377) 2021-09-07 08:07:04 -07:00
credentials.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
crud_log.go chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
dashboard.go fix: change static legend's hide property to show (#21648) 2021-06-10 09:20:59 -07:00
dashboard_test.go feat: add legendHide for the tooltip (#21547) 2021-05-25 10:31:50 -07:00
dbrp_mapping.go fix: fix virtual DBRP FindMany, make virtual bucket default if not overridden (#23623) 2022-08-12 11:16:37 -06:00
dbrp_mapping_internal_test.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
dbrp_mapping_test.go chore: delete old-style DBRP mapping (#22339) 2021-08-30 18:27:11 -04:00
delete.go fix: improve delete speed when a measurement is part of the predicate (#23786) 2022-10-14 15:09:32 -04:00
document.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
duration.go refactor(tasks): use go Time for Task CreatedAt, UpdatedAt, LatestCompleted, Offset (#15672) 2019-11-12 17:13:56 -08:00
env feat: add support for pkg-config (#17036) 2020-02-28 11:08:21 -06:00
flags.yml feat: enable remotes and replication streams feature (#22990) 2021-12-13 16:01:50 -06:00
go.mod build(flux): update flux to v0.194.3 (#24252) 2023-05-30 14:21:20 -07:00
go.sum build(flux): update flux to v0.194.3 (#24252) 2023-05-30 14:21:20 -07:00
keyvalue_log.go feat(kv): implemented key/value store with end-to-end integration tests 2019-02-19 17:47:19 -06:00
label.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
label_test.go fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
lookup.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
measurement.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
measurement_schema.go feat: influx CLI Packager support for explicit schema buckets (#21465) 2021-05-31 10:01:29 +10:00
measurement_schema_errors.go feat: influx CLI Packager support for explicit schema buckets (#21465) 2021-05-31 10:01:29 +10:00
measurement_schema_test.go feat: influx CLI Packager support for explicit schema buckets (#21465) 2021-05-31 10:01:29 +10:00
notebook.go feat(notebooks): notebooks database implementation (#21573) 2021-05-28 09:29:00 -04:00
notebook_test.go chore: move notebook service interface to root (#21570) 2021-05-26 12:27:56 -04:00
notification.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
notification_endpoint.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
onboarding.go chore: delete deprecated PostSetupUser API (#21709) 2021-06-22 09:09:52 -04:00
operation_log.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
organization.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
paging.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
passwords.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
preview.flux build(flux): update flux to v0.172.0 (#23494) 2022-06-24 16:32:46 -05:00
remote_connection.go fix: do not require remoteOrgID in remote config/creation request (#23838) 2022-11-01 09:47:45 -05:00
replication.go fix: rename replication fields for better clarity (#24126) 2023-03-09 13:11:43 -05:00
scraper.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
secret.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
secret_test.go feat(notification/endpoint): add endpoint struct 2019-08-15 21:56:17 -04:00
seed.flux build(flux): update flux to v0.172.0 (#23494) 2022-06-24 16:32:46 -05:00
semaphore.go refactor: simpify Semaphore interface 2019-10-23 19:49:48 +01:00
session.go chore: remove duplicate word in comments (#23685) 2022-09-13 11:00:52 -05:00
source.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
status.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
tag.go build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
tag_test.go fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
telegraf.go feat: allow new telegraf input plugins and update toml (#22476) 2021-09-14 14:43:59 -07:00
telegraf_test.go feat: allow new telegraf input plugins and update toml (#22476) 2021-09-14 14:43:59 -07:00
test.flux build(flux): update flux to v0.172.0 (#23494) 2022-06-24 16:32:46 -05:00
token.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
tools.go build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
usage.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
user.go chore: remove unused user http code (#23011) 2021-12-20 15:17:18 -05:00
user_resource_mapping.go feat: add the concept of an instance owner (#23497) 2022-08-01 09:42:06 -04:00
user_resource_mapping_test.go fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
variable.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
variable_test.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
write.go fix(http): fix passing of bucket ID by write-handler client (#20679) 2021-02-02 17:34:40 -05:00

README.md

InfluxDB

InfluxDB Logo

CircleCI Slack Status Docker Pulls Docker Pulls

WebsiteDocumentationInfluxDB UniversityBlog


InfluxDB is an open source time series platform. This includes APIs for storing and querying data, processing it in the background for ETL or monitoring and alerting purposes, user dashboards, and visualizing and exploring the data and more. The master branch on this repo now represents the latest InfluxDB, which now includes functionality for Kapacitor (background processing) and Chronograf (the UI) all in a single binary.

The list of InfluxDB Client Libraries that are compatible with the latest version can be found in our documentation.

If you are looking for the 1.x line of releases, there are branches for each minor version as well as a master-1.x branch that will contain the code for the next 1.x release. The master-1.x working branch is here. The InfluxDB 1.x Go Client can be found here.

Try InfluxDB Cloud for free and get started fast with no local setup required. Click here to start building your application on InfluxDB Cloud.

Install

We have nightly and versioned Docker images, Debian packages, RPM packages, and tarballs of InfluxDB available at the InfluxData downloads page. We also provide the influx command line interface (CLI) client as a separate binary available at the same location.

If you are interested in building from source, see the building from source guide for contributors.

Get Started

For a complete getting started guide, please see our full online documentation site.

To write and query data or use the API in any way, you'll need to first create a user, credentials, organization and bucket. Everything in InfluxDB is organized under a concept of an organization. The API is designed to be multi-tenant. Buckets represent where you store time series data. They're synonymous with what was previously in InfluxDB 1.x a database and retention policy.

The simplest way to get set up is to point your browser to http://localhost:8086 and go through the prompts.

You can also get set up from the CLI using the command influx setup:

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx setup
Welcome to InfluxDB 2.0!
Please type your primary username: marty

Please type your password:

Please type your password again:

Please type your primary organization name.: InfluxData

Please type your primary bucket name.: telegraf

Please type your retention period in hours.
Or press ENTER for infinite.: 72


You have entered:
  Username:          marty
  Organization:      InfluxData
  Bucket:            telegraf
  Retention Period:  72 hrs
Confirm? (y/n): y

UserID                  Username        Organization    Bucket
033a3f2c5ccaa000        marty           InfluxData      Telegraf
Your token has been stored in /Users/marty/.influxdbv2/credentials

You can run this command non-interactively using the -f, --force flag if you are automating the setup. Some added flags can help:

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx setup \
--username marty \
--password F1uxKapacit0r85 \
--org InfluxData \
--bucket telegraf \
--retention 168 \
--token where-were-going-we-dont-need-roads \
--force

Once setup is complete, a configuration profile is created to allow you to interact with your local InfluxDB without passing in credentials each time. You can list and manage those profiles using the influx config command.

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx config
Active	Name	URL			            Org
*	    default	http://localhost:8086	InfluxData

Write Data

Write to measurement m, with tag v=2, in bucket telegraf, which belongs to organization InfluxData:

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx write --bucket telegraf --precision s "m v=2 $(date +%s)"

Since you have a default profile set up, you can omit the Organization and Token from the command.

Write the same point using curl:

curl --header "Authorization: Token $(bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx auth list --json | jq -r '.[0].token')" \
--data-raw "m v=2 $(date +%s)" \
"http://localhost:8086/api/v2/write?org=InfluxData&bucket=telegraf&precision=s"

Read that back with a simple Flux query:

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx query 'from(bucket:"telegraf") |> range(start:-1h)'
Result: _result
Table: keys: [_start, _stop, _field, _measurement]
                   _start:time                      _stop:time           _field:string     _measurement:string                      _time:time                  _value:float
------------------------------  ------------------------------  ----------------------  ----------------------  ------------------------------  ----------------------------
2019-12-30T22:19:39.043918000Z  2019-12-30T23:19:39.043918000Z                       v                       m  2019-12-30T23:17:02.000000000Z                             2

Use the -r, --raw option to return the raw flux response from the query. This is useful for moving data from one instance to another as the influx write command can accept the Flux response using the --format csv option.

Script with Flux

Flux (previously named IFQL) is an open source functional data scripting language designed for querying, analyzing, and acting on data. Flux supports multiple data source types, including:

  • Time series databases (such as InfluxDB)
  • Relational SQL databases (such as MySQL and PostgreSQL)
  • CSV

The source for Flux is available on GitHub. To learn more about Flux, see the latest InfluxData Flux documentation and CTO Paul Dix's presentation.

Contribute to the Project

InfluxDB is an MIT licensed open source project and we love our community. The fastest way to get something fixed is to open a PR. Check out our contributing guide if you're interested in helping out. Also, join us on our Community Slack Workspace if you have questions or comments for our engineering teams.

CI and Static Analysis

CI

All pull requests will run through CI, which is currently hosted by Circle. Community contributors should be able to see the outcome of this process by looking at the checks on their PR. Please fix any issues to ensure a prompt review from members of the team.

The InfluxDB project is used internally in a number of proprietary InfluxData products, and as such, PRs and changes need to be tested internally. This can take some time, and is not really visible to community contributors.

Static Analysis

This project uses the following static analysis tools. Failure during the running of any of these tools results in a failed build. Generally, code must be adjusted to satisfy these tools, though there are exceptions.

  • go vet checks for Go code that should be considered incorrect.
  • go fmt checks that Go code is correctly formatted.
  • go mod tidy ensures that the source code and go.mod agree.
  • staticcheck checks for things like: unused code, code that can be simplified, code that is incorrect and code that will have performance issues.

staticcheck

If your PR fails staticcheck it is easy to dig into why it failed, and also to fix the problem. First, take a look at the error message in Circle under the staticcheck build section, e.g.,

tsdb/tsm1/encoding.gen.go:1445:24: func BooleanValues.assertOrdered is unused (U1000)
tsdb/tsm1/encoding.go:172:7: receiver name should not be an underscore, omit the name if it is unused (ST1006)

Next, go and take a look here for some clarification on the error code that you have received, e.g., U1000. The docs will tell you what's wrong, and often what you need to do to fix the issue.

Generated Code

Sometimes generated code will contain unused code or occasionally that will fail a different check. staticcheck allows for entire files to be ignored, though it's not ideal. A linter directive, in the form of a comment, must be placed within the generated file. This is problematic because it will be erased if the file is re-generated. Until a better solution comes about, below is the list of generated files that need an ignores comment. If you re-generate a file and find that staticcheck has failed, please see this list below for what you need to put back:

File Comment
query/promql/promql.go //lint:file-ignore SA6001 Ignore all unused code, it's generated

End-to-End Tests

CI also runs end-to-end tests. These test the integration between the influxd server the UI. Since the UI is used by interal repositories as well as the influxdb repository, the end-to-end tests cannot be run on forked pull requests or run locally. The extent of end-to-end testing required for forked pull requests will be determined as part of the review process.

Additional Resources