-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Describe the bug
The default execution interval is 60 seconds, but in reality it is around 60.0x seconds.
Therefore, if data collection starts at 00:00:59.995, the next data collection start time will be 00:02:00.012, and data for 00:01 will not be collected, resulting in missing data when checking metrics in Data Explorer.
Please check this URL as it is the question I asked in the community.
https://community.dynatrace.com/t5/Extensions/The-execution-time-of-Extension-2-0-created-with-Python-is-a/m-p/248619
To Reproduce
Steps to reproduce the behavior:
- Create an extension for OneAgent using the SDK.
- Monitor any host with the extension.
- If you wait a few hours or days, you will miss 1 minute of metrics.
Expected behavior
1-minute metrics should not be missing no matter how many days it is run in a row.
The time when the query function is called should not be delayed no matter how many days have passed.
I don't think it's necessary for the difference from the previous time to be 0.000 seconds, but I don't think it's acceptable for it to be delayed by 1 to 30 milliseconds each time, as is the case now.
Screenshots
When I looked at the log, there was no start log at 17:54, and when I looked at DataExplorer, the data at 17:55 was missing.
2024-06-21 17:50:59,902 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:51:59,926 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:52:59,956 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:53:59,985 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:55:00,015 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:56:00,023 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:57:00,053 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:58:00,081 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 17:59:00,111 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
2024-06-21 18:00:00,121 [INFO] dynatra ... utor-0_0): query START mysmp2:0.0.6.
Additional context
- OS: Amazon Linux 2 / Amazon Linux 2023 (I haven't tried it on other OSes)
- OneAgent: 1.291
- SDK: 1.2.2
Looking at the source code, it seemed that the cause of this problem was the use of scheduler.enter.
For example, I thought that using scheduler.enterabs would prevent millisecond errors from accumulating.