Skip to content

Conversation

kcrandall
Copy link
Contributor

There was an issue where you couldnt have the logs or table visualation in dashboards because it would always return the graph format.

I've added a selector to select the type of dataframe you want to return (log/graph).

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a displayMode option to allow dashboards to switch between log/table and graph visualizations.

  • Add displayMode to the query type and default settings
  • Update data source caching and response flows to branch on displayMode
  • Extend the query editor UI with a selector for displayMode

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/types.ts Added displayMode to MyQuery and default query
src/features/log/queryResponseBuilder.ts Extracted isTimeField helper, updated graph logic
src/datasource.ts Enhanced cache key and response logic for modes
src/components/QueryEditor.tsx Added UI selector and propagate displayMode
Comments suppressed due to low confidence (2)

src/datasource.ts:62

  • Consider adding unit tests for the displayMode branching in the caching and response logic to ensure both 'logs' and 'graph' modes are handled correctly.
        displayMode: target.displayMode ?? 'auto',

src/components/QueryEditor.tsx:79

  • This call to onChange replaces the entire query object, dropping other fields like refId or query. Spread the existing query when updating: onChange({ ...query, stream: ..., organization: ..., sqlMode: ..., displayMode: ... });
                displayMode: query.displayMode ?? 'auto'

@hengfeiyang hengfeiyang merged commit 6e0701f into openobserve:main Jun 19, 2025
1 check failed
kcrandall added a commit to kcrandall/openobserve-grafana-plugin that referenced this pull request Jun 19, 2025
fix the issue with logs and table visualzation in dashboards (openobserve#19)
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.

2 participants