-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version upgrade of influxDB for 1.x to 2.x
Updates - New InfluxClient added to support 2.x - INIT env variables added to docker compose file to intial setup of influx db - Telegraf version upgrade - Env variables added in circleCI config - output.conf updated with outputs.influxdb_v2
- Loading branch information
AGARWAL Harsh Mohan (INTERN)
authored and
AGARWAL Harsh Mohan (INTERN)
committed
Jun 27, 2023
1 parent
1dca64d
commit 7844003
Showing
10 changed files
with
137 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -56,6 +56,7 @@ coverage.xml | |
.hypothesis/ | ||
.pytest_cache/ | ||
pytestdebug.log | ||
test_results/ | ||
|
||
# Translations | ||
*.mo | ||
|
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,32 +1,26 @@ | ||
# Configuration for influxdb server to send metrics to | ||
# this is an example, of what can be done. Not included in docker build. | ||
[[outputs.influxdb]] | ||
[[outputs.influxdb_v2]] | ||
## The URLs of the InfluxDB cluster nodes. | ||
## | ||
## Multiple URLs can be specified for a single cluster, only ONE of the | ||
## urls will be written to each interval. | ||
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"] | ||
urls = ["${INFLUXURL}"] | ||
database = "telegraf" | ||
|
||
database_tag = "db_tag" | ||
exclude_database_tag = true | ||
## API token for authentication. | ||
token = "${INFLUXDB_TOKEN}" | ||
|
||
## Retention policy to write to. Empty string writes to the default rp. | ||
retention_policy = "" | ||
## Write consistency (clusters only), can be: "any", "one", "quorum", "all" | ||
write_consistency = "any" | ||
## Organization is the name of the organization you wish to write to; must exist. | ||
organization = "${INFLUXDB_ORG}" | ||
|
||
## Write timeout (for the InfluxDB client), formatted as a string. | ||
## If not provided, will default to 5s. 0s means no timeout (not recommended). | ||
timeout = "5s" | ||
|
||
# [[outputs.file]] | ||
# ## Files to write to, "stdout" is a specially handled file. | ||
# files = ["stdout"] | ||
## Destination bucket to write into. | ||
bucket = "${INFLUXDB_BUCKET}" | ||
|
||
# ## Data format to output. | ||
# ## Each data format has its own unique set of configuration options, read | ||
# ## more about them here: | ||
# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md | ||
# data_format = "json" | ||
## The value of this tag will be used to determine the bucket. If this | ||
## tag is not set the 'bucket' option is used as the default. | ||
bucket_tag = "db_tag" | ||
|
||
# [[outputs.prometheus_client]] | ||
# ## Address to listen on. | ||
# listen = ":9273" | ||
## If true, the bucket tag will not be added to the metric. | ||
# exclude_bucket_tag = false | ||
|
||
## Timeout for HTTP messages. | ||
timeout = "5s" |
This file contains 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
This file contains 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,6 @@ | ||
#! /bin/bash | ||
set -e | ||
|
||
influx bucket create --name nuodb_internal --retention 7d | ||
|
||
influx bucket create --name nuodb --retention 7d |
This file contains 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 |
---|---|---|
|
@@ -5,4 +5,4 @@ coverage>=3.7 | |
pytest-cov>=1.8.1 | ||
coveralls>=0.5 | ||
python-coveralls>=2.5 | ||
influxdb>=5.3.0 | ||
influxdb-client |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,41 +1,34 @@ | ||
from nuodb_test_class import * | ||
from .nuodb_test_class import * | ||
|
||
|
||
class TestNuoDB(NuoDBTelegrafTestClass): | ||
database_name = "nuodb" | ||
host = 'localhost' | ||
|
||
def test_measurements_ActualVersion(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementPresent(client, "ActualVersion"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementPresent(client, self.database_name, "ActualVersion"), timeout=120, interval=10) | ||
|
||
def test_measurements_ArchiveQueue(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementPresent(client, "ArchiveQueue"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementPresent(client, self.database_name, "ArchiveQueue"), timeout=120, interval=10) | ||
|
||
def test_measurements_ChairmanMigration(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementPresent(client, "ChairmanMigration"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementPresent(client, self.database_name, "ChairmanMigration"), timeout=120, interval=10) | ||
|
||
def test_measurements_CurrentActiveTransactions(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementPresent(client, "CurrentActiveTransactions"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementPresent(client, self.database_name, "CurrentActiveTransactions"), timeout=120, interval=10) | ||
|
||
def test_measurements_CurrentCommittedTransactions(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementPresent(client, "CurrentCommittedTransactions"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementPresent(client, self.database_name, "CurrentCommittedTransactions"), timeout=120, interval=10) | ||
|
||
def test_measurements_NodeId(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementPresent(client, "NodeId"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementPresent(client, self.database_name, "NodeId"), timeout=120, interval=10) | ||
|
||
def test_measurements_CurrentActiveTransactions_count(self): | ||
client = InfluxDBClient(self.host, 8086) | ||
client.switch_database(self.database_name) | ||
assert_await(lambda: self.assertMeasurementCountGt0(client, "CurrentActiveTransactions"), timeout=120, interval=10) | ||
client = getClient() | ||
assert_await(lambda: self.assertMeasurementCountGt0(client, self.database_name, "CurrentActiveTransactions"), timeout=120, interval=10) |
Oops, something went wrong.