Code Monkey home page Code Monkey logo

apollo-monitor's Introduction

Apollo monitor

A simple app to regularly run queries on an Apollo database and inject results into an influxdb database.

Configuring

The following options are available:

DELAY=1440  # Delay in minutes between each call (script written to collect data only once per day, you'll get duplicate values in influx db if you run it more frequently)
DB_STRING=postgresql://postgres:password@apollo-db/postgres  # Connection string to the Apollo SQL db
INFLUX_HOST=influx  # Host to connect to influxdb
INFLUX_PORT=8086  # Port to connect to influxdb
INFLUX_DB=apollo  # Name of the influxdb db (created if not found)
INSTANCE_NAME=server1  # Shortname of the apollo instance
OPTIONS=  # Add "-d" to enable dry-run mode, and/or "--suffix @example.org" to remove suffix from usernames

Checkout docker-compose.prod.yml for an example.

A preconfigured Grafana dashboard is available in ./grafana/, feel free to adapt/adopt as needed.

## Loading old data

You can load old data by running this while the container is running (to load from 2015 to 2021 in this example):

docker-compose exec apollo-monitor bash
python /apollo-monitor/monitor.py "$DB_STRING" "$INFLUX_HOST" "$INFLUX_PORT" "$INFLUX_DB" "$INSTANCE_NAME" $OPTIONS --from-date 20170101 --to-date 20210101

Note that the old total numbers of organisms and users are not kept in Apollo database, so their values will not be loaded into influxdb for past dates.

apollo-monitor's People

Contributors

abretaud avatar

Watchers

 avatar James Cloos avatar Olivier Sallou avatar  avatar  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.