Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to base library #3

Closed
deadtrickster opened this issue Mar 9, 2017 · 1 comment
Closed

Refactor to base library #3

deadtrickster opened this issue Mar 9, 2017 · 1 comment

Comments

@deadtrickster
Copy link
Owner

The idea is to have this lib as a foundation for other exporters - plugs, elli, cowboy, etc.

prometheus_httpd_config stays the same.
prometheus_http will have shared /metrics behaviour with two exports:

render/1

 `render(Env)`

Env is a map:

%{
  path => Path. %% present if you want prometheus_http to handle routing and registry extraction
  accept => Accept, %% accepted content types
  accept_encoding => AcceptEncoding, %% accepted encodings
  registry => Registry, %% ignored if path present, can generate 409 if registry config isn't auto
}

index/0

Renders standard welcome page with useful links and current metrics path.

Both return {Code, Headers, Body}.

@deadtrickster
Copy link
Owner Author

I think this is exactly what prometheus_http_impl does, And it's used by a couple of libs already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant