hootsuite / healthchecks Goto Github PK
View Code? Open in Web Editor NEWA go implementation of the Health Checks API used for microservice exploration, documentation and monitoring.
License: Other
A go implementation of the Health Checks API used for microservice exploration, documentation and monitoring.
License: Other
Hi team @hootsuiteadmin ,
I implement a service that use fasthttp, and want to use this healthchecks framework to integrate to my service? How can I do that?
The following is the code to register "elastic" endpoint, the http service is running in port 9200 and in localhost.
elastic := healthchecks.StatusEndpoint{
Name: "elastic Service",
Slug: "elastic",
Type: "external",
IsTraversable: true,
StatusCheck: httpsc.HttpStatusChecker{
BaseUrl: "http://localhost:9200",
},
TraverseCheck: nil,
}
statusEndpoints := []healthchecks.StatusEndpoint{ elastic}
http.Handle("/status/", healthchecks.Handler(statusEndpoints, "about.json", "version.txt", nil))
http.ListenAndServe(":3333", nil)
So, the command, "http://localhost:3333/status/elastic" , throws the below error.
["CRIT",{"description":"elastic Service","result":"CRIT","details":"Invalid response. Code: 405, Body: {\"error\":\"Incorrect HTTP method for uri [/status/aggregate] and method [GET], allowed: [POST]\",\"status\":405}"}]
the above error is expected, because i checked http.go file , i see that internally HTTPstatuschecker performs GET on http://localhost:9200/status/aggregate, which obviously throws 405.
Does above handler looks good or am I missing anything.
Regards,
Mohan
Add some logging for error at
Line 122 in 7031e68
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.