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:
- Click on 'Show full query'
- Expand 'Columns'
- 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):
- Have a database with any logs and traces table with any structure that can be matched with OTEL.
- Configure datasource with manual mapping (do not use OTEL).
- Remove/do not create
Events and Links columns from it.
- Try to 'Show trace' from some log with filled TraceID value.
- See the error.
Screenshots
After 'Show trace':
With expanded columns and datasource configuration:
After manually erased Events and Links field values the trace is successfully shown:
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
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
EventsandLinksfields 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:
EventsandLinkscolumns. After that - query successfully executes.What you expected to happen: The trace query is successfully executes even if there is no
EventsandLinkscolumns exist.How to reproduce it (as minimally and precisely as possible):
EventsandLinkscolumns from it.Screenshots
After 'Show trace':
With expanded columns and datasource configuration:
After manually erased
EventsandLinksfield values the trace is successfully shown: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: