Skip to content

fr3dch3n/magellan-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magellan-Microservice Hex.pm

Build StatusInline docs

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.

Installation

Add the following line to your mix.exs deps:

{:magellan_microservice, "0.3.0"}

Example

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)

Configuration

The following configuration has to be provided.

config :magellan_microservice,
  status: "/status",
  health: "/health",
  port: 8080

Test

To run the test, you need to provide the PORT as an env-variable.

PORT=9121 mix test

Next Steps

  • 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?

About

Microservice-Framework in Elixir

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages