custom metrics within a Trigger

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

custom metrics within a Trigger

Aleksander Sumowski
Hi all,
I'd like to measure how many events arrive within allowed lateness grouped by particular feature of the event. We assume particular type of events have way more late arrivals and would like to verify this. The natural place to make the measurement would be our custom trigger within onElement method as this is the place where we know whether event is late of not. The issue is that the only way to register MetricGroup at this moment is via Trigger.TriggerContext - which leads to re-registering and lots of logs:


`Name collision: Group already contains a Metric with the name XXX. Metric will not be reported.`

Any hints how to tackle it?

Thanks,
Aleksander
Reply | Threaded
Open this post in threaded view
|

Re: custom metrics within a Trigger

Dawid Wysakowicz-2

Do you mind sharing the code how do you register your metrics with the TriggerContext? It could help us identify where does name collisions come from. As far as I am aware it should be fine to use the TriggerContext for registering metrics.

Best,

Dawid

On 16/03/2021 17:35, Aleksander Sumowski wrote:
Hi all,
I'd like to measure how many events arrive within allowed lateness grouped by particular feature of the event. We assume particular type of events have way more late arrivals and would like to verify this. The natural place to make the measurement would be our custom trigger within onElement method as this is the place where we know whether event is late of not. The issue is that the only way to register MetricGroup at this moment is via Trigger.TriggerContext - which leads to re-registering and lots of logs:


`Name collision: Group already contains a Metric with the name XXX. Metric will not be reported.`

Any hints how to tackle it?

Thanks,
Aleksander

OpenPGP_signature (855 bytes) Download Attachment