-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(new encoding): add pretty json encoding #20384
base: master
Are you sure you want to change the base?
Conversation
9c8b66c
to
4f875cd
Compare
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.
Thanks @lsampras ! This generally looks good to me as an addition granted it has somewhat limited utility outside of manual inspection. I think you'll just need to update the output assertions in the tests you copied.
Also, I'm curious if you considered making this an optional parameter to the existing json
codec rather than a separate codec. I think I could go either way on it so just curious if you considered it and what your thoughts were if so.
Hadn't considered adding a parameter to existing json codec, tbh I wasn't aware about the possibilty of adding more fields inside a codec... |
@jszwedko Can you take a look at this again? |
You can see an example with the AVRO codec: https://vector.dev/docs/reference/configuration/sinks/amqp/#encoding.avro
I'm having trouble coming up with super strong arguments either way but I think I have a slight preference to have it just be an option on the existing |
+1 on adding a new option (vs introducing a new encoder). Happy to help with implementation details if you get stuck. As Jesse mentioned, this https://github.com/vectordotdev/vector/blob/v0.37.1/lib/codecs/src/encoding/format/avro.rs#L42-L52 is a very good example. |
… a new pretty_json codec
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.
Looking good! I just have one comment about the option name, but otherwise this looks good to me.
config/vector.yaml
Outdated
codec: "pretty_json" | ||
codec: "json" | ||
json: | ||
use_pretty_json: true |
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.
use_pretty_json: true | |
pretty: true |
I think we can shorten this up a bit.
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.
Great, thank you @lsampras !
Regression Detector ResultsRun ID: 1c54ce85-a4c3-4ae1-819d-1a6978db68bc Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | socket_to_socket_blackhole | ingress throughput | +2.31 | [+2.22, +2.41] |
➖ | splunk_hec_route_s3 | ingress throughput | +2.09 | [+1.63, +2.56] |
➖ | otlp_http_to_blackhole | ingress throughput | +1.94 | [+1.81, +2.06] |
➖ | otlp_grpc_to_blackhole | ingress throughput | +1.06 | [+0.97, +1.15] |
➖ | http_elasticsearch | ingress throughput | +0.98 | [+0.89, +1.08] |
➖ | datadog_agent_remap_blackhole_acks | ingress throughput | +0.26 | [+0.17, +0.36] |
➖ | http_to_http_noack | ingress throughput | +0.18 | [+0.09, +0.28] |
➖ | syslog_regex_logs2metric_ddmetrics | ingress throughput | +0.12 | [+0.01, +0.23] |
➖ | datadog_agent_remap_datadog_logs_acks | ingress throughput | +0.11 | [+0.02, +0.19] |
➖ | datadog_agent_remap_datadog_logs | ingress throughput | +0.08 | [-0.02, +0.19] |
➖ | syslog_log2metric_humio_metrics | ingress throughput | +0.05 | [-0.12, +0.22] |
➖ | http_to_http_json | ingress throughput | +0.02 | [-0.05, +0.10] |
➖ | splunk_hec_indexer_ack_blackhole | ingress throughput | -0.00 | [-0.15, +0.14] |
➖ | splunk_hec_to_splunk_hec_logs_acks | ingress throughput | -0.00 | [-0.14, +0.13] |
➖ | syslog_splunk_hec_logs | ingress throughput | -0.01 | [-0.10, +0.08] |
➖ | splunk_hec_to_splunk_hec_logs_noack | ingress throughput | -0.02 | [-0.13, +0.09] |
➖ | enterprise_http_to_http | ingress throughput | -0.08 | [-0.13, -0.02] |
➖ | syslog_humio_logs | ingress throughput | -0.09 | [-0.23, +0.04] |
➖ | http_to_http_acks | ingress throughput | -0.21 | [-1.57, +1.15] |
➖ | datadog_agent_remap_blackhole | ingress throughput | -0.25 | [-0.35, -0.16] |
➖ | syslog_log2metric_splunk_hec_metrics | ingress throughput | -0.29 | [-0.45, -0.14] |
➖ | http_to_s3 | ingress throughput | -0.32 | [-0.60, -0.04] |
➖ | syslog_loki | ingress throughput | -0.34 | [-0.42, -0.27] |
➖ | fluent_elasticsearch | ingress throughput | -0.42 | [-0.90, +0.07] |
➖ | http_text_to_http_json | ingress throughput | -0.44 | [-0.58, -0.30] |
➖ | syslog_log2metric_tag_cardinality_limit_blackhole | ingress throughput | -0.60 | [-0.70, -0.49] |
➖ | file_to_blackhole | egress throughput | -1.16 | [-3.76, +1.44] |
Explanation
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
@jszwedko Can you help here? I'm unable to understand the failure
|
Ah, apologies, this was an issue in CI that was caused due to the Zookeeper and Kafka images disappearing. We resolved that in 3a115c5. I'll requeue this. |
Regression Detector ResultsRun ID: 9067f149-5284-4958-b8da-158176d237e4 Performance changes are noted in the perf column of each table:
Significant changes in experiment optimization goalsConfidence level: 90.00%
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
✅ | syslog_humio_logs | ingress throughput | +5.29 | [+5.14, +5.45] |
➖ | syslog_splunk_hec_logs | ingress throughput | +2.67 | [+2.55, +2.78] |
➖ | syslog_log2metric_tag_cardinality_limit_blackhole | ingress throughput | +2.48 | [+2.35, +2.61] |
➖ | syslog_loki | ingress throughput | +2.43 | [+2.33, +2.53] |
➖ | syslog_regex_logs2metric_ddmetrics | ingress throughput | +2.34 | [+2.20, +2.48] |
➖ | syslog_log2metric_splunk_hec_metrics | ingress throughput | +1.93 | [+1.75, +2.10] |
➖ | http_text_to_http_json | ingress throughput | +1.75 | [+1.62, +1.87] |
➖ | syslog_log2metric_humio_metrics | ingress throughput | +1.64 | [+1.45, +1.84] |
➖ | splunk_hec_route_s3 | ingress throughput | +1.51 | [+1.02, +2.01] |
➖ | otlp_grpc_to_blackhole | ingress throughput | +1.30 | [+1.21, +1.40] |
➖ | http_to_http_acks | ingress throughput | +0.40 | [-0.95, +1.76] |
➖ | otlp_http_to_blackhole | ingress throughput | +0.33 | [+0.21, +0.46] |
➖ | http_to_http_noack | ingress throughput | +0.22 | [+0.13, +0.31] |
➖ | http_elasticsearch | ingress throughput | +0.04 | [-0.04, +0.13] |
➖ | http_to_http_json | ingress throughput | +0.02 | [-0.05, +0.09] |
➖ | splunk_hec_indexer_ack_blackhole | ingress throughput | -0.00 | [-0.15, +0.14] |
➖ | splunk_hec_to_splunk_hec_logs_acks | ingress throughput | -0.00 | [-0.14, +0.14] |
➖ | splunk_hec_to_splunk_hec_logs_noack | ingress throughput | -0.02 | [-0.13, +0.09] |
➖ | enterprise_http_to_http | ingress throughput | -0.10 | [-0.19, -0.01] |
➖ | socket_to_socket_blackhole | ingress throughput | -0.24 | [-0.33, -0.15] |
➖ | datadog_agent_remap_datadog_logs_acks | ingress throughput | -0.29 | [-0.39, -0.19] |
➖ | datadog_agent_remap_datadog_logs | ingress throughput | -0.37 | [-0.48, -0.25] |
➖ | http_to_s3 | ingress throughput | -0.38 | [-0.66, -0.10] |
➖ | datadog_agent_remap_blackhole_acks | ingress throughput | -0.83 | [-0.95, -0.71] |
➖ | file_to_blackhole | egress throughput | -0.92 | [-3.41, +1.57] |
➖ | datadog_agent_remap_blackhole | ingress throughput | -1.18 | [-1.27, -1.10] |
➖ | fluent_elasticsearch | ingress throughput | -2.60 | [-3.08, -2.12] |
Explanation
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
Regression Detector ResultsRun ID: 8422c6c0-6d0a-4d60-9f99-9b1aef05aacd Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI |
---|---|---|---|---|
➖ | syslog_log2metric_tag_cardinality_limit_blackhole | ingress throughput | +3.50 | [+3.38, +3.62] |
➖ | datadog_agent_remap_blackhole | ingress throughput | +3.01 | [+2.87, +3.15] |
➖ | syslog_loki | ingress throughput | +2.68 | [+2.59, +2.77] |
➖ | syslog_humio_logs | ingress throughput | +2.51 | [+2.35, +2.67] |
➖ | syslog_log2metric_humio_metrics | ingress throughput | +2.18 | [+2.07, +2.29] |
➖ | otlp_http_to_blackhole | ingress throughput | +2.17 | [+2.02, +2.32] |
➖ | syslog_log2metric_splunk_hec_metrics | ingress throughput | +1.80 | [+1.61, +1.99] |
➖ | file_to_blackhole | egress throughput | +1.20 | [-1.28, +3.69] |
➖ | syslog_splunk_hec_logs | ingress throughput | +1.19 | [+1.08, +1.30] |
➖ | http_to_http_acks | ingress throughput | +1.05 | [-0.32, +2.42] |
➖ | otlp_grpc_to_blackhole | ingress throughput | +0.54 | [+0.45, +0.63] |
➖ | datadog_agent_remap_datadog_logs | ingress throughput | +0.39 | [+0.26, +0.52] |
➖ | datadog_agent_remap_datadog_logs_acks | ingress throughput | +0.16 | [+0.06, +0.26] |
➖ | http_to_http_noack | ingress throughput | +0.16 | [+0.07, +0.24] |
➖ | datadog_agent_remap_blackhole_acks | ingress throughput | +0.12 | [-0.01, +0.25] |
➖ | http_to_http_json | ingress throughput | +0.03 | [-0.05, +0.10] |
➖ | splunk_hec_to_splunk_hec_logs_acks | ingress throughput | -0.00 | [-0.14, +0.13] |
➖ | splunk_hec_indexer_ack_blackhole | ingress throughput | -0.01 | [-0.15, +0.14] |
➖ | splunk_hec_to_splunk_hec_logs_noack | ingress throughput | -0.04 | [-0.15, +0.08] |
➖ | enterprise_http_to_http | ingress throughput | -0.14 | [-0.22, -0.07] |
➖ | socket_to_socket_blackhole | ingress throughput | -0.25 | [-0.29, -0.22] |
➖ | http_to_s3 | ingress throughput | -0.58 | [-0.87, -0.30] |
➖ | http_elasticsearch | ingress throughput | -0.65 | [-0.74, -0.56] |
➖ | syslog_regex_logs2metric_ddmetrics | ingress throughput | -0.71 | [-0.85, -0.58] |
➖ | splunk_hec_route_s3 | ingress throughput | -0.81 | [-1.27, -0.34] |
➖ | fluent_elasticsearch | ingress throughput | -0.81 | [-1.29, -0.33] |
➖ | http_text_to_http_json | ingress throughput | -1.02 | [-1.20, -0.84] |
Explanation
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
Adds a
use_pretty_json
field tojson
encoding codecthis relies on the
serde_json::to_writer_pretty
implementation while using the same deserialization as plain jsonFixes : #20380
example