-
Notifications
You must be signed in to change notification settings - Fork 2
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
Replace Statix with Prometheus #17
Conversation
@@ -0,0 +1,3 @@ | |||
defmodule ImagerWeb.Plug.MetricsExporter do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules should have a @moduledoc tag.
@@ -0,0 +1,3 @@ | |||
defmodule ImagerWeb.Plug.PipelineInstrumenter do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules should have a @moduledoc tag.
@@ -0,0 +1,29 @@ | |||
defmodule Imager.Instrumenter.Processing do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules should have a @moduledoc tag.
store.store(path, mime, stream, Keyword.merge(glob_opts, options)) | ||
|> Instrumenter.Storage.saved(store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipe chain should start with a raw value.
@@ -0,0 +1,37 @@ | |||
defmodule Imager.Instrumenter.Storage do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules should have a @moduledoc tag.
@@ -0,0 +1,15 @@ | |||
defmodule Imager.Instrumenter.Cache do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules should have a @moduledoc tag.
@@ -62,15 +59,15 @@ defmodule Imager do | |||
{:ok, {:unknown, mime, stream}} | |||
|
|||
_ -> | |||
Stats.increment("imager.process.failed", 1, tags: tags) | |||
Instrumenter.Processing.failed(store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nested modules could be aliased at the top of the invoking module.
@@ -53,7 +50,7 @@ defmodule Imager do | |||
|
|||
case Porcelain.Process.await(process) do | |||
{:ok, %{status: 0}} -> | |||
Stats.increment("imager.process.succeeded", 1, tags: tags) | |||
Instrumenter.Processing.succeeded(store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nested modules could be aliased at the top of the invoking module.
cache:#{elem(cache, 0)} | ||
)) | ||
|
||
Instrumenter.Processing.command(commands) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nested modules could be aliased at the top of the invoking module.
lib/imager.ex
Outdated
alias Imager.Store | ||
alias Imager.Tool | ||
alias Imager.Instrumenter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alias Imager.Instrumenter
is not alphabetically ordered among its group.
1cb3619
to
f9a6929
Compare
5ed6f46
to
e241d19
Compare
Prometheus pull method of metrics gathering suits better such application as it doesn't require gatherer to be configure always. It also provides metrics in much more "standardized" way as prometheus_phoenix and prometheus_plugs are quite norm when coming to the respective library metrics gathering. There are also predefined Grafana's dashboards that can be found there: https://github.com/deadtrickster/beam-dashboards
e241d19
to
9b8a7f7
Compare
Prometheus pull method of metrics gathering suits better such
application as it doesn't require gatherer to be configure always. It
also provides metrics in much more "standardized" way as
prometheus_phoenix and prometheus_plugs are quite norm when coming to
the respective library metrics gathering.
There are also predefined Grafana's dashboards that can be found there:
https://github.com/deadtrickster/beam-dashboards