Skip to content

Commit 9f84dcf

Browse files
leszkerslota
andauthored
Exometer extermination (#160)
* exterminate exometer with its comrades * plow exometer footprints in readme * first draft of updated readme Co-authored-by: Rafał Słota <[email protected]>
1 parent 48d2c13 commit 9f84dcf

File tree

9 files changed

+8
-298
lines changed

9 files changed

+8
-298
lines changed

README.md

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -328,36 +328,6 @@ If you specify both **alert** and **data**, target device will receive both noti
328328
* **500** `{"reason" : reason}` - the server internal error occured,
329329
specified by **reason**.
330330

331-
## Metrics
332-
333-
MongoosePush supports metrics based on `elixometer`. In order to enable metrics, you need to add an `elixometer` configuration in the config file matching your release type (or simply `sys.config` when you need this on already released MongoosePush). The following example config will enable simplest reporter - TTY (already enabled in `:dev` environment):
334-
335-
```elixir
336-
config :exometer_core, report: [reporters: [{:exometer_report_tty, []}]]
337-
config :elixometer, reporter: :exometer_report_tty,
338-
env: Mix.env,
339-
metric_prefix: "mongoose_push"
340-
```
341-
342-
The example below on the other hand will enable `graphite` reporter (replace GRAPHITE_OPTIONS with a list of options for `graphite`):
343-
344-
Before making a release:
345-
```elixir
346-
config :exometer_core, report: [reporters: [{:exometer_report_graphite, GRAPHITE_OPTIONS}]]
347-
config :elixometer, reporter: :exometer_report_graphite,
348-
env: Mix.env,
349-
metric_prefix: "mongoose_push"
350-
```
351-
352-
or if you modify an existing release (`sys.config`):
353-
```erlang
354-
{exometer_core,[{report, [{reporters, [{exometer_report_graphite, GRAPHITE_OPTIONS}]}]}]},
355-
{elixometer,
356-
[{reporter, exometer_report_graphite},
357-
{env, prod},
358-
{metric_prefix, <<"mongoose_push">>}]},
359-
```
360-
361331
### I use MongoosePush docker, where do I find `sys.config`?
362332

363333
If you use dockerized MongoosePush, you need to do the following:
@@ -370,12 +340,14 @@ If you use dockerized MongoosePush, you need to do the following:
370340
### Available metrics
371341

372342
The following metrics are available:
373-
* `mongoose_push.${METRIC_TYPE}.push.${SERVICE}.${MODE}.error.all`
374-
* `mongoose_push.${METRIC_TYPE}.push.${SERVICE}.${MODE}.error.${REASON}`
375-
* `mongoose_push.${METRIC_TYPE}.push.${SERVICE}.${MODE}.success`
376343

344+
* `mongoose_push_apns_state_get_default_topic_count`
345+
* `mongoose_push_notification_send_time_bucket{error_category=${CATEGORY},error_reason=${REASON},service=${SERVICE},status=${STATUS},le=${LENGTH}}`
346+
* `mongoose_push_notification_send_time_sum{error_category=${CATEGORY},error_reason=${REASON},service=${SERVICE},status=${STATUS}}`
347+
* `mongoose_push_notification_send_time_count{error_category=${CATEGORY},error_reason=${REASON},service=${SERVICE},status="${STATUS}}`
377348
Where:
378-
* **METRIC_TYPE** is either `timers` or `spirals`
349+
* **CATEGORY** is an arbitrary error category term or empty string
350+
* **REASON** is an arbitrary error reason term or empty string
379351
* **SERVICE** is either `fcm` or `apns`
380-
* **MODE** is either `prod` or `dev`
381-
* **REASON** is an arbitrary error reason term
352+
* **STATUS** is either `success` or `error`
353+
* **LENGTH** is either `100` or `250` or `500` or `1000` or `+Inf`

config/dev.exs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
use Mix.Config
22

3-
config :exometer_core, report: [reporters: [{:exometer_report_tty, []}]]
4-
5-
config :elixometer,
6-
reporter: :exometer_report_tty,
7-
env: Mix.env(),
8-
metric_prefix: "mongoose_push"
9-
103
config :mongoose_push, loglevel: :debug
114
config :goth, endpoint: "http://fcm-mock:4001"
125

config/test.exs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ use Mix.Config
33
config :mongoose_push, loglevel: :debug
44
config :mongoose_push, backend_module: MongoosePush.Notification.MockImpl
55

6-
config :elixometer,
7-
reporter: :exometer_report_tty,
8-
env: Mix.env(),
9-
metric_prefix: "mongoose_push"
10-
116
config :mongoose_push, MongoosePushWeb.Endpoint,
127
https: [
138
port: 8443,

lib/mongoose_push/application.ex

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ defmodule MongoosePush.Application do
2929
loglevel = Application.get_env(:mongoose_push, :loglevel, :info)
3030
set_loglevel(loglevel)
3131

32-
# Only used for attaching Elixometer handler, which builds metrics based on emitted events
33-
MongoosePush.Telemetry.attach_all()
34-
3532
# Define workers and child supervisors to be supervised
3633
children =
3734
service_children() ++ [MongoosePushWeb.Endpoint, MongoosePush.Metrics.TelemetryMetrics]

lib/mongoose_push/metrics/exometer_handlers.ex

Lines changed: 0 additions & 126 deletions
This file was deleted.

lib/mongoose_push/telemetry.ex

Lines changed: 0 additions & 28 deletions
This file was deleted.

mix.exs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ defmodule MongoosePush.Mixfile do
4444
{:phoenix, "~> 1.4.16"},
4545
{:open_api_spex, "~> 3.6"},
4646

47-
# Just overrides to make elixometer compile...
48-
{:exometer_core, github: "esl/exometer_core", override: true},
49-
{:exometer_report_graphite, github: "esl/exometer_report_graphite"},
50-
{:elixometer, github: "esl/elixometer"},
51-
5247
# Below only :dev / :test deps
5348
{:mock, "~> 0.3", only: :test},
5449
# Until eproxus/meck #fcc551e3 is in a release, we need to use master version

mix.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@
1212
"dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"},
1313
"distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm", "bbc7008b0161a6f130d8d903b5b3232351fccc9c31a991f8fcbf2a12ace22995"},
1414
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
15-
"elixometer": {:git, "https://github.com/esl/elixometer.git", "6678c97f64ac8a4cf7ecbf32a4d342576d466b69", []},
1615
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
1716
"ex_doc": {:hex, :ex_doc, "0.21.3", "857ec876b35a587c5d9148a2512e952e24c24345552259464b98bfbb883c7b42", [:mix], [{:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "0db1ee8d1547ab4877c5b5dffc6604ef9454e189928d5ba8967d4a58a801f161"},
1817
"excoveralls": {:hex, :excoveralls, "0.12.3", "2142be7cb978a3ae78385487edda6d1aff0e482ffc6123877bb7270a8ffbcfe0", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "568a3e616c264283f5dea5b020783ae40eef3f7ee2163f7a67cbd7b35bcadada"},
19-
"exometer_core": {:git, "https://github.com/esl/exometer_core.git", "979ff04bcabc276c122b47fb7e6b54fbded62576", []},
20-
"exometer_report_graphite": {:git, "https://github.com/esl/exometer_report_graphite.git", "264dd7bcbadbd7febcd43917302251286c88b681", []},
2118
"goldrush": {:hex, :goldrush, "0.1.9", "f06e5d5f1277da5c413e84d5a2924174182fb108dabb39d5ec548b27424cd106", [:rebar3], [], "hexpm", "99cb4128cffcb3227581e5d4d803d5413fa643f4eb96523f77d9e6937d994ceb"},
2219
"goth": {:hex, :goth, "1.1.0", "85977656822e54217bc0472666f1ce15dc3921495ef5f4f0774ef15503bae207", [:mix], [{:httpoison, "~> 0.11 or ~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:joken, "~> 2.0", [hex: :joken, repo: "hexpm", optional: false]}], "hexpm", "d8d9e12fe744b5c91b6369a9b8f1da6682e80c95d204df35b376dac8a7211f2d"},
2320
"hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"},
2421
"hpack": {:git, "https://github.com/joedevivo/hpack.git", "6b58b6231e9b6ab83096715120578976f72f4f7c", [tag: "0.2.3"]},
2522
"httpoison": {:hex, :httpoison, "1.6.2", "ace7c8d3a361cebccbed19c283c349b3d26991eff73a1eaaa8abae2e3c8089b6", [:mix], [{:hackney, "~> 1.15 and >= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "aa2c74bd271af34239a3948779612f87df2422c2fdcfdbcec28d9c105f0773fe"},
26-
"hut": {:hex, :hut, "1.2.1", "08d46679523043424870723923971889e8a34d63b2f946a35b46cf921d1236e7", [:"erlang.mk", :rebar, :rebar3], [], "hexpm", "953fc447514baf9cc79fa147d66469243c94dfa1593779614e070c692d0bf0f3"},
2723
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"},
2824
"jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b659b8571deedf60f79c5a608e15414085fa141344e2716fbd6988a084b5f993"},
2925
"joken": {:hex, :joken, "2.2.0", "2daa1b12be05184aff7b5ace1d43ca1f81345962285fff3f88db74927c954d3a", [:mix], [{:jose, "~> 1.9", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm", "b4f92e30388206f869dd25d1af628a1d99d7586e5cf0672f64d4df84c4d2f5e9"},
@@ -48,7 +44,6 @@
4844
"plug": {:hex, :plug, "1.10.1", "c56a6d9da7042d581159bcbaef873ba9d87f15dce85420b0d287bca19f40f9bd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "b5cd52259817eb8a31f2454912ba1cff4990bca7811918878091cb2ab9e52cb8"},
4945
"plug_cowboy": {:hex, :plug_cowboy, "2.1.2", "8b0addb5908c5238fac38e442e81b6fcd32788eaa03246b4d55d147c47c5805e", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "7d722581ce865a237e14da6d946f92704101740a256bd13ec91e63c0b122fc70"},
5046
"plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"},
51-
"pobox": {:hex, :pobox, "1.0.4", "e695bc3b2b547dd6c8e5a19cb743396e6670e306ad3ff498844738f9418bd686", [:rebar3], [], "hexpm", "58392b75f8ad1c0ee09ae55bc7d30e867bed2dbd699f2735c6a97822329f5b76"},
5247
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"},
5348
"pollution": {:hex, :pollution, "0.9.2", "3f67542631071c99f807d2a8f9da799c07cd983c902f5357b9e1569c20a26e76", [:mix], [], "hexpm", "6399fd8ffd97dcc3d9d277f60542a234d644d7bcc0d48c8fda93d6be4801bac2"},
5449
"quixir": {:hex, :quixir, "0.9.3", "f01c37386b9e1d0526f01a8734a6d7884af294a0ec360f05c24c7171d74632bd", [:mix], [{:pollution, "~> 0.9.2", [hex: :pollution, repo: "hexpm", optional: false]}], "hexpm", "4f3a1fe7c82b767d935b3f7b94cf34b91ef78bb487ef256b303d77417fc7d589"},

test/unit/mongoose_push_metrics_test.exs

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)