Skip to content

feat: add LogsSample supplemental query, remove deprecated getDataProvider#1744

Open
karl-power wants to merge 2 commits intografana:mainfrom
karl-power:remove-getDataProvider-add-LogsSample
Open

feat: add LogsSample supplemental query, remove deprecated getDataProvider#1744
karl-power wants to merge 2 commits intografana:mainfrom
karl-power:remove-getDataProvider-add-LogsSample

Conversation

@karl-power
Copy link
Copy Markdown
Collaborator

@karl-power karl-power commented Mar 24, 2026

Closes #715

Summary

  • Add LogsSample support — when a user runs a Builder-mode query against the configured default logs table, Grafana's Explore view now shows sample log lines beneath the metric chart. The new getSupplementaryLogsSampleQuery() method generates a SELECT *-style Logs/List query using columns from getDefaultLogsColumns(), copies and resolves hint-based filters from the original query, orders results DESC by time, and limits to 100 rows.

  • Migrate getDataProvidergetSupplementaryRequest — replaces the deprecated getDataProvider() API (which returned an Observable) with getSupplementaryRequest() (which returns a modified DataQueryRequest). Grafana handles execution; the plugin only transforms the request. As part of this, refId stamping with log-volume- / logs-sample- prefixes now happens inside getSupplementaryRequest.

  • Extract splitLogsVolumeFrames from queryLogsVolume — the frame-splitting logic (which turns a multi-column logs-volume response into per-level [Time, Value] frames consumable by the histogram panel) is now a pure standalone function in logs.ts. It is applied in the query() response pipeline when logs-volume targets are detected.

Video

Untitled.mov

Notes

  • The logs sample table works best when default log columns are configured i.e. Otel enabled. Otherwise it doesn't know which log columns to query and falls back to whatever is queries in the timeseries (often not useful). See towards end of video where we need to add columns manually which make time series data messy.

Copy link
Copy Markdown
Collaborator

@SpencerTorres SpencerTorres left a comment

Choose a reason for hiding this comment

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

super cool, thanks for getting this working 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

Logs volume: update DataSourceWithSupplementaryQueriesSupport implementation

3 participants