-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract timestamped telemetry events to a helper module
- Loading branch information
1 parent
eb8e44e
commit 4525d18
Showing
4 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
%% @private | ||
%% @copyright 2023 Erlang Solutions Ltd. | ||
-module(amoc_telemetry). | ||
|
||
-export([execute/3]). | ||
|
||
-spec execute(EventName, Measurements, Metadata) -> ok when | ||
EventName :: telemetry:event_name(), | ||
Measurements :: telemetry:event_measurements(), | ||
Metadata :: telemetry:event_metadata(). | ||
execute(Name, Measurements, Metadata) -> | ||
TimeStamp = erlang:monotonic_time(), | ||
NameWithAmocPrefix = [amoc | Name], | ||
MetadataWithTS = Metadata#{monotonic_time => TimeStamp}, | ||
telemetry:execute(NameWithAmocPrefix, Measurements, MetadataWithTS). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters