basecamp / easymon Goto Github PK
View Code? Open in Web Editor NEWEasy Monitoring
License: MIT License
Easy Monitoring
License: MIT License
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
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:
We are experiencing issues addressed with the following commit:
9472135#diff-5892261b17dbd431a67ac4302cb920ca
Wondering if you would be able to release a new version to ruby gems when you have a moment.
Thanks.
Currently, it's a huge float value in seconds. This should be in milliseconds, and rounded to 3 decimal places (because arbitrary).
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.
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.