This is a simple Microservice written in Elixir. The Magellan-Microservice provides a basic app-status and health page. It also provides the possibility to plug in a custom router.
Documentation can be found here.
Add the following line to your mix.exs deps:
{:magellan_microservice, "0.3.0"}
To start the Microserice, just add it to the applications in your mix.exs.
def application do
[applications: [:magellan_microservice],
mod: {Your.App, []}]
end
To use your custom plug-router, register it at start-up time.
MagellanMicroservice.Router.register_router(Example.Router)
To add a status-function to the app-status, just pass it to: register_status_fun
.
MagellanMicroservice.AppStatus.register_status_fun(:name, &your_status_fun/0)
The following configuration has to be provided.
config :magellan_microservice,
status: "/status",
health: "/health",
port: 8080
To run the test, you need to provide the PORT
as an env-variable.
PORT=9121 mix test
Basic metrics to prometheus- test metrics endpoint
- Status and health determined by some strategy
- useful status function in router
- useful status function in server
- Multiple Router
- custom router works with instrumentation?