Policy Findings emitted as OTLP log records as they arise#1045
Policy Findings emitted as OTLP log records as they arise#1045jerbly merged 21 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1045 +/- ##
=======================================
+ Coverage 79.0% 79.3% +0.3%
=======================================
Files 85 92 +7
Lines 7034 7331 +297
=======================================
+ Hits 5558 5817 +259
- Misses 1476 1514 +38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Could the message follow a message template over using interpolated strings? So something like |
|
Very cool! |
@martinjt - not super easily, wondering what the use case is? |
|
The idea is that body should be low cardinality, that's always the way I've seen it. I kinda thought that was how all logging frameworks worked? Maybe thats just a go and .net thing though? Admittedly, events and event ID should solve that usecase. The idea being that you can group together logs that are the same, but have different attributes when querying and aggregating the data. |
|
Oh, I see, I did not know that was the case for body - I thought that was where the human readable text went. I guess I could move it to a |
|
The way it works in .net is that there is a |
|
I'm wondering if this is a specific thing that dot net does? The docs in the proto file, for example, say this: I have not used logs much myself so looking for more opinions here before going one way or the other: @open-telemetry/weaver-approvers |
I don't believe Java does this, not sure for other languages, but I don't think it's the "norm" or at least, it's not specified logging should do this. |
|
I think it depends on the framework you're doing for sure. There's a list of the frameworks supporting it at the bottom of the page. |
| use weaver_checker::{FindingLevel, PolicyFinding}; | ||
| use weaver_semconv::deprecated::Deprecated; | ||
|
|
||
| use super::{Advisor, FindingBuilder}; |
There was a problem hiding this comment.
I'm curious what's the difference between advise and finding. Could we unify them and use one term to describe both? This applies to APIs and attributes/event naming
There was a problem hiding this comment.
Until very recently we had:
Advisorswhoadviseand produceAdvice
Now we have:
Advisorswhoadviseand producePolicyFindings
I'm not sure what I would rename Advisor and the verb advise to?
There was a problem hiding this comment.
Could Advisors produce PolicyAdvices ?
There was a problem hiding this comment.
I think we should have Advisors produce Findings. The Findings can be advice violation or warning.
Previously Advice as a violation was a bit awkward. So I don't think we're any "worse" here if Advisors produce a Finding - where finding could be one of these three things.
Co-authored-by: Liudmila Molkova <neskazu@gmail.com>
|
|
||
| /// Enable OTLP log emission for live check policy findings | ||
| #[arg(long, default_value = "false")] | ||
| emit_otlp_logs: bool, |
There was a problem hiding this comment.
Nit: Should we bundle these into a struct?
Whenever a PolicyFinding is created in live-check a log_record is emitted to your configured OTLP endpoint. Here's an example from a Collector in debug mode:
...and a screenshot from a back-end:
