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
549 additional application metrics 2 #851
Conversation
149624f
to
3bf5c22
Compare
a5b35a3
to
e6380ec
Compare
e6380ec
to
58df8ad
Compare
58df8ad
to
51f4fa4
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.
This is great @InoMurko! Dropped a few comments.
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.
LGTM, just a couple of non-blocking comments added
@@ -138,6 +144,7 @@ defmodule OMG.EthereumEventListener.Core do | |||
|
|||
height_to_check_in = get_height_to_check_in(new_state) | |||
db_update = [{:put, update_key, height_to_check_in}] | |||
:ok = :telemetry.execute([:process, __MODULE__], %{events: events}, state) |
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.
can we call this outside of .Core
so that it remains side-effect free?
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.
hm... what causes the side effect?
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.
Isn't talking to :telemetry
one?
Sorry if I'm having false assumptions here, but I'm guessing this talks to some dependency to do sth. .Core.xyz
functions are written with the intent of remaining pure.
Unless absolutely necessary we avoid doing calling external stuff in .Core.xyz
, I think the only exception was made for _ = Logger...
calls, but only in a few cases.
events
and state
are available outside, so the move seems to be an easy one.
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 event gets forwarded to the dedicated Ethereum event listener handler located in module OMG.EthereumEventListener.Measure
I don't quite understand what you mean by side effect though indeed the change isn't big, but would like to understand where keeping .Core.xyz
pure comes from.
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.
would like to understand where keeping .Core.xyz pure comes from.
Sure thing! It comes from the approach adopted, so segregate logic into such Core
modules, with no side effects/side causes. These modules would hold pure functions (same output for same input etc.). Then they can be robustly/quickly tested in unit tests and also I think they are easier to reason about, in general, being just these reliable chunks of logic.
3d155c8
to
35b1425
Compare
A previous commit removes logging and replaces it with datadog trace looks liek this: |
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.
🚀
📋 Add associated issues, tickets, docs URL here.
Overview
Migration from AppSignal to Datadog with Spandex, Spandex Ecto and Spandex Phoenix with supporting lib VmStats.
Changes
*...Measure
modules - they should be understood as an extension (like Core modules) to the parent process module) for named processes.increment_metrics_counter
functions in controller and will later add them as a Plug.Testing
No tests removed or features changed so same testing would apply.