- 
                Notifications
    
You must be signed in to change notification settings  - Fork 90
 
RFC: Use ResourceAttributes and ScopeAttributes for log labels as well #1214
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
Conversation
| 
           
  | 
    
| 
           specific design things I was wanting some guidance on: 
  | 
    
| 
           @SpencerTorres Would you be able to comment on any of the points raised above?  | 
    
| 
           I just came across this, as I was also going down the rabbit hole of wanting ResourceAttributes as log labels. My current work around was to disable the "use Otel" flag and run  I believe the  Looking forward to this contribution.  | 
    
| 
           Is this still being worked on, it should we look to open a new PR?  | 
    
| 
           @SpencerTorres - Do you have capacity to help with the questions here  | 
    
| 
           Hello! Thanks for submitting this. This is a known issue, but there isn't really a clear way to solve it. I'll elaborate by answering your questions: 
 Yes, Grafana looks for a  
 This is where the label merging idea gets a bit murky. Yes I would go with prefixing, but once we start aliasing these as  In the logs panel there are hooks whenever you "filter in" and "filter out" a value. All we know is the actual field name. So if your field name is  We could add prefixes for  If you have any more ideas on how to handle this, I'm glad to explore them. I'll bring this up again internally to see if we can come up with a clean solution for this. We might just have to make the   | 
    
| 
           Thanks for looking at this @SpencerTorres . Yeah, this PR does nearly what you're suggesting with ResourceAttributes.pod.name, but I introduced the convention  I wonder if an approach to make it less flaky on if merged labels appear in the query or not, might be to add an alias column to the otel logs table itself in the schema? That would be more of a guarantee that merged labels are around, and additionally could help nail down the specific prefixes you want to use.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be solved by #1369, available in plugin v4.11.0
| 
           that looks awesome Spencer, thankyou!!  | 
    
Heya, have just been trying to get something working on #1103 - currently when Exploring logs, you can see labels from LogAttributes, but not from ResourceAttributes or ScopeAttributes. This is pretty important functionality - "I have a random log line from somewhere in my k8s cluster, which pod did it come from?"
To query, I'm merging all the Attributes maps together and prefixing their keys so I can track where they came from.
I wasn't 100% sure on the best way to model this - I flipped and flopped between having a special
.labelColumnsfield added onQueryBuilderOptions, or in a special.magicMapForLabelsbool onSelectedColumn- I went with the latter.This seems to work OK!

SQL Preview
Could I ask for a pointer if this is an ok approach to take to achieve this? I can't promise I'd be able to finish it off but I can probably get pretty far at least.