A Console Application to collect measures for TICK Stack.
| -- .env -> Environment variables configuration
| -- docker-compose.yml -> Docker
| -- launch.bat -> The launcher of the project
| -- /chronograf/ -> Configuration files for TICK Stack + data storage
| -- /influxdb/
| -- Config
|-- influxdb.conf
| --/kapacitor/
| -- /Config/
|-- kapacitor.conf
| --/telegraf/
| -- telegraf.conf
| --/TICKStack.Monitoring.QuickStart/
| -- Dockerfile -> Docker
| -- App.config -> A configuration file to configure influxdb stuff.
| -- Program.cs -> Entry point of the application
| -- /Jobs/
| -- AbstractMonitoringJob.cs -> common abstract class
| -- HealthMonitoringJob.cs -> Job "Health" inserts entries in influxdb database "health"
| -- IJob.cs -> Job Interface
| -- PriceMonitoringJob.cs -> Job "Price" inserts entries in influxdb database "price"
You can configure some environment variables in the .env file. At the root of the solution, run the command :
launch.bat up
It will docker-compose to run the TICK Stack and the C# console application, It will open chronograf in a browser.
At first time launching chronograf, you will need to configure connexion to influxdb and kapacitor using the hostname:port 'influxdb:8086" + "kapacitor:9092" (docker urls) instead of "localhost".
launch.bat down
launch.bat influxdb
launch.bat delete-data
In the root directory (at the root directory level):
docker build -t danmgs/tickstack-monitoring-console -f TICKStack.Monitoring.QuickStart/Dockerfile .
docker push danmgs/tickstack-monitoring-console:latest
You can find the docker image my repository on DockerHub.
Note : This way, instead of building the image, you are able to configure docker-compose.yml to pull the image like so:
tickstack-monitoring-console:
image: danmgs/tickstack-monitoring-console:latest
environment:
INFLUXDB_URL: $ENV_INFLUXDB_URL
INFLUXDB_DATABASE_NAME: $ENV_INFLUXDB_DATABASE_NAME
WRITE_INTERVAL_IN_SECONDS: $ENV_WRITE_INTERVAL_IN_SECONDS
links:
- influxdb
restart: always
depends_on:
- kapacitor
- influxdb
- telegraf
You will need to create the database in order to the console to store the datapoint.
You can create the database via Chronograf admin interface or via influxdb cli.
- Create database in influxdb with retention days (by default infinite)
CREATE DATABASE "price"
CREATE RETENTION POLICY "seven_days" ON "price" DURATION 7d REPLICATION 1 DEFAULT
Configure the app.config with the influxdb url, time interval, and database name :
<add key="WRITE_INTERVAL_IN_SECONDS" value="2"/>
<add key="INFLUXDB_URL" value="http://localhost:8086"/>
<add key="INFLUXDB_DATABASE_NAME" value="price"/>