Support relative time calculation expressions #1979
LiuTianyou
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
|
Good idea!👍 Now we deal the |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Good idea |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, community
Backgroud
When we use SQL to query metrics, we can use expressions like
NOW() - INTERVAL 1 HOURto calculate the time one hour ago. However, when querying metrics through other protocols, such as using the HTTP protocol, it is not possible to pass relative time by defining request parameters.For example, in the OpenAI monitoring, the
/dashboard/billing/usageendpoint requires two time parameters,startDateandendDate. Due to the inability to support dynamic time calculation expressions, we have to hardcode the logic in the code to add the corresponding parameters based on the URL.Suggestion: Add global time calculation expressions.
What problem does it solve:
For example:
@nowgets the current time formatted asyyyy-MM-dd HH:mm:ss@dategets the current date formatted asyyyy-MM-dd@timegets the current time formatted asHH:mm:ss@timestampgets the current 13-digit timestamp@now-1dgets the time at the same point yesterday@now-1mgets the time one minute ago@now+2wgets the time two weeks laterHow to use:
^_^expression^_^, for example,^_^@now-1d^_^Where can expressions be used:
^_^XXX^_^placeholders are supported.Beta Was this translation helpful? Give feedback.
All reactions