Conditional Query Args #70
-
Definitely loving this plugin. Thank you very much! I am pulling data from an API that is a little difficult to use. I do not have any control of the API itself. It is with a third party vendor. For same day data, the span must follow this format: ...but if the span goes beyond 24 hours, I have to change the query to this format: Note the change in the param and value. If I try to use the start_time/end_time on a span larger than 24 hours, I get a 400/Bad Request and they tell me to switch to start_date/end_date. If I try to use the start_date/end_date all of the time, I'm missing hours of data for the last day if it is today's date. I don't see anything obvious to work around this. I'm open to suggestions. I can file a feature request but I don't know if this is something that can be done very easily and also not sure if the devs are open to the change. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thank you for the kind words! 🙏 That's indeed an odd API to work with. I'd be open to discussing enabling/disabling parameters based on for example dashboard variables, but it sounds like it still wouldn't be enough to support your use case. I don't see any obvious way to support this other than to implement the custom logic for your use case. I'm afraid that adding the support for this would add complexity to both the code and the UX. Unfortunately, unless there's a compelling reason, I don't see this making it into the plugin. I think the ideal way to support this would probably be if Grafana added support for user-defined functions in dashboard variables to do some simple logic in the variable. Not sure it would be implemented anytime soon though. Not the answer you were looking for I'm sure :/ |
Beta Was this translation helpful? Give feedback.
-
I had expected a response like this so I was ready for it. Thanks for the prompt response. |
Beta Was this translation helpful? Give feedback.
Thank you for the kind words! 🙏
That's indeed an odd API to work with.
I'd be open to discussing enabling/disabling parameters based on for example dashboard variables, but it sounds like it still wouldn't be enough to support your use case.
I don't see any obvious way to support this other than to implement the custom logic for your use case. I'm afraid that adding the support for this would add complexity to both the code and the UX. Unfortunately, unless there's a compelling reason, I don't see this making it into the plugin.
I think the ideal way to support this would probably be if Grafana added support for user-defined functions in dashboard variables to do some simple logic in the …