When sending data through the EF2 framework report_metric() function, I experience what I believe are delays in data being sent to Dynatrace. This is viewable in Data Explorer, where the count function shows two data points for some minutes:
But when looking at the extension logs, that shouldn’t occur. I have removed in the log below the initial part, and changed sensitive info:
[out]2025-05-12 12:03:06,999 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:03:36,064 [INFO] api (ThreadPoolExecutor-1_2): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:04:07,006 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:04:36,041 [INFO] api (ThreadPoolExecutor-1_0): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:05:07,002 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:05:36,055 [INFO] api (ThreadPoolExecutor-1_3): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:06:07,000 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:06:36,049 [INFO] api (ThreadPoolExecutor-1_2): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:07:07,000 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:07:36,049 [INFO] api (ThreadPoolExecutor-1_3): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:08:06,999 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:08:36,054 [INFO] api (ThreadPoolExecutor-1_2): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:09:07,003 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:09:36,045 [INFO] api (ThreadPoolExecutor-1_1): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
[out]2025-05-12 12:10:06,999 [INFO] my_ext (ThreadPoolExecutor-0_0): App Debug finishing
[out]2025-05-12 12:10:36,057 [INFO] api (ThreadPoolExecutor-1_3): Sent 1 metric lines to EEC: [MintResponse(lines_ok=1, lines_invalid=0, error=None, warnings=None)]
And, it seems that data is only being sent out after 29 seconds…
I normally use to send data through the line protocol directly to the AG, but using report_metric() should be better…
How can I guarantee that data that is sent by the extension is immediately sent to Dynatrace?

