Go to file
Daniel Moran ff6b55aca4
feat(flux): allow values of 0 to disable controller limits (#21127)
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2021-04-05 16:58:27 -04:00
.circleci build: add windows to cross-build (#21109) 2021-03-31 18:52:20 -04:00
.github feat(http): allow for disabling pprof (#20827) 2021-03-04 09:28:03 -05:00
authorization refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
authorizer refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
backup refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
bolt refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
checks refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
chronograf feat(http): allow for disabling pprof (#20827) 2021-03-04 09:28:03 -05:00
cmd feat(flux): allow values of 0 to disable controller limits (#21127) 2021-04-05 16:58:27 -04:00
context refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
dashboards refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
dbrp refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
docker build: adjust emulator setup and ordering for Docker cross-build (#20503) 2021-01-12 10:41:13 -08:00
docs build: remove npm replace with yarn (#14176) 2019-06-21 16:19:42 -07:00
etc fix(fluxtest): fix load storage to read/write the bucket correctly (#21058) 2021-03-26 15:58:04 -05:00
flux refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
fluxinit refactor: replace builtin package with fluxinit/static (#3304) (#19909) 2020-11-05 16:54:28 -08:00
gather refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
http refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
influxql refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
inmem refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
internal tests(storage/flux): port table tests for the storage engine (#21128) 2021-04-01 16:44:54 -05:00
jsonweb refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
kit refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
kv refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
label refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
logger test: replace influxlogger with zaptest logger (#20589) 2021-02-11 10:12:39 -05:00
mock refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
models build: fix 'go generate' and regenerate the universe (#21089) 2021-03-30 10:32:14 -04:00
nats chore: Remove fragile nats port assignment loop 2020-11-13 09:13:48 +11:00
notification refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
pkg build: delete vendored copy of gogo protos (#21098) 2021-03-30 14:26:05 -04:00
pkger refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
pprof refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
predicate refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
prometheus refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
query feat(flux): allow values of 0 to disable controller limits (#21127) 2021-04-05 16:58:27 -04:00
rand refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
resource refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
restore refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
scripts build: add windows to cross-build (#21109) 2021-03-31 18:52:20 -04:00
secret refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
session refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
snowflake refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
source refactor(kv): delete deprecated kv service code 2020-11-16 12:41:26 +00:00
storage tests(storage/flux): port table tests for the storage engine (#21128) 2021-04-01 16:44:54 -05:00
task feat(flux): allow values of 0 to disable controller limits (#21127) 2021-04-05 16:58:27 -04:00
telegraf refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
telemetry chore: add goimports 2021-01-29 14:06:52 -05:00
tenant refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
testing refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
tests refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
toml fix: correct various typos (#19987) 2020-11-11 13:54:21 -05:00
tools/tmpl refactor: modify tooling to take advantage of go run 2018-10-15 11:01:27 -05:00
tsdb refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
ui feat: synchronize ui folder with ui repository (#21090) 2021-03-31 10:55:49 -04:00
uuid chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
v1 build: delete vendored copy of gogo protos (#21098) 2021-03-30 14:26:05 -04:00
vault refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
write refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
zap refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
.editorconfig chore(editorconfig): revert editorconfig changes, too much work 2020-06-25 18:16:57 +01:00
.gitignore fix(tls): Update TLS strict cipher suite to actually work (#20921) 2021-03-16 10:45:27 -04:00
.goreleaser.yml build: add windows to cross-build (#21109) 2021-03-31 18:52:20 -04:00
CHANGELOG.md feat(flux): allow values of 0 to disable controller limits (#21127) 2021-04-05 16:58:27 -04:00
CONTRIBUTING.md docs: remove broken reference to old DEVELOPMENT.md (#20984) 2021-03-17 10:55:36 -04:00
Dockerfile fix: switch port to 8086 2020-09-03 14:40:29 -07:00
FUZZ.md docs: Update FUZZ.md 2020-10-26 10:43:21 -07:00
LICENSE Initial commit 2018-05-09 09:17:31 -07:00
Makefile fix(tls): Update TLS strict cipher suite to actually work (#20921) 2021-03-16 10:45:27 -04:00
README.md fix(ui): correct the default port used in UI examples (#20809) 2021-03-02 11:59:10 -05:00
SECURITY.md chore: Update table of supported security updates 2020-09-28 15:19:25 -07: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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
authz_test.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
backup.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -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: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04: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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
dashboard_test.go test: verify geo configuration serialization 2020-12-18 19:37:08 +01:00
dbrp_mapping.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04: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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
delete.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -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 fix: make AST-based option parsing the default, remove feature flag (#20875) 2021-03-08 09:51:21 -05:00
go.mod build: add windows to cross-build (#21109) 2021-03-31 18:52:20 -04:00
go.sum build: add windows to cross-build (#21109) 2021-03-31 18:52:20 -04: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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -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
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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -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
query.go refactor(http): remove the spec and update lang usage (#17148) 2020-03-09 13:30: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
semaphore.go refactor: simpify Semaphore interface 2019-10-23 19:49:48 +01:00
session.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04: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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
tag_test.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
task.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
task_errors.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
task_test.go fix: make AST-based option parsing the default, remove feature flag (#20875) 2021-03-08 09:51:21 -05:00
telegraf.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
telegraf_test.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
tenant.go test: add tests for tenant service 2020-03-19 11:34:15 +01:00
token.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
tools.go chore: add goimports 2021-01-29 14:06:52 -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 refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
user_resource_mapping.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
user_resource_mapping_test.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -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 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.

Installing

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.

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: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

Writing 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.

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.