Live-check reporting improvements#943
Conversation
9137d44 to
7acbfb1
Compare
7acbfb1 to
ca772f2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #943 +/- ##
=====================================
Coverage 77.8% 77.9%
=====================================
Files 76 76
Lines 5941 6016 +75
=====================================
+ Hits 4626 4689 +63
- Misses 1315 1327 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Just had a quick look... I was thinking for this that, instead of changing the structure we would enhance the statistics collection. What you're doing here is a count of each violation type (with its message and other context). We already have We can then have a jinja template on the output for just the summary. |
|
Having self-contained advices allows to use JQ to build whatever statistics you want. It also would be necessary if we end up writing advices as its own telemetry. I don't mind incorporating more stats and more detailed stats, but I don't see why having more info in the advice is controversial. |
Not controversial. I'm suggesting that, yes, add more info to the advice (provided we don't break the default ANSI template). But, maybe also for this specific case you could enhance the stats object to include all the detail needed for this summary. Then you'll need close to zero JQ hopefully. Since we're doing this aggregation already for the stats we could have an struct there instead of just a count. |
I'm less interested in a specific case, but more in the ability to generate whatever reports and aggregate in whatever way. I hope eventually we can find the golden path, but for now I don't mind a bit of not complicated jq AI can write on the first try. I tried writing JQ over current advices, me and AI both failed miserably. PS: I updated default ansi template and attached some screenshots in the description. curious what you think @jerbly |
|
Another thought. What if we leave the value and message back as it was but add a new verbose_message where you can embed the context in the message text? |
|
That looks better. If you run this, |
|
here you go |
|
I do see some duplication, but I don't see a problem with it though (I'd also be happy to go and update |
|
If you were to update those other messages I guess it would then look like this: In this view I don't see the need to repeat the attribute name in the message since the messages are in the context of the attribute. Therefore this is preferable isn't it? I'm happy with the new messages but let's remove the "Attribute |
|
It's not needed only when reported under attribute and only when looking at specially formatted report. What we have today:
It does not make sense to me to have two of them together. Could we merge them? Could |
d23f249 to
cb2208e
Compare
|
Tried in cb2208e Here's the stdout |
|
BTW my preference would still be on this is baseline (main) - all the duplication is already there, but important details are missing Human readable text is intended to have redundancy, when I'm reading CI errors, I don't want to decode error messages, I want error to tell me exactly what went wrong with as much context as possible. this is also how we format messages in semconv policies - https://github.com/open-telemetry/semantic-conventions/blob/e7eb01668175e11a9cf3b7adb57b38603505a448/policies/attribute_name_collisions.rego#L31 - give as much context as reasonable to identify the issue. |
|
OK, I see your point - I think my head has been in this for so long that it's translating the lack of information for me! So should we:
|
cb2208e to
586a318
Compare
|
Looks good. I think we just need to update the crate README: https://github.com/open-telemetry/weaver/tree/main/crates/weaver_live_check#readme And, we need a breaking change notice in the changelog. |
|
thanks @jerbly, I updated readme and added changelog. |
crates/weaver_live_check/README.md
Outdated
There was a problem hiding this comment.
This rego policy needs updating for advice_context
Co-authored-by: Jeremy Blythe <jeremyblythe@gmail.com>
jerbly
left a comment
There was a problem hiding this comment.
Looks good. Excited to give it a try! Thanks!

This change is an update of #923 and simplifies reporting with weaver.
The goal is to print short violation-only reports like (which I can now do using custom weaver.yaml and templates)
Changes:
.. | objects | select(has("live_check_result"))and it'd return all advices regardless of their nesting with full detailsattribute_name = test.meis better thantest.mewith meaning that depends on the context.Default report update:
New:

Old:
