Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs format #39

Closed
wants to merge 3 commits into from
Closed

Logs format #39

wants to merge 3 commits into from

Conversation

yesoreyeram
Copy link
Contributor

@yesoreyeram yesoreyeram commented Sep 8, 2021

Support for logs format

Really a coincidence to @andresmgot 's PR #38 . In addition to #38, this PR also checks if the frame has at least one Time field and one string field as in other cases, it wont render properly in Explorer

Copy link
Collaborator

@sunker sunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I wonder though, if you've selected result format Logs in the query editor, wouldn't you expect the Logs visualization to be shown in all scenarios? Even if that includes showing an empty logs visualization because no time and string field were found.

@andresmgot
Copy link
Collaborator

Nice! I wonder though, if you've selected result format Logs in the query editor, wouldn't you expect the Logs visualization to be shown in all scenarios? Even if that includes showing an empty logs visualization because no time and string field were found.

I agree with this, is the new code really necessary? AFAICT the behavior is the same in the panel without the check (you simply get an empty response). One thing that confused me when checking this was that if the columns are not right, it fails silently. Maybe we can return an error here if the frame is not right for logs? (or maybe that's work of the visualization panel).

If you use the explore view, it's helpful to set the preferred visualization even if the required columns are missing because you get the logs view with the proper error (better than showing the table with just some column):

Screenshot from 2021-09-09 09-24-44

@yesoreyeram
Copy link
Contributor Author

Based on the convo above, I agree that this fallback for logs can be better handled in explore view/logs visualization itself. Thank you for the feedback.

@yesoreyeram yesoreyeram closed this Sep 9, 2021
@yesoreyeram
Copy link
Contributor Author

If the data is not in logs format, then either we need to fall back to table view and/or show notice to the user about it aleast.

@kminehart
Copy link
Collaborator

I think an error makes sense, though to me that almost sounds like a Grafana feature rather than a sqlds one. If a panel receives data that doesn't match what's expected, the panel ought to return the error.

@sasklacz sasklacz deleted the logs-format branch January 9, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants