Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Logs panel UX #597

Closed
Slach opened this issue Jul 16, 2024 · 1 comment · Fixed by #643
Closed

Improve Logs panel UX #597

Slach opened this issue Jul 16, 2024 · 1 comment · Fixed by #643
Assignees
Milestone

Comments

@Slach
Copy link
Collaborator

Slach commented Jul 16, 2024

Open http://localhost:3000/d/VtsMXQl7z/test-logs-support
show log context doesn't work (work wrong in Grafana Labs plugin)
image
image

use Explore
filters in logs panel doesn't work

image

image

@Slach Slach added this to the 3.3.0 milestone Jul 16, 2024
@Slach
Copy link
Collaborator Author

Slach commented Oct 10, 2024

for context in logs
when trace_id is passed then just show

SELECT ... FROM $table WHERE $timeFilter AND trace_id=...

when only timestamp field passed
then
make two queries

  1. detect timestamp boundaries for selected timestamp
SELECT min_timestamp, max_timestamp FROM (
  SELECT 
    timestamp, 
    FIRST_VALUE(timestamp) OVER (ORDER BY timestamp ROWS BETWEEN 10 PRECEDING AND CURRENT ROW) AS min_timestamp,
    LAST_VALUE(timestamp) OVER (ORDER BY timestamp ROWS BETWEEN CURRENT ROW AND 10 FOLLOWING) AS max_timestamp
  FROM $table 
  WHERE $timeFilter ORDER BY timestamp
) WHERE timestamp=XXXX
  1. get whole data
SELECT ... FROM $table WHERE $timeFilter AND $timeStampField BETWEEN $min_timestamp AND $max_timestamp

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 a pull request may close this issue.

2 participants