Code Monkey home page Code Monkey logo

easymon's People

Contributors

anoldguy avatar bryant1410 avatar f-mer avatar georgeclaghorn avatar intrip avatar jeremy avatar mikian avatar packagethief avatar pchambino avatar wjessop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easymon's Issues

Easymon catches any request starting with /up even when it shouldn't

I have a site where the following path is being picked up by easymon:

/uppababy-2018-cruz-stroller-emmett-green.html

In the site, this path is a 404, which should then get picked up by our error controller and redirected to a configured destination but it seems like easymon is picking it up before that.

{"method":"GET","path":"/up/pababy-2018-cruz-stroller-emmett-green.html","format":"html","controller":"easymon/checks","action":"show","status":404,"duration":0.92,"view":0.49,"ip":"72.94.148.85","route":"easymon/checks#show","request_id":"7ad5a34f61be33b45a268c486ccd7e0d","source":"app-7f76cd6859-8z497","tags":["request"],"@timestamp":"2019-05-17T14:37:57.568Z","@version":"1"}

It is unclear how the path is changing from /uppababy-2018-cruz-stroller-emmett-green.html to /up/pababy-2018-cruz-stroller-emmett-green.htm

Make health check autodetectable.

Background: Rails 7.1 will be adding health checks. I work for Fly.io as a Rails Speciality and would like to make Fly.io automatically detect the presence of health checks and pre-configure applications to enable these health checks if I can detect them. The problem is that health checks can vary on paths and implementation. I have a pull request that has been merged into Rails 7.1, and a pull request open for the rails_healthcheck gem that enable me to discover the healthcheck endoint using the following code:

bin/rails runner "p Rails.application.routes.url_helpers.rails_health_check_path"

Easymon poses unique challenges. For starters, there can be multiple endpoints, and it would be desirable to provide a way to indicate which one is the default one. Easymon is also implemented as an engine, so the url helper is scoped to the engine.

Rather than making assumptions, I'm opening up an issue so we can discuss how to approach this problem. If there is code I can contribute, I'm willing to do the work. If there is a recommendation on how I can adjust my check, let me know.

See also:

Timing should be in ms

Currently, it's a huge float value in seconds. This should be in milliseconds, and rounded to 3 decimal places (because arbitrary).

Possible reflected XSS in Firefox when fetching an invalid check name

When passing an invalid check name to ChecksController#show, an exception is raised, resulting in a 406 response with the following body:

"No check named '#{name}'"

Firefox renders that body, and if the name includes any JavaScript code via <script> tags, it'll be executed.

ActiveRecordCheck fails on PostgreSQL

The current ActiveRecordCheck fails on Postgres, because SELECT 1=1 returns true, not 1 as the check expects.

On Postgres:

postgresql=> SELECT 1=1;
 ?column? 
----------
 t
(1 row)

postgresql=> SELECT 1;
 ?column? 
----------
        1
(1 row)

On MySQL:

mysql> SELECT 1=1;
+-----+
| 1=1 |
+-----+
|   1 |
+-----+

1 row in set (0.00 sec)
mysql> SELECT 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

Hence the check at https://github.com/basecamp/easymon/blob/master/lib/easymon/checks/active_record_check.rb#L21 fails on Postgres.

Would you consider changing the check to just SELECT 1, which would work on MySQL, Postgres, SQLite, and probably quite a few others?
Should I submit a pull request for the change?

Modify result objects so they're not just a status and a message if they're a checklist.

The idea being to return a richer data structure when we have a critical checklist. The critical checklist is getting flattened into a string:

"critical": {
        "success": true,
        "timing": "2.811",
        "message": "memcached: Up - 0.747ms\nthird-database: Up - 0.445ms\nother-database: Up - 1.214ms\ndatabase: Up - 0.271ms\n - Total Time - 2.677ms"
    }

This isn't ideal.

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.