Skip to content

logs: no common/unique labels #611

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

Open
fionera opened this issue Nov 27, 2023 · 3 comments
Open

logs: no common/unique labels #611

fionera opened this issue Nov 27, 2023 · 3 comments

Comments

@fionera
Copy link
Contributor

fionera commented Nov 27, 2023

What happened:
While using the datasource to display a log panel I noticed that even tho there are common labels, they are not grouped.

What you expected to happen:
Labels are correctly grouped

How to reproduce it (as minimally and precisely as possible):
Create panel and select data with the same additional fields which will be displayed as labels

Environment:

  • Grafana version: v9.5.13
  • Plugin version: 3.3.0
  • OS Grafana is installed on: NixOS
  • User OS & Browser: Chrome
  • Others: -
@SpencerTorres
Copy link
Collaborator

Could you provide some additional info such as:

  • The SQL used for the query
  • A screenshot of the incorrectly grouped labels
  • (optional) A screenshot of what you expected the grouped labels to look like

Thanks!

@asimpson asimpson moved this from Incoming to Waiting in Partner Datasources Dec 1, 2023
@fionera
Copy link
Contributor Author

fionera commented Dec 4, 2023

Here the query

WITH
map(1,'TRACE',2,'TRACE2',3,'TRACE3',4,'TRACE4',5,'DEBUG',6,'DEBUG2',7,'DEBUG3',8,'DEBUG4',9,'INFO',10,'INFO2',11,'INFO3',12,'INFO4',13,'WARN',14,'WARN2',15,'WARN3',16,'WARN4',17,'ERROR',18,'ERROR2',19,'ERROR3',20,'ERROR4',21,'FATAL',22,'FATAL2',23,'FATAL3',24,'FATAL4') as SeverityMap,
map(1,'TRACE',2,'TRACE',3,'TRACE',4,'TRACE',5,'DEBUG',6,'DEBUG',7,'DEBUG',8,'DEBUG',9,'INFO',10,'INFO',11,'INFO',12,'INFO',13,'WARN',14,'WARN',15,'WARN',16,'WARN',17,'ERROR',18,'ERROR',19,'ERROR',20,'ERROR',21,'FATAL',22,'FATAL',23,'FATAL',24,'FATAL') as LevelMap

SELECT 
Timestamp as log_time, 
Body as message, 
LevelMap[SeverityNumber] AS level,
* EXCEPT Body
REPLACE (
  if(SeverityNumber == 0, 9, SeverityNumber) AS SeverityNumber,
if(SeverityText == '', SeverityMap[SeverityNumber], SeverityText) AS SeverityText
)
FROM otel_logs
WHERE $__timeFilter(log_time)
AND $__conditionalAll(mapConcat(ResourceAttributes, ScopeAttributes, LogAttributes)['host.hostname'] IN ($hostname), $hostname)
ORDER BY Timestamp
LIMIT 100

Here are two of these entries:

Screenshot_20231204_180519
Screenshot_20231204_180608

@fionera
Copy link
Contributor Author

fionera commented Dec 4, 2023

I would expect that the SeverityText would be identified as common/non-unique label

@alyssabull alyssabull moved this from Waiting to Incoming in Partner Datasources Mar 11, 2024
@alyssabull alyssabull moved this from Incoming to Backlog in Partner Datasources Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants