-
Notifications
You must be signed in to change notification settings - Fork 24
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
Metrics documentation update #171
Conversation
Assuming that MongoosePush was started with the following command: MIX_ENV=integration mix do test.env.up You can start Prometheus configured to monitor MongoosePush in container executing the command below: docker-compose -f test/docker/docker-compose.prometheus.yml up -d
This is to capture some of the events emitted when APNS or FCM services start
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.
Fantastic!
The only thing I'd say is that MPush docs, i.e., a single README, is getting out of control with the size, but reorganising that is on a different task 🙂
Oh, and some articles were missing 😛
children = | ||
service_children() ++ [MongoosePushWeb.Endpoint, MongoosePush.Metrics.TelemetryMetrics] | ||
[MongoosePush.Metrics.TelemetryMetrics] ++ service_children() ++ [MongoosePushWeb.Endpoint] |
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.
Good catch 🙂
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.
Great update! However, reading through 600 lines of readme is a bit much so that may be something we want to change in the near future.
README.md
Outdated
|
||
* `mongoose_push_supervisor_init_count{service=${SERVICE}}` - Counts number of push notification service supervisor starts. | ||
The `SERVICE` variable can take `"apns"` or `"fcm"` as a value. | ||
This metrics is update when MongoosePush starts or later when the underlying supervision tree is terminated and the error is propagate to the main application supervisor. |
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.
This metrics is update when MongoosePush starts or later when the underlying supervision tree is terminated and the error is propagate to the main application supervisor. | |
This metric is updated when MongoosePush starts or later when the underlying supervision tree is terminated and the error is propagated to the main application supervisor. |
@@ -1,5 +1,5 @@ | |||
# This file needs to be used along with `docker-compose.mocks.yml`: | |||
# docker-compose -f test/docker/docker-compose.mocks.yml -f test/docker/docker-compose.mpush.yml ... | |||
# PRIV=priv docker-compose -f test/docker/docker-compose.mocks.yml -f test/docker/docker-compose.mpush.yml ... |
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.
Why do we need this change?
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 docker-compose-mpush.yml
requires the PRIV
env var. It's set for us when we do mix text.env.up
but when running from console we need to export it manually.
@NelsonVides @kmakiela thanks for the review. I 100% agree with the documentation split/refactoring. This is definitely a subject for a separate PR. |
bfd3005
to
1d4a1aa
Compare
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.
Good stuff! I really like the PR, we just need to make sure that the part regarding less or equal
is accurate as it can be a bit confusing.
README.md
Outdated
* `LE` defines the `less or equal` values for buckets, currently `1000`, `10_000`, `25_000`, `50_000`, `100_000`, `250_000`, `500_000`, `1000_000` or `+Inf` | ||
|
||
> **NOTE** | ||
> A mesurment of value 50_000 will be added to all buckets which are less or equal to 50_000. |
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.
Not sure if I understand this right, I think this is the other way around. The bucket contains measurements that are less or equal to the bucket size.
More particularly they're counters which form a cumulative histogram, le stands for less than or equal to. So 26688 requests took less than or equal to 200ms, 27760 requests took less than or equal to 400ms, and there were 28860 requests in total.
https://www.robustperception.io/how-does-a-prometheus-histogram-work
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.
Right, I messed with that. Good catch!
README.md
Outdated
``` | ||
|
||
The above command assumes that MongoosePush runs on `localhost` and listens on port `8443`. | ||
Please, mind the `HTTPS` protocol, metrics are hosted on the same port as other API. |
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.
Please, mind the `HTTPS` protocol, metrics are hosted on the same port as other API. | |
Please, mind the `HTTPS` protocol, metrics are hosted on the same port as other API endpoints. |
How about this as compromise?
the same as
seems more grammatically correct than the same than
Telemetry.Metrics.counter( | ||
"mongoose_push.apns.state.get_default_topic.count", |
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.
Telemetry.Metrics.counter( | |
"mongoose_push.apns.state.get_default_topic.count", | |
Telemetry.Metrics.counter("mongoose_push.apns.state.get_default_topic.count", |
just for consistency with the remaining events.
1d4a1aa
to
65326aa
Compare
@janciesla8818 thanks for the review. I think I applied all the comments now. |
Co-authored-by: Nelson Vides <nelson.vides@erlang-solutions.com>
65326aa
to
7e7e451
Compare
This PR is primarily about metrics documentation update. It also contains the following changes which may be extracted to separate PR based on review comments.
MongoosePush.Metrics.TelemetryMetrics
child befor others to captuer events at startup