GithubHelp home page GithubHelp logo

t0w3n / errorpush Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hauxir/errorpush

0.0 0.0 0.0 22 KB

Minimalist Error collection Service compatible with Rollbar clients. Sentry or Rollbar alternative.

License: MIT License

Dockerfile 3.77% Python 93.50% Shell 2.73%

errorpush's Introduction

Minimalist Error collection Service

Features

  • Compatible with any Rollbar client(see https://docs.rollbar.com/docs). Just change the endpoint URL to your errorpush URL.
  • Inserts all error logs into a single PostgreSQL table.

Why use this over Sentry/Rollbar?

  • Instant setup
  • Free
  • No rate limiting
  • When you don't need all the bells and whistles: just want to log all errors into a database.
  • Flexibility - use whatever you want to query the PostgresQL table for errors

Running

errorpush requires docker

docker run -p 5000:5000 -e ACCESS_TOKEN=<your_access_token_of_choice> -e POSTGRES_URI=postgres://username:[email protected]/yourdb hauxir/errorpush:latest

That's it, just set up a reverse proxy and point your rollbar client to your server.

Example Query

SELECT error_id, Max(( ( BODY ->> 'trace' ) :: jsonb ->> 'exception' ) :: jsonb ->> 'class') AS EXCEPTION, Max(( ( BODY ->> 'message' ) :: jsonb ->> 'body' )) AS message, Count(*), Max(timestamp) AS last_seen FROM   errors GROUP  BY error_id ORDER  BY last_seen DESC;
             error_id             | exception |   message    | count |         last_seen          
----------------------------------+-----------+--------------+-------+----------------------------
 8cca0a18f56269b5a5243f7cc2906f79 | NameError |              |     4 | 2021-09-08 18:34:05.751548
 b6012c1be2bef37f570077f2ce2e908b |           |              |     2 | 2021-09-08 18:15:09.944348
 5acf76ad5f327d811ca9282b5d5a933a |           | Hello world! |     3 | 2021-09-08 18:15:09.944308
 794ef3b916db810d9162ad54aff32a14 |           | HEY          |     1 | 2021-09-08 18:12:19.705926
(4 rows)

Metabase

You can use metabase to visualize the data.

Screenshot 2021-09-11 at 00 14 58

PostgreSQL view for the above image:

create view error_report as 
select 
  error_id, 
  max(
    concat(
      coalesce(
        (
          (body ->> 'trace'):: jsonb ->> 'exception'
        ):: jsonb ->> 'class', 
        'Error'
      ), 
      ': ', 
      (
        (body ->> 'trace'):: jsonb ->> 'exception'
      ):: jsonb ->> 'message', 
      (body ->> 'message'):: jsonb ->> 'body'
    )
  ) as error, 
  count(*) as occurences, 
  max(timestamp) as last_seen, 
  max(
    array_to_string(
      array(
        select 
          concat(
            el ->> 'filename', ':', el ->> 'lineno'
          ) 
        from 
          jsonb_array_elements(
            (
              (body ->> 'trace'):: jsonb ->> 'frames'
            ):: jsonb
          ) as el 
        limit 
          4
      ), 
      ', '
    )
  ) as trace, 
  max(environment) as environment, 
  max(custom ->> 'revision') as revision 
from 
  errors 
group by 
  error_id 
order by 
  last_seen desc;

errorpush's People

Contributors

hauxir 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.