-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-4602] Added initial version of InfluxDB interpreter #3640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b6b9a48
[ZEPPELIN-4602] Added initial version of InfluxDB interpreter
rhajek 04b7e28
[ZEPPELIN-4602] Added licences
rhajek 8955205
[ZEPPELIN-4602] Updated README.md, removed specific maven-checkstyle-…
rhajek 34cd9ed
[ZEPPELIN-4602] BaseZeppelinContext replaced
rhajek 206848e
[ZEPPELIN-4602] updated influxdb client libraries to 1.7.0, added sup…
rhajek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| layout: page | ||
| title: "InfluxDB Interpreter for Apache Zeppelin" | ||
| description: "InfluxDB is an open-source time series database designed to handle high write and query loads." | ||
| group: interpreter | ||
| --- | ||
| <!-- | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| {% include JB/setup %} | ||
|
|
||
| # InfluxDB Interpreter for Apache Zeppelin | ||
|
|
||
| <div id="toc"></div> | ||
|
|
||
| ## Overview | ||
| [InfluxDB](https://v2.docs.influxdata.com/v2.0/) is an open-source time series database (TSDB) developed by InfluxData. It is written in Go and optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics. | ||
| This interpreter allows to perform queries in [Flux Language](https://v2.docs.influxdata.com/v2.0/reference/flux/) in Zeppelin Notebook. | ||
|
|
||
| ### Notes | ||
| * This interpreter is compatible with InfluxDB 1.8+ and InfluxDB 2.0+ (v2 API, Flux language) | ||
| * Code complete and syntax highlighting is not supported for now | ||
|
|
||
| ### Example notebook | ||
|
|
||
|  | ||
|
|
||
| ### Configuration | ||
| <table class="table-configuration"> | ||
| <tr> | ||
| <th>Property</th> | ||
| <th>Default</th> | ||
| <th>Value</th> | ||
| </tr> | ||
| <tr> | ||
| <td>influxdb.url</td> | ||
| <td>http://localhost:9999</td> | ||
| <td>InfluxDB API connection url</td> | ||
| </tr> | ||
| <tr> | ||
| <td>influxdb.org</td> | ||
| <td>my-org</td> | ||
| <td>organization name, Organizations are supported in InfluxDB 2.0+, use "-" as org for InfluxDB 1.8</td> | ||
| </tr> | ||
| <tr> | ||
| <td>influxdb.token</td> | ||
| <td>my-token</td> | ||
| <td>authorization token for InfluxDB API, token are supported in InfluxDB 2.0+, for InfluxDB 1.8 use 'username:password' as a token.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>influxdb.logLevel</td> | ||
| <td>NONE</td> | ||
| <td>InfluxDB client library verbosity level (for debugging purpose)</td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| #### Example configuration | ||
|
|
||
|  | ||
|
|
||
| ## Overview | ||
|
|
||
|
|
||
| ## How to use | ||
| Basically, you can use | ||
|
|
||
| ``` | ||
| %influxdb | ||
| from(bucket: "my-bucket") | ||
| |> range(start: -1h) | ||
| |> filter(fn: (r) => r._measurement == "cpu") | ||
| |> filter(fn: (r) => r.cpu == "cpu-total") | ||
| |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") | ||
| ``` | ||
| In this example we use data collected by `[[inputs.cpu]]` [Telegraf](https://github.com/influxdata/telegraf) input plugin. | ||
|
|
||
| The result of Flux command can contain more one or more tables. In the case of multiple tables, each | ||
| table is rendered as a separate %table structure. This example uses `pivot` | ||
| function to collect values from multiple tables into single table. | ||
|
|
||
| ## How to run InfluxDB 2.0 using docker | ||
| ```bash | ||
| docker pull quay.io/influxdb/influxdb:nightly | ||
| docker run --name influxdb -p 9999:9999 quay.io/influxdb/influxdb:nightly | ||
|
|
||
| ## Post onBoarding request, to setup initial user (my-user@my-password), org (my-org) and bucketSetup (my-bucket)" | ||
| curl -i -X POST http://localhost:9999/api/v2/setup -H 'accept: application/json' \ | ||
| -d '{ | ||
| "username": "my-user", | ||
| "password": "my-password", | ||
| "org": "my-org", | ||
| "bucket": "my-bucket", | ||
| "token": "my-token" | ||
| }' | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| InfluxDB 2.0 interpreter for Apache Zeppelin | ||
| ============================================ | ||
|
|
||
| ## Description: | ||
|
|
||
| Provide InfluxDB Interpreter for Zeppelin. | ||
|
|
||
| ## Build | ||
|
|
||
| ``` | ||
| mvn -pl influxdb -am -DskipTests package | ||
| ``` | ||
|
|
||
| ## Test | ||
|
|
||
| ``` | ||
| mvn -pl influxdb -am -Dtest='org.apache.zeppelin.influxdb.*' -DfailIfNoTests=false test | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
|
|
||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <artifactId>zeppelin-interpreter-parent</artifactId> | ||
| <groupId>org.apache.zeppelin</groupId> | ||
| <version>0.9.0-SNAPSHOT</version> | ||
| <relativePath>../zeppelin-interpreter-parent/pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>zeppelin-influxdb</artifactId> | ||
| <packaging>jar</packaging> | ||
| <version>0.9.0-SNAPSHOT</version> | ||
| <name>Zeppelin: InfluxDB interpreter</name> | ||
| <description>InfluxDB 2.0 timeseries database support</description> | ||
|
|
||
| <properties> | ||
| <interpreter.name>influxdb</interpreter.name> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <influxdb.client.version>1.7.0</influxdb.client.version> | ||
| <dependency.okhttp3.version>3.13.1</dependency.okhttp3.version> | ||
| <dependency.gson.version>2.8.5</dependency.gson.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.influxdb</groupId> | ||
| <artifactId>influxdb-client-java</artifactId> | ||
| <version>${influxdb.client.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.code.gson</groupId> | ||
| <artifactId>gson</artifactId> | ||
| <version>${dependency.gson.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.squareup.okhttp3</groupId> | ||
| <artifactId>mockwebserver</artifactId> | ||
| <version>${dependency.okhttp3.version}</version> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same licence issue as above
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apache 2, I added license to zeppelin-distribution/src/bin_license/LICENSE |
||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <artifactId>maven-enforcer-plugin</artifactId> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-dependency-plugin</artifactId> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-resources-plugin</artifactId> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the license of this dependency ? You need to put it in LICENCE file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MIT, I added license to zeppelin-distribution/src/bin_license/LICENSE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added RxJava (Apache2 license) (used by InfluxDB client library)