Coder Social home page Coder Social logo

tig_tutorial's Introduction

docker-compose project for TIG stack.

Usage

Set your desired values in .env.

# influxdb/telegraf
DOCKER_INFLUXDB_INIT_MODE=setup
DOCKER_INFLUXDB_INIT_USERNAME=admin
DOCKER_INFLUXDB_INIT_PASSWORD=changeme
DOCKER_INFLUXDB_INIT_ORG=tig_tutorial
DOCKER_INFLUXDB_INIT_BUCKET=tutorial
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=test-bucket-token
DOCKER_INFLUXDB_INIT_RETENTION=30d

Bring up the stack

docker compose up -d

Per default:

  • influxdb-v2 will be exposed at port 8086 and have a preconfigured bucket according to the "DOCKER_INFLUXDB_INIT_BUCKET" variable.
  • telegraf will have the "inputs_dns" as a preconfigured input which gathers dns query times in miliseconds - like Dig.
  • grafana will be exposed at port 3000 with anonymous login enabled i.e no login required.

Add influxdb-v2 as a datasource in grafana

  • Head over to http://localhost:3000
  • Click gear icon -> Data sources -> Add data source
  • Select InfluxDB
    • Name: friendly name
    • Query Language: Flux
    • URL: http://influxdb-v2:8086
    • Turn off Basic auth
    • Turn on Skip TLS Verify
    • Organization: the value of DOCKER_INFLUXDB_INIT_ORG in .env
    • Token: the value of DOCKER_INFLUXDB_INIT_ADMIN_TOKEN in .env
    • Default bucket: the value of DOCKER_INFLUXDB_INIT_BUCKET in .env
    • Save & test: You should see a message "datasource is working."

Test your TIG stack by performing a flux query

  • Click compass icon -> Explore
  • Make sure the influxdb database is selected in the dropdown.
  • Paste the query below where "tutorial" represents your value of DOCKER_INFLUXDB_INIT_BUCKET in .env
    from(bucket: "tutorial")
      |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
      |> filter(fn: (r) => r["_measurement"] == "dns_query")
      |> filter(fn: (r) => r["_field"] == "query_time_ms")
      |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
      |> yield(name: "mean")

tig_tutorial's People

Contributors

emilvonck avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.