Skip to content

[FEATURE] LogsTable: add Grafana migration script#622

Merged
AntoineThebaud merged 3 commits intoperses:mainfrom
rickardsjp:migrate-logstable
Apr 10, 2026
Merged

[FEATURE] LogsTable: add Grafana migration script#622
AntoineThebaud merged 3 commits intoperses:mainfrom
rickardsjp:migrate-logstable

Conversation

@rickardsjp
Copy link
Copy Markdown
Contributor

Description

Add a Grafana migration script (migrate.cue) for the LogsTable plugin, enabling automatic conversion of Grafana logs panels to Perses LogsTable panels via percli migrate.

The migration maps the following Grafana panel options to LogsTable spec fields:

  • options.wrapLogMessage to allowWrap
  • options.showTime to showTime
  • options.enableLogDetails to enableDetails (defaults to true if absent)

Options without a LogsTable equivalent (showLabels, sortOrder, dedupStrategy) are not migrated.

Note

This PR covers panel migration only. Query migration for Loki targets is not included: The Prometheus query migration script currently matches any target with an expr field (including Loki targets) due to a greedy catch-all, and percli has no way to prioritize a more specific match as far as I can tell.

Screenshots

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

Signed-off-by: Jeremy Rickards <jeremy.rickards@sap.com>
Signed-off-by: Jeremy Rickards <jeremy.rickards@sap.com>
Signed-off-by: Jeremy Rickards <jeremy.rickards@sap.com>
Copy link
Copy Markdown
Contributor

@AntoineThebaud AntoineThebaud left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@AntoineThebaud
Copy link
Copy Markdown
Contributor

This PR covers panel migration only. Query migration for Loki targets is not included: The Prometheus query migration script currently matches any target with an expr field (including Loki targets) due to a greedy catch-all, and percli has no way to prioritize a more specific match as far as I can tell.

Could you please open a dedicated issue for this? But that's a tricky case, as precised in the PrometheusTimeSeriesQuery migration schema:

// /!\ Best-effort conversion logic that may wrongly convert not-prometheus queries to PrometheusTimeSeriesQuery:
// Ideally we should rely on datasource.type = "prometheus" to identify prometheus queries. But in some cases,
// this information is not be available. Thus the condition relies on the presence of the "expr" field, that
// likely indicates that this is a prometheus query.

I think the proper way to get out of this would be to check more in deep the expr field content in both plugins, to see if it describes respectively a promQL query or loki query, but that's easier said than done..

@AntoineThebaud AntoineThebaud added this pull request to the merge queue Apr 10, 2026
Merged via the queue into perses:main with commit 15a6498 Apr 10, 2026
16 checks passed
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