Skip to content
Scalable datastore for metrics, events, and real-time analytics
Go TypeScript CSS Python Shell Makefile
Branch: master
Clone or download

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci chore(build): start running nightly builds 2hour earlier (#17818) Apr 21, 2020
.github chore(github): change CODEOWNERS for tools-team (#17119) Mar 6, 2020
authorizer fix: org filtering for both kv and tenant need to match behaviors. (#… Apr 16, 2020
bolt refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
chronograf refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
cmd chore(influx): tidy up print summary statements to include pkg names Apr 21, 2020
context refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
docker chore(docker): Update Influxd Dockerfile Jan 24, 2019
docs build: remove npm replace with yarn (#14176) Jun 21, 2019
endpoints refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
etc chore(litmus): run integration tests on master: (#17292) Mar 16, 2020
flux refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
gather refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
http feat(tenant): integrate the tenant service as the default backend (#1… Apr 21, 2020
inmem refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
internal chore(Makefile): remove yq dependency to generate ts client Dec 18, 2018
jsonweb refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
kit fix: make API type marshal before writing to respone writer to avoid … Apr 15, 2020
kv feat(dashboards): extend dashboard update API to take cells as a put … Apr 20, 2020
logger refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
mock refactor(tenant): move bucket and urm auth layers to tenant service (#… Apr 7, 2020
models fix(models): Optimize allocations in VerifyPoint() Apr 10, 2020
nats chore: Remove several instances of WithLogger (#15996) Dec 4, 2019
notification chore(pkger): add stack state management for notification endpoints Apr 6, 2020
pkg chore(testtp): extend testtp request with SetFormValue Apr 16, 2020
pkger feat(pkger): add stateful management for telegraf configs Apr 21, 2020
predicate refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
prometheus refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
query feat(query): add interface for the window aggregate capability (#17801) Apr 21, 2020
rand refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
resource refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
scripts chore: bump gogo/protobuf and regenerate Apr 3, 2019
snowflake refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
source refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
storage feat(query): add interface for the window aggregate capability (#17801) Apr 21, 2020
task feat(task): Add option to Executor to set maximum worker count. Apr 9, 2020
telegraf/plugins refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
telemetry refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
tenant feat(tenant): integrate the tenant service as the default backend (#1… Apr 21, 2020
testing feat(dashboards): extend dashboard update API to take cells as a put … Apr 20, 2020
toml refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
tools/tmpl refactor: modify tooling to take advantage of go run Oct 15, 2018
tsdb Merge pull request #17769 from patriczek/iss17257 Apr 20, 2020
ui fix: catch date format issue in table view type (#17823) Apr 21, 2020
uuid chore: rename imports from platform to influxdb Jan 10, 2019
vault refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
write refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
zap refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
.editorconfig chore: add .editorconfig and enable in CI Feb 20, 2019
.gitignore feat: add tool to migrate 1.x chronograf dashboards and variables Jan 10, 2020
.goreleaser-nightly.yml ci(goreleaser): create a release version of goreleaser Jan 23, 2019
.goreleaser.yml ci(release): prefix archives with influxdb Jan 23, 2019
CHANGELOG.md feat(influx): extend CLI org type to support config orgs in global co… Apr 21, 2020
CONTRIBUTING.md fix(contributing): fixing code formatting Feb 19, 2020
DEVELOPMENT.md fix(documentation): Rename DEVELOPMENT.MD to DEVELOPMENT.md (#16601) Jan 23, 2020
LICENSE Initial commit May 9, 2018
Makefile fix: bail webpack build on tsc error (#16573) Jan 16, 2020
README.md chore(readme): update the working branch (#17415) Mar 25, 2020
SECURITY.md feat(security): add SECURITY.md file (#14878) Sep 5, 2019
api-compat.Jenkinsfile chore(Jenkins): Update Golang build container to 1.12 Apr 12, 2019
appveyor.yml fix(tasks): Add a log message for run transition clairity (#14321) Jul 12, 2019
auth.go feat(createdAt): Added createdat and updatedAt to Authorization (#15784) Nov 7, 2019
authz.go feat(sampledata): Return bucket resources that user has member access… Mar 26, 2020
authz_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
backup.go feat(storage): implement backup and restore (#16504) Jan 21, 2020
bucket.go feat: resource log Jan 23, 2020
build.go feat(influxdb): Add global BuildInfo Mar 14, 2019
check.go feat(http): checks client (#16922) Feb 26, 2020
crud_log.go chore(inmem): nuke the duplicative inmem store Dec 30, 2019
dashboard.go feat(dashboards): extend dashboard update API to take cells as a put … Apr 20, 2020
dashboard_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
dbrp_mapping.go fix(inmem): fix dbrp not found Jul 3, 2019
dbrp_mapping_internal_test.go chore: rename imports from platform to influxdb Jan 10, 2019
dbrp_mapping_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
delete.go fix(storage): prevent data-races on predicate Jan 9, 2020
document.go fix(http): refactor document service and fix auth Mar 9, 2020
duration.go refactor(tasks): use go Time for Task CreatedAt, UpdatedAt, LatestCom… Nov 13, 2019
env feat: add an env script that will configure the environment for using… Dec 18, 2019
error.go chore: rename imports from platform to influxdb Jan 10, 2019
errors.go feat(http): add configurable limit to points batch size on write endp… Jan 10, 2020
errors.md feat(errors): add errors lib Sep 8, 2018
errors_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
go.mod feat(tenant): integrate the tenant service as the default backend (#1… Apr 21, 2020
go.sum feat(tenant): integrate the tenant service as the default backend (#1… Apr 21, 2020
id.go fix(influxdb): use influxdb.Error in ID.Decode May 15, 2019
id_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
keyvalue_log.go feat(kv): implemented key/value store with end-to-end integration tests Feb 19, 2019
label.go fix(labels): prevent adding duplicate labels to resources in kv (#17340) Apr 16, 2020
label_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
lookup.go fix(influxdb): change resource to resource type Jan 15, 2019
measurement.go chore: rename imports from platform to influxdb Jan 10, 2019
notification.go fix(notificationrules): Correct logic on matching notification rules (#… Dec 31, 2019
notification_endpoint.go feat(http): add notification endpoint service Dec 10, 2019
onboarding.go feat(tenant): Build out the onboarding system in tenant and integrate… Apr 6, 2020
operation_log.go chore: rename imports from platform to influxdb Jan 10, 2019
organization.go fix: org filtering for both kv and tenant need to match behaviors. (#… Apr 16, 2020
paging.go feat(tenant): Add in api elements to tenant service (#17447) Mar 27, 2020
passwords.go chore: refactor password service to provide userID instead of name Nov 20, 2019
query.go chore: rename imports from platform to influxdb Jan 10, 2019
scraper.go feat(influxdb): add scraper filter Apr 25, 2019
secret.go feat(http): add notification endpoint service Dec 10, 2019
secret_test.go feat(notification/endpoint): add endpoint struct Aug 16, 2019
semaphore.go refactor: simpify Semaphore interface Oct 23, 2019
session.go Add oauthID to the user interface instead of session Jun 26, 2019
source.go fix: encode IDs as JSON map keys properly Apr 27, 2019
status.go feat(kv): add new update Mar 28, 2019
tag.go feat(pkger): add application functionality for the notification rules… Dec 20, 2019
tag_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
task.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
task_errors.go refactor(tasks): remove dead scheduler code (#16252) Jan 2, 2020
task_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
telegraf.go chore(telegraf): remove business logic check inside TelegrafConfig ty… Apr 21, 2020
telegraf_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
tenant.go test: add tests for tenant service Mar 19, 2020
token.go chore: rename imports from platform to influxdb Jan 10, 2019
tools.go ci: use latest staticcheck Sep 4, 2019
usage.go chore: rename imports from platform to influxdb Jan 10, 2019
user.go fix(influxdb): Always return user status Sep 24, 2019
user_resource_mapping.go feat(sampledata): Return bucket resources that user has member access… Mar 26, 2020
user_resource_mapping_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
variable.go chore(pkger): add stack state management for variables Apr 6, 2020
variable_test.go refactor: rewrite imports to include the /v2 suffix for version 2 Apr 3, 2020
write.go chore: rename imports from platform to influxdb Jan 10, 2019
yarn.lock feat(ui/DWP): added searchable dropdown for tag key and values for se… Nov 20, 2019

README.md

InfluxDB CircleCI

Slack Status

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.

State of the Project

The latest InfluxDB 1.x is the stable release and recommended for production use. The InfluxDB that is on the master branch is currently in the beta stage. This means that it is still NOT recommended for production usage. There may be breaking API changes, breaking changes in the Flux language, changes in the underlying storage format that will require you to delete all your data, and significant changes to the UI. The beta is intended for feature exploration and gathering feedback on the available feature set. It SHOULD NOT be used for performance testing, benchmarks, or other stress tests.

Additional features will arrive during the beta period until we reach general availability (GA). We will be cutting versioned releases at least every two weeks starting in the first release. There will also be nightly builds based off the latest code in master.

Once we close on the final feature set of what will be in the first GA release of InfluxDB in the 2.x line, we will move into the release candidate (RC) phase. At that point, we do not expect there to be breaking changes to the API or Flux language. We may still need to make a breaking change prior to GA due to some unforseen circumstance, but it would need to be extremely important and will be clearly communicated via the changelog and all available channels.

Our current plans are to release RCs suitable for production usage, but we will re-evaluate in consultation with the community as the cycle progresses. During the RC period, we will focus on feedback from users, bug fixes, performance, and additive features (where time permits).

What you can expect in the Beta and RC Phases

Beta

Releases every two weeks or as needed

Planned additions include:

  • Compatibility layer with 1.x including: 1.x HTTP Write API and HTTP Read API support for InfluxQL
  • Import Bulk Data from 1.x - convert TSM from 1.x to 2.x
  • Performance tuning, stability improvements, and fine tuning based on community feedback.
  • Finalization of supported client libraries starting with JavaScript and Go.

RC

As needed

Planned activities include:

  • Performance tuning, stability improvements, and fine-tuning based on community feedback.

What is NOT planned?

  • Migration of users/security permissions from InfluxDB v1.x to 2.x. ACTION REQUIRED: Re-establish users and permissions within the new unified security model which now spans the underlying database and user interface.
  • Migration of Continuous Queries. ACTION REQUIRED: These will need to be re-implemented as Flux tasks.
  • Direct support by InfluxDB for CollectD, StatsD, Graphite, or UDP. ACTION REQUIRED: Leverage Telegraf 1.9+ along with the InfluxDB v2.0 output plugin to translate these protocols/formats.

Installing from Source

We have nightly and weekly versioned Docker images, Debian packages, RPM packages, and tarballs of InfluxDB available at the InfluxData downloads page.

Building From Source

This project requires Go 1.13 and Go module support.

Set GO111MODULE=on or build the project outside of your GOPATH for it to succeed.

The project also requires a recent stable version of Rust. We recommend using rustup to install Rust.

If you are getting an error loading module requirements error with bzr executable file not found in $PATH” on make, then you need to ensure you have bazaar, protobuf, and yarn installed.

  • OSX: brew install bazaar yarn
  • Linux (Arch): pacman -S bzr protobuf yarn
  • Linux (Ubuntu): apt install bzr protobuf-compiler yarnpkg

NB: For RedHat, there are some extra steps:

  1. You must enable the EPEL
  2. You must add the yarn repository

For information about modules, please refer to the wiki.

A successful make run results in two binaries, with platform-dependent paths:

$ make
...
env GO111MODULE=on go build -tags 'assets ' -o bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx ./cmd/influx
env GO111MODULE=on go build -tags 'assets ' -o bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influxd ./cmd/influxd

influxd is the InfluxDB service. influx is the CLI management tool.

Start the service. Logs to stdout by default:

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influxd

Getting 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:9999 and go through the prompts.

Note: Port 9999 will be used during the beta phases of development of InfluxDB v2.0. This should allow a v2.0-beta instance to be run alongside a v1.x instance without interfering on port 8086. InfluxDB will thereafter continue to use 8086.

You can also get set up from the CLI using the subcommands influx user, influx auth, influx org and influx bucket, or do it all in one breath with 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 may get into a development loop where influx setup becomes tedious. 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

~/.influxdbv2/credentials contains your auth token. Most influx commands read the token from this file path by default.

You may need the organization ID and bucket ID later:

$ influx org find
ID                      Name
033a3f2c708aa000        InfluxData
$ influx bucket find
ID                      Name            Retention       Organization    OrganizationID
033a3f2c710aa000        telegraf        72h0m0s         InfluxData      033a3f2c708aa000

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

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

Write the same point using curl:

curl --header "Authorization: Token $(cat ~/.influxdbv2/credentials)" --data-raw "m v=2 $(date +%s)" "http://localhost:9999/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 -o InfluxData '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 fancy REPL:

$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx repl -o InfluxData
> 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:22:44.776351000Z  2019-12-30T23:22:44.776351000Z                       v                       m  2019-12-30T23:17:02.000000000Z                             2
>

Introducing Flux

Flux is an MIT-licensed data scripting language (previously named IFQL) used for querying time series data from InfluxDB. The source for Flux is available on GitHub. Learn more about Flux from CTO Paul Dix's presentation.

Contributing 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 influx server the ui. You can run them locally in two steps:

  • Start the server in "testing mode" by running make run-e2e.
  • Run the tests with make e2e.
You can’t perform that action at this time.