Go to file
Johnny Steenbergen e6f1805e5e chore(inmem): nuke the duplicative inmem store
use kv store... its a thing
2019-12-30 11:04:45 -08:00
.circleci ci: run go race tests in parallel over 8 containers (#16288) 2019-12-18 23:47:26 -06:00
.github style: allow Merge commits in commit messages 2019-12-10 16:58:52 -08:00
authorizer chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
bolt feat(http): add functionality to retrieve/store telegraf config as toml (#16132) 2019-12-20 14:20:13 -07:00
chronograf chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
cmd feat(influx): add hide headers flag to influx cli task cmd 2019-12-27 14:41:55 -08:00
context feat(pkger): add dry run and apply functionality for telegraf resources 2019-12-04 13:50:42 -08:00
docker chore(docker): Update Influxd Dockerfile 2019-01-24 09:41:47 -05:00
docs build: remove npm replace with yarn (#14176) 2019-06-21 16:19:42 -07:00
endpoints chore: refactor notication endpoints to make a service out of notification endpoints 2019-12-17 10:49:06 -08:00
etc ci: handle CRLF in git commit messages when detecting binary files 2019-05-28 16:34:52 -07:00
flux chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
gather chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
http chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
inmem chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
internal chore(Makefile): remove yq dependency to generate ts client 2018-12-18 11:19:56 -07:00
jsonweb fix(jwt): jwt id's can't be invalid when marshaling (#16032) 2019-11-22 15:02:17 -07:00
kit feat(kit/check): Adds manual override capabilities to readiness endpoint. 2019-12-30 09:42:31 -05:00
kv chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
logger feat(tasks): remove flux stats from run log and replace with trace id (#16263) 2019-12-18 16:30:38 +01:00
mock feat(pkger): add apply functionality for task resource 2019-12-23 13:56:42 -08:00
models refactor: permanently enable uint64 support 2019-12-09 14:45:34 -05:00
nats chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
notification fix: add custom marshaler to dashboard builder config to stop breaking all external api clients with nil vals 2019-12-26 14:53:14 -08:00
pkg chore: refactor notication endpoints to make a service out of notification endpoints 2019-12-17 10:49:06 -08:00
pkger feat(pkger): fixup flux query normalization in exporting of task 2019-12-27 15:16:48 -08:00
predicate fix(flakey-test): refactored getSortedBucketNames for more consistency and predictability. Finished DWP API functionality (#15802) 2019-11-07 16:19:42 -08:00
prometheus chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
query fix(query): revert promqltests/go.sum (#16307) 2019-12-20 11:22:31 -08:00
rand feat(rand): comment the specific ID bytes removed 2019-09-08 02:52:49 -05:00
scripts chore: bump gogo/protobuf and regenerate 2019-04-03 15:42:33 -06:00
snowflake chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
source chore(http): refactor bucket|dashboard|label|umr|var http clients to use reusable HTTP client 2019-12-09 09:44:41 -08:00
storage chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
task feat(tasks): remove flux stats from run log and replace with trace id (#16263) 2019-12-18 16:30:38 +01:00
telegraf/plugins feat(http): expose list of available telegraf plugins (#16233) 2019-12-17 16:53:19 -07:00
telemetry chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
testing fix: add custom marshaler to dashboard builder config to stop breaking all external api clients with nil vals 2019-12-26 14:53:14 -08:00
toml chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
tools/tmpl refactor: modify tooling to take advantage of go run 2018-10-15 11:01:27 -05:00
tsdb chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
ui chore(redux-thunk): fix typings (#16335) 2019-12-27 14:01:16 -08:00
uuid chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
vault fix(vault): rename flags to match env vars and add missing token flag 2019-10-21 13:23:54 -07:00
write chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
zap chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
.editorconfig chore: add .editorconfig and enable in CI 2019-02-19 16:58:07 -08:00
.gitignore build: using libflux in OSS 2019-12-13 10:43:15 -05:00
.goreleaser-nightly.yml ci(goreleaser): create a release version of goreleaser 2019-01-23 14:19:05 -06:00
.goreleaser.yml ci(release): prefix archives with influxdb 2019-01-23 14:14:58 -08:00
CHANGELOG.md chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
CONTRIBUTING.md docs: create CONTRIBUTING.md 2019-12-20 10:36:40 +00:00
LICENSE Initial commit 2018-05-09 09:17:31 -07:00
Makefile build: using libflux in OSS 2019-12-13 10:43:15 -05:00
README.md chore(docs): updated readme to reflect password character minimum 2019-12-10 09:06:33 -05:00
SECURITY.md feat(security): add SECURITY.md file (#14878) 2019-09-05 12:09:15 -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 feat(createdAt): Added createdat and updatedAt to Authorization (#15784) 2019-11-07 06:46:30 -08:00
authz.go feat(pkger): add check dry run functionality 2019-12-18 12:15:08 -08:00
authz_test.go fix(influxdb): change resource to resource type 2019-01-15 12:57:57 -05:00
bucket.go fix(kv): don't stub system buckets when searching by name (#15928) 2019-11-18 23:33:15 -08:00
build.go feat(influxdb): Add global BuildInfo 2019-03-14 09:23:53 -07:00
check.go fix(kv): find checks by urm 2019-10-24 12:29:48 -04:00
crud_log.go chore(inmem): nuke the duplicative inmem store 2019-12-30 11:04:45 -08:00
dashboard.go fix: add custom marshaler to dashboard builder config to stop breaking all external api clients with nil vals 2019-12-26 14:53:14 -08:00
dashboard_test.go feat(ui): added date/time format for graphs (#16148) 2019-12-06 12:03:55 -08:00
dbrp_mapping.go fix(inmem): fix dbrp not found 2019-07-03 15:54:57 -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 chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
delete.go feat(influxdb): add delete interface 2019-10-18 12:02:52 -04:00
document.go feat(http): add audit log 2019-05-16 10:57:28 -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 an env script that will configure the environment for using go with libflux (#16271) 2019-12-18 16:45:55 -06:00
error.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
errors.go refactor: http error serialization matches the new error schema (#15196) 2019-09-19 10:06:47 -05:00
errors.md feat(errors): add errors lib 2018-09-07 21:45:47 -05:00
errors_test.go refactor: http error serialization matches the new error schema (#15196) 2019-09-19 10:06:47 -05:00
example_test.go chore: Remove several instances of WithLogger (#15996) 2019-12-04 15:10:23 -08:00
go.mod build(flux): update Flux to v0.57.0 2019-12-10 13:26:10 -06:00
go.sum build(flux): update Flux to v0.57.0 2019-12-10 13:26:10 -06:00
id.go fix(influxdb): use influxdb.Error in ID.Decode 2019-05-15 22:53:31 +08:00
id_test.go chore(ci): update go-tools 2019-08-22 10:55:05 -05: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 chore(http): add missing client methods for label/buckets GET reqs 2019-11-01 11:59:09 -07:00
label_test.go chore(ci): update go-tools 2019-08-22 10:55:05 -05:00
lookup.go fix(influxdb): change resource to resource type 2019-01-15 12:57:57 -05:00
measurement.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
notification.go feat(influxdb): add predicate package 2019-10-18 12:02:52 -04:00
notification_endpoint.go feat(http): add notification endpoint service 2019-12-10 12:40:17 -08:00
onboarding.go feat(kv): implemented key/value store with end-to-end integration tests 2019-02-19 17:47:19 -06:00
operation_log.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
organization.go feat(influxdb): add org create and update time 2019-05-20 17:36:29 -07:00
paging.go chore(http): refactor org service to use httpc client 2019-12-10 10:49:22 -08:00
passwords.go chore: refactor password service to provide userID instead of name 2019-11-20 09:16:31 -08:00
query.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
scraper.go feat(influxdb): add scraper filter 2019-04-25 11:33:34 -04:00
secret.go feat(http): add notification endpoint service 2019-12-10 12:40:17 -08: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 feat(authentication): Add cli args for specifying session length and renewal (#13924) 2019-05-15 10:16:47 -07:00
source.go fix: encode IDs as JSON map keys properly 2019-04-26 20:41:20 -07:00
status.go feat(kv): add new update 2019-03-28 11:46:41 -04:00
tag.go feat(pkger): add application functionality for the notification rules resource 2019-12-20 12:48:46 -08:00
tag_test.go fix(predicate): add string parser 2019-10-18 12:02:53 -04:00
task.go chore: refactor bits of checks and its dependencies for readability 2019-12-18 11:07:19 -08:00
task_errors.go feat(task): Allow tasks to run more isolated from other task systems (#15384) 2019-10-11 08:53:38 -06:00
task_test.go fix(tasks): fix every parsing 2019-11-12 14:46:19 -06:00
telegraf.go feat(http): add functionality to retrieve/store telegraf config as toml (#16132) 2019-12-20 14:20:13 -07:00
telegraf_test.go feat(http): add functionality to retrieve/store telegraf config as toml (#16132) 2019-12-20 14:20:13 -07:00
token.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
tools.go ci: use latest staticcheck 2019-09-04 16:34:45 -07:00
usage.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
user.go fix(influxdb): Always return user status 2019-09-24 15:19:16 -07:00
user_resource_mapping.go feat(influxdb): add support for templates 2019-03-06 13:18:31 -08:00
user_resource_mapping_test.go fix(influxdb): change resource to resource type 2019-01-15 12:57:57 -05:00
variable.go feat(pkger): add support for variable resource kind to pkger 2019-11-07 12:33:20 -08:00
variable_test.go Rename all occurences of Macro to Variable 2019-02-14 13:21:57 -08:00
write.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
yarn.lock feat(ui/DWP): added searchable dropdown for tag key and values for selected bucket (#15879) 2019-11-20 15:23:35 -08:00

README.md

InfluxDB CircleCI

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 InfluxDB 2.0, which includes functionality for Kapacitor (background processing) and Chronograf (the UI). If you are looking for the 1.x line of releases, there are branches for each of those. InfluxDB 1.8 will be the next (and likely last) release in the 1.x line and the working branch is here.

If you are looking for the InfluxDB 1.x Go Client, we've created a new repo for that. There will be a Go client for the 2.0 API coming very soon.

State of the Project

The latest InfluxDB 1.x is the stable release and recommended for production use. InfluxDB 2.0 (what's in the master branch) is currently in the alpha stage. This means that it is 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 alpha 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 weekly alpha updates. We will be cutting versioned releases every week starting in the first week of February. There will also be nightly builds.

Once we close on the final feature set of what will be in the first release of InfluxDB in the 2.x line, we will move into the beta phase. At that point, our intention is to avoid making breaking changes to the API or the Flux language. However, it still may be necessary to do so. We will do our best to keep this to an absolute minimum and clearly communicate ANY and ALL changes in this regard via the changelog.

The beta will still not be recommended for production usage. During the beta period we will focus on bug fixes, performance, and additive features (where time permits).

What you can expect Alpha and Beta Phases

Alpha

Weekly alpha releases with incremental feature additions and changes to the user interface

Planned additions include:

  • Initial alpha release only supports a single user through the UI and the permission assigned via the security token are "full access". This restriction will be relaxed delivering the ability to define multiple users and change the access permissions provided via the token.
  • 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
  • Delete API w/ predicates for time (and other)

Beta

Releases every 2 - 3 weeks or as needed

Planned activities include:

  • Performance tuning, stability improvements, and fine tuning based on community feedback.
  • Finalization of supported client libraries starting with JavaScript and Go.

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 2.0 available at the InfluxData downloads page.

Building From Source

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

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 2.0 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 alpha and beta phases of development of InfluxDB v2.0. This should allow a v2.0-alpha instance to be run alongside a v1.x instance without interfering on port 8086. InfluxDB v2.0 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: user

Please type your password: my-password

Please type your password again: my-password

Please type your primary organization name.: my-org

Please type your primary bucket name.: my-bucket

Please type your retention period in hours.
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

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 user --password my-password --org my-org --bucket my-bucket --retention 168 --token my-token --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        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/$(uname -s | tr '[:upper:]' '[:lower:]')/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/$(uname -s | tr '[:upper:]' '[:lower:]')/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/$(uname -s | tr '[:upper:]' '[:lower:]')/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 (previously named 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

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.