-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Describe the bug
Dynatrace API does not return milliseconds if they are 000, e.g., 2025-01-18T21:35:03.000Z gets returned as 2025-01-18T21:35:03Z
That leads to the following error in the client API:
ValueError("time data '2025-01-18T21:35:03Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'")
This might be an issue in the API itself, but for now we can mitigate it by accepting both ISO pattern (with and without ms).
We currently fix this behavior by monkey patching the iso parsing function app-sre/qontract-reconcile#4815
Proposing a fix here: #110
To Reproduce
This is hard to reproduce and we stumbled across it by chance.
Essentially you have a 1:1000 chance that you will create an API token at exactly 000ms.
Steps to reproduce the behavior:
- Create a token at exactly 000ms
- try to use
tokens.list() - see error
Expected behavior
Properly parse whatever is returned by the API
Screenshots
None
Desktop (please complete the following information):
Not relevant - this is a general bug in how the client parses the response
Smartphone (please complete the following information):
Not relevant - this is a general bug in how the client parses the response
Additional context
None