Scalable datastore for metrics, events, and real-time analytics
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci chore(ci): Restore nightly schedule Jan 16, 2019
.github fix(.github): cleanup the pull request template Dec 21, 2018
authorizer fix(authorizer): do not require read action in order to perform a write Jan 18, 2019
bolt feat(influxdb): add authorization for user actions Jan 17, 2019
chronograf build(Makefile): fix glob expansion if find command Jan 16, 2019
cmd fix(influxdb): change resource to resource type Jan 15, 2019
context chore: rename imports from platform to influxdb Jan 10, 2019
docker WIP fix: Docker image 'influx' gets 'influx' binary Jan 14, 2019
etc chore(Makefile): add target to check generated files are accurate Dec 18, 2018
flux chore: rename imports from platform to influxdb Jan 10, 2019
fs Add the organization ID to the protoboard being instantiated as a das… Jan 17, 2019
gather fix(scraper): remove enriched type label Jan 17, 2019
http feat(http): hook handler's source svc to authorizer Jan 18, 2019
inmem feat(inmem): dashboards pagination Jan 17, 2019
internal chore(Makefile): remove yq dependency to generate ts client Dec 18, 2018
kit chore: rename imports from platform to influxdb Jan 10, 2019
kv chore: rename imports from platform to influxdb Jan 10, 2019
logger chore: rename imports from platform to influxdb Jan 10, 2019
mock feat(http): add renew session Jan 16, 2019
models chore: rename imports from platform to influxdb Jan 10, 2019
nats Ensure error don't end in punctuation: ST1005 Nov 30, 2018
pkg chore: rename imports from platform to influxdb Jan 10, 2019
prometheus chore: rename imports from platform to influxdb Jan 10, 2019
query fix(influxdb): change resource to resource type Jan 15, 2019
rand chore: rename imports from platform to influxdb Jan 10, 2019
scripts refactor: modify tooling to take advantage of go run Oct 15, 2018
snowflake chore: rename imports from platform to influxdb Jan 10, 2019
source chore: rename imports from platform to influxdb Jan 10, 2019
storage Merge branch 'master' into flux-staging Jan 15, 2019
task refactor(task): look up runs more efficiently Jan 16, 2019
telegraf/plugins chore: rename imports from platform to influxdb Jan 10, 2019
testing feat(influxdb): add authorization for user actions Jan 17, 2019
toml chore: rename imports from platform to influxdb Jan 10, 2019
tools/tmpl refactor: modify tooling to take advantage of go run Oct 15, 2018
tsdb Bulk log file delete Jan 15, 2019
ui feat(ui/dataLoaders): Add new collector from collectors tab Jan 18, 2019
uuid chore: rename imports from platform to influxdb Jan 10, 2019
vault chore: rename imports from platform to influxdb Jan 10, 2019
write chore: rename imports from platform to influxdb Jan 10, 2019
zap chore: rename imports from platform to influxdb Jan 10, 2019
.gitignore fix(ui): Fix UI generation issues Jan 16, 2019
.goreleaser.yml chore(image):Set image tag to version Jan 16, 2019
LICENSE Initial commit May 9, 2018
Makefile chore: add go.mod and go.sum to list of Go sources Jan 16, 2019
README.md Update README.md Jan 12, 2019
api-compat.Jenkinsfile ci: rename api-compatibility Jenkinsfile Jan 11, 2019
appveyor.yml ci: stop whitelisting appveyor branches Jan 14, 2019
auth.go fix(influxdb): change resource to resource type Jan 15, 2019
authz.go feat(influxdb): add authorization for user actions Jan 17, 2019
authz_test.go fix(influxdb): change resource to resource type Jan 15, 2019
bucket.go fix(influxdb): rename organizationID to orgID in json struct tags Jan 15, 2019
dashboard.go fix(platform): dashboard filter must implement paging filter Jan 17, 2019
dbrp_mapping.go chore: rename imports from platform to influxdb Jan 10, 2019
dbrp_mapping_internal_test.go chore: rename imports from platform to influxdb Jan 10, 2019
dbrp_mapping_test.go chore: rename imports from platform to influxdb Jan 10, 2019
error.go chore: rename imports from platform to influxdb Jan 10, 2019
errors.go feat(influxdb): authorize org service operations Jan 16, 2019
errors.md feat(errors): add errors lib Sep 8, 2018
errors_test.go chore: rename imports from platform to influxdb Jan 10, 2019
example_test.go chore: rename imports from platform to influxdb Jan 10, 2019
go.mod chore: update to Flux v0.16.1 Jan 17, 2019
go.sum chore: update to Flux v0.16.1 Jan 17, 2019
id.go chore: rename imports from platform to influxdb Jan 10, 2019
id_test.go chore: rename imports from platform to influxdb Jan 10, 2019
keyvalue_log.go chore: rename imports from platform to influxdb Jan 10, 2019
label.go chore: rename imports from platform to influxdb Jan 10, 2019
label_test.go chore: rename imports from platform to influxdb Jan 10, 2019
lookup.go fix(influxdb): change resource to resource type Jan 15, 2019
macro.go chore(testing): test macro by org Jan 15, 2019
macro_test.go feat(macro): addition of org ID to macros Jan 15, 2019
measurement.go chore: rename imports from platform to influxdb Jan 10, 2019
onboarding.go chore: rename imports from platform to influxdb Jan 10, 2019
operation_log.go chore: rename imports from platform to influxdb Jan 10, 2019
organization.go chore: rename imports from platform to influxdb Jan 10, 2019
paging.go filter buckets by FindOptions Jan 16, 2019
proto.go chore: rename imports from platform to influxdb Jan 10, 2019
query.go chore: rename imports from platform to influxdb Jan 10, 2019
scraper.go add(gather): add writer interface Jan 11, 2019
secret.go chore: rename imports from platform to influxdb Jan 10, 2019
session.go feat(http): add renew session Jan 16, 2019
source.go feat(influxdb): default source find options Jan 18, 2019
status.go chore: rename imports from platform to influxdb Jan 10, 2019
task.go fix(influxdb): rename organizationID to orgID in json struct tags Jan 15, 2019
task_test.go feat(tasks): update task options from api Jan 11, 2019
telegraf.go Add additional info links to plugin forms Jan 17, 2019
telegraf_test.go chore: rename imports from platform to influxdb Jan 10, 2019
token.go chore: rename imports from platform to influxdb Jan 10, 2019
tools.go chore: rename imports from platform to influxdb Jan 10, 2019
usage.go chore: rename imports from platform to influxdb Jan 10, 2019
user.go chore: rename imports from platform to influxdb Jan 10, 2019
user_resource_mapping.go fix(influxdb): change resource to resource type Jan 15, 2019
user_resource_mapping_test.go fix(influxdb): change resource to resource type Jan 15, 2019
view.go chore: rename imports from platform to influxdb Jan 10, 2019
view_test.go chore: rename imports from platform to influxdb Jan 10, 2019
write.go chore: rename imports from platform to influxdb Jan 10, 2019

README.md

InfluxDB CircleCI

This is the for InfluxDB 2.0 OSS, which includes parts that used to be known as Chronograf and Kapacitor.

If you are looking for the InfluxDB 1.x Go Client, we've created a new repo for that.

Installation

This project requires Go 1.11 and Go module support.

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

If you are getting an error loading module requirements error with bzr executable file not found in $PATH” on make, brew install bazaar (on macOS) before continuing. This error will also be returned if you have not installed npm. On macOS, brew install npm will install npm.

For information about modules, please refer to the wiki.

Basic Usage

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

$ make
...
env GO111MODULE=on go build -tags 'assets ' -o bin/darwin/influx ./cmd/influx
env GO111MODULE=on go build -tags 'assets ' -o bin/darwin/influxd ./cmd/influxd

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

Start the service. Logs to stdout by default:

$ bin/darwin/influxd

To write and read fancy timeseries data, you'll need to first create a user, credentials, organization and bucket. Use the subcommands influx user, influx auth, influx org and influx bucket, or do it all in one breath with influx setup:

$ bin/darwin/influx setup
Welcome to InfluxDB 2.0!
Please type your primary username: user

Please type your password: s3^R#tpA$s

Please type your password again: s3^R#tpA$s

Please type your primary organization name.: my-org

Please type your primary bucket name.: my-bucket

Please type your retention period in hours (exp 168 for 1 week).
Or press ENTER for infinite.: 72


You have entered:
  Username:          user
  Organization:      my-org
  Bucket:            my-bucket
  Retention Period:  72 hrs
Confirm? (y/n): y

UserID                  Username        Organization    Bucket
033a3f2c5ccaa000        user            my-org          my-bucket
Your token has been stored in /Users/you/.influxdbv2/credentials

~/.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        my-org
$ influx bucket find
ID                      Name            Retention       Organization    OrganizationID
033a3f2c710aa000        my-bucket       72h0m0s         my-org          033a3f2c708aa000

Write to measurement m, with tag v=2, in bucket my-bucket, which belongs to organization my-org:

$ bin/darwin/influx write --org my-org --bucket my-bucket --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=033a3f2c708aa000&bucket=033a3f2c710aa000&precision=s"

Read that back with a simple Flux query (currently, the query subcommand does not have a --org flag):

$ bin/darwin/influx query --org-id 033a3f2c708aa000 'from(bucket:"my-bucket") |> range(start:-1h)'
Result: _result
Table: keys: [_start, _stop, _field, _measurement]
                   _start:time                      _stop:time           _field:string     _measurement:string                      _time:time                  _value:float
------------------------------  ------------------------------  ----------------------  ----------------------  ------------------------------  ----------------------------
2019-01-10T19:24:06.806244000Z  2019-01-10T20:24:06.806244000Z                       v                       m  2019-01-10T20:04:09.000000000Z                             2

Use the fancy REPL:

$ bin/darwin/influx repl --org my-org
> from(bucket:"my-bucket") |> range(start:-1h)
Result: _result
Table: keys: [_start, _stop, _field, _measurement]
                   _start:time                      _stop:time           _field:string     _measurement:string                      _time:time                  _value:float
------------------------------  ------------------------------  ----------------------  ----------------------  ------------------------------  ----------------------------
2019-01-10T19:36:23.361220000Z  2019-01-10T20:36:23.361220000Z                       v                       m  2019-01-10T20:04:09.000000000Z                             2
>

Introducing Flux

We recently announced Flux, the MIT-licensed data scripting language (and rename for IFQL). The source for Flux is available on GitHub. Learn more about Flux from CTO Paul Dix's presentation.

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