Giter Site home page Giter Site logo

coturn_exporter's Introduction

Coturn Exporter

Tests whether TURN servers are working and exports the result as a Prometheus metric

How to Run It

docker build -t coturn_exporter .
echo 'ip: 1.2.3.4' > config  # Replace with your TURN server's IP; see below for port, secret, and more
docker run \
  --mount type=bind,src="$(pwd)"/config,dst=/coturn_exporter_files/config,readonly \
  -p 127.0.0.1:80:9524 coturn_exporter

The Configuration File

You must mount a configuration file into the container at /coturn_exporter_files/config to specify the TURN server(s) to be checked and optionally other settings. Its format is YAML.

ip, port, and secret

If you have only one TURN server to check, you can specify its IP and optionally its port and/or secret at the root level of the config file.

ip: 1.2.3.4
port: 1234
secret: qwerty

If no port is specified, 3478 is assumed.

turn_servers

It is possible to specify more than one TURN server with the turn_servers key.

turn_servers:
  - ip: 1.2.3.4
    port: 1234
    secret: qwerty
  - ip: 9.8.7.6
    port: 9876
    secret: asdf

You must use exactly one of turn_servers and ip [+ port] [+ secret] at the root level.

interval

The optional key interval specifies the wait time between checks of each TURN server in seconds. It defaults to 900.

interval: 333.33

loglevel

The optional key loglevel specifies the verbosity of the Coturn Exporter. It can be one of DEBUG, INFO, WARNING, ERROR, or CRITICAL and defaults to WARNING.

loglevel: INFO

A Complete Example

---
loglevel: INFO
interval: 333.33
turn_servers:
  - ip: 1.2.3.4
    port: 1234
    secret: qwerty
  - ip: 9.8.7.6
    port: 9876
    secret: asdf
...

Output

Metrics are exported on port 9524. They will look like the following (plus some metrics added by the Prometheus Python client):

# HELP turnserver_state the state of the TURN server
# TYPE turnserver_state gauge
turnserver_state{host="1.2.3.4:1234",turnserver_state="ok"} 1.0
turnserver_state{host="1.2.3.4:1234",turnserver_state="not_ok"} 0.0
turnserver_state{host="1.2.3.4:1234",turnserver_state="unknown"} 0.0
turnserver_state{host="9.8.7.6:9876",turnserver_state="ok"} 0.0
turnserver_state{host="9.8.7.6:9876",turnserver_state="not_ok"} 1.0
turnserver_state{host="9.8.7.6:9876",turnserver_state="unknown"} 0.0

coturn_exporter's People

Contributors

emphoeller avatar tibroc avatar

Watchers

 avatar Tobias Thelen avatar Lars Kiesow avatar Rüdiger Rolf avatar Florian Feyen avatar  avatar

coturn_exporter's Issues

Using logging module

Instead of writing your own logging functions we could use the standard logging module.

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.