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

Replace Statix with Prometheus #17

Merged
merged 1 commit into from
Oct 11, 2018
Merged

Conversation

hauleth
Copy link
Contributor

@hauleth hauleth commented Oct 10, 2018

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

@@ -0,0 +1,3 @@
defmodule ImagerWeb.Plug.MetricsExporter do

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

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

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)

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

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

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)

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)

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)

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

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.

@hauleth hauleth force-pushed the use-prometheus-instead-of-statsd branch from 1cb3619 to f9a6929 Compare October 10, 2018 11:29
@coveralls
Copy link

coveralls commented Oct 10, 2018

Coverage Status

Coverage decreased (-0.3%) to 94.624% when pulling 9b8a7f7 on use-prometheus-instead-of-statsd into d418845 on master.

@hauleth hauleth force-pushed the use-prometheus-instead-of-statsd branch 2 times, most recently from 5ed6f46 to e241d19 Compare October 11, 2018 11:59
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
@hauleth hauleth force-pushed the use-prometheus-instead-of-statsd branch from e241d19 to 9b8a7f7 Compare October 11, 2018 12:05
@hauleth hauleth merged commit 997aa08 into master Oct 11, 2018
@hauleth hauleth deleted the use-prometheus-instead-of-statsd branch October 11, 2018 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants