Skip to content

Show trace is not correctly working when Events and Links columns not exists in database #1715

@yoyrandao

Description

@yoyrandao

What happened: In the logs panel, when I clicked on 'Show Trace' in a log view, I've encountered an error when datasource plugin is generating query for Trace search with Events and Links fields that does not exists yet in database table (and does not even properly mapped to columns in Datasource configuration). In the result - query is wrong and does not executes at all.

Possible workaround for this is:

  1. Click on 'Show full query'
  2. Expand 'Columns'
  3. Manually erase values of Events and Links columns. After that - query successfully executes.

What you expected to happen: The trace query is successfully executes even if there is no Events and Links columns exist.

How to reproduce it (as minimally and precisely as possible):

  1. Have a database with any logs and traces table with any structure that can be matched with OTEL.
  2. Configure datasource with manual mapping (do not use OTEL).
  3. Remove/do not create Events and Links columns from it.
  4. Try to 'Show trace' from some log with filled TraceID value.
  5. See the error.

Screenshots

After 'Show trace':

Image

With expanded columns and datasource configuration:

Image Image

After manually erased Events and Links field values the trace is successfully shown:

Image

Anything else we need to know?:

Possibly the root cause in this code - the column values are hardcoded here and always returns. In the code above is more correct behavior when value is checked on existance before using it further.

Environment:

  • Grafana version: 12.3.2
  • Plugin version:4.13.0
  • OS Grafana is installed on: Debian
  • User OS & Browser: Windows/Chrome

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Incoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions