Code Monkey home page Code Monkey logo

digitransit-sentry-analytics's Introduction

digitransit-sentry-analytics

Build

Sentry issue filtering and processing. Python scripts are designed to be run on python 3.

Basic usage

  • Environmental variables
    • SENTRY_BASE_URL - mandatory, defines base url for the sentry API that ends with /api/0/
    • SENTRY_TOKEN - mandatory, authentication token
    • ZERO_ROUTES_ID - mandatory for zero_routing.py script, issue ID
    • DISABLE_CACHE - optional, if true, no caching of fetched events

As of now, this project can only be used for processing Zero routes found routing issue. This project contains zero_routing.py script that fetches events related to that issue, filters out events with known issues, and generates a HTML report and CSV files from those events.

By default, the script caches the events in results.dat file and does not fetch them again unless that file is deleted. Alternatively, you can use environmental variable DISABLE_CACHE=true to not cache the events. If script executes succesfully, HTML report and CSV files should be found under reports directory.

Docker, cron and nginx

  • Additional environmental variables
    • BUILD_INTERVAL - optional, as days, defaults to 7
    • BUILD_TIME - optional, as days, defaults to 23:00:00 (UTC time)
    • USER_NAME - optional, username for nginx basic authentication
    • USER_PASS - optional, password for nginx basic authentication
    • SLACK_WEBHOOK_URL - optional, URL for a Slack webhook
    • ENTRIES - how many error events are fetched (gets rounded to upper hundred)

This project contains a Dockerfile that builds a container that has a CRON-like shell script for running zero_routing.py script. Additionally, nginx is running on the background and from container port 8080, you can access the report generated by the script and the CSV files. These files are protected by basic authentication.

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.