-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add logs agent pipeline performance telemetry #30744
Add logs agent pipeline performance telemetry #30744
Conversation
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=49071745 --os-family=ubuntu Note: This applies to commit 7f57f8c |
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 3e3d2d2 Optimization Goals: ❌ Significant changes detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | basic_py_check | % cpu utilization | +2.09 | [-1.70, +5.89] | 1 | Logs |
➖ | quality_gate_idle | memory utilization | +0.55 | [+0.49, +0.60] | 1 | Logs bounds checks dashboard |
➖ | file_to_blackhole_1000ms_latency_linear_load | egress throughput | +0.21 | [-0.28, +0.69] | 1 | Logs |
➖ | file_to_blackhole_300ms_latency | egress throughput | +0.09 | [-0.10, +0.27] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency | egress throughput | +0.01 | [-0.45, +0.47] | 1 | Logs |
➖ | file_to_blackhole_100ms_latency | egress throughput | +0.01 | [-0.31, +0.32] | 1 | Logs |
➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.10, +0.10] | 1 | Logs |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.00 | [-0.01, +0.01] | 1 | Logs |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -0.00 | [-0.72, +0.71] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency | egress throughput | -0.03 | [-0.52, +0.45] | 1 | Logs |
➖ | file_to_blackhole_500ms_latency | egress throughput | -0.06 | [-0.30, +0.18] | 1 | Logs |
➖ | otel_to_otel_logs | ingress throughput | -0.57 | [-1.25, +0.10] | 1 | Logs |
➖ | file_tree | memory utilization | -1.32 | [-1.44, -1.19] | 1 | Logs |
➖ | quality_gate_idle_all_features | memory utilization | -3.12 | [-3.26, -2.99] | 1 | Logs bounds checks dashboard |
➖ | pycheck_lots_of_tags | % cpu utilization | -4.51 | [-7.82, -1.19] | 1 | Logs |
❌ | tcp_syslog_to_blackhole | ingress throughput | -26.45 | [-26.50, -26.40] | 1 | Logs |
Bounds Checks: ❌ Failed
perf | experiment | bounds_check_name | replicates_passed | links |
---|---|---|---|---|
❌ | file_to_blackhole_1000ms_latency | lost_bytes | 0/10 | |
❌ | file_to_blackhole_300ms_latency | lost_bytes | 0/10 | |
❌ | file_to_blackhole_500ms_latency | lost_bytes | 0/10 | |
❌ | quality_gate_idle | memory_usage | 3/10 | bounds checks dashboard |
❌ | quality_gate_idle_all_features | memory_usage | 7/10 | bounds checks dashboard |
✅ | file_to_blackhole_0ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_1000ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_1000ms_latency_linear_load | memory_usage | 10/10 | |
✅ | file_to_blackhole_100ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_100ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_300ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_500ms_latency | memory_usage | 10/10 |
Explanation
Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%
Performance changes are noted in the perf column of each table:
- ✅ = significantly better comparison variant performance
- ❌ = significantly worse comparison variant performance
- ➖ = no significant change in performance
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".
8db8b77
to
a0c07a0
Compare
This commit updates the file_to_blackhole experiments to rely on the lading logrotate FS generator, allowing us to assert on whether the log Agent loses bytes in the course of its operation. I've added a new check asserting that no bytes are lost, although I do not expect this to pass on higher latency intake experiments yet. REF #30744 REF DataDog/lading#1090 Signed-off-by: Brian L. Troutwine <[email protected]>
This commit updates the file_to_blackhole experiments to rely on the lading logrotate FS generator, allowing us to assert on whether the log Agent loses bytes in the course of its operation. I've added a new check asserting that no bytes are lost, although I do not expect this to pass on higher latency intake experiments yet. REF #30744 REF DataDog/lading#1090 Signed-off-by: Brian L. Troutwine <[email protected]>
This commit updates the file_to_blackhole experiments to rely on the lading logrotate FS generator, allowing us to assert on whether the log Agent loses bytes in the course of its operation. I've added a new check asserting that no bytes are lost, although I do not expect this to pass on higher latency intake experiments yet. REF #30744 REF DataDog/lading#1090 Signed-off-by: Brian L. Troutwine <[email protected]>
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.
Looks good for ASC
Go Package Import DifferencesBaseline: 3e3d2d2
|
TlmUtilizationRatio = telemetry.NewGauge("logs_component_utilization", "ratio", []string{"name", "instance"}, "Gauge of the utilization ratio of a component") | ||
// TlmUtilizationItems is the capacity of a component by number of elements | ||
// Both the number of items and the number of bytes are aggregated and exposed as a ewma. | ||
TlmUtilizationItems = telemetry.NewGauge("logs_component_utilization", "items", []string{"name", "instance"}, "Gauge of the number of items currently held in a component and it's bufferes") | ||
// TlmUtilizationBytes is the capacity of a component by number of bytes | ||
TlmUtilizationBytes = telemetry.NewGauge("logs_component_utilization", "bytes", []string{"name", "instance"}, "Gauge of the number of bytes currently held in a component and it's bufferes") |
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.
Same as the config global accessor, we should consider not using the telemetry global accessor.
I know is a bit painful to refactor this parts of the codebase, but the more we keep using global the harder is going to be in the future. I'm happy to help with the effort.
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.
I agree.
I think we need to prioritize refactoring more of the logs agent to use components.
Unfortunately we only got so far as to componentize the top level bits
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.
Would it make sense to add some tests for the new telemetry code?
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.
+1 on Vikentiy's comment about possibly adding unit tests on the new telemetry code if possible.
- Fix capacity sampling ewma (every second) - added unit tests
- move to it's own package - rename to be general purpose
@vickenty Thanks for the feedback. here are the commits: Ive also added unit test coverage where appropriate. |
# Conflicts: # tasks/modules.py
📥 📢 Info, this pull request increases the binary size of serverless extension by 37120 bytes. Each MB of binary size increase means about 10ms of additional cold start time, so this pull request would increase cold start time by 0ms. Debug infoIf you have questions, we are happy to help, come visit us in the #serverless slack channel and provide a link to this comment. We suggest you consider adding the |
Serverless Benchmark Results
tl;drUse these benchmarks as an insight tool during development.
What is this benchmarking?The The benchmark is run using a large variety of lambda request payloads. In the charts below, there is one row for each event payload type. How do I interpret these charts?The charts below comes from The benchstat docs explain how to interpret these charts.
I need more helpFirst off, do not worry if the benchmarks are failing. They are not tests. The intention is for them to be a tool for you to use during development. If you would like a hand interpreting the results come chat with us in Benchmark stats
|
func (i *CapacityMonitor) sample() { | ||
select { | ||
case <-i.tickChan: | ||
i.avgItems = ewma(float64(i.ingress-i.egress), i.avgItems) |
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.
We discussed this elsewhere already, but just for the record: a Histogram is probably more appropriate choice for a fast moving metric like this, since it will also capture short spikes that can be missed by periodic sampling like this, that would still nonetheless contribute to the agent's memory usage.
/merge |
Devflow running:
|
What does this PR do?
This PR introduces logs pipeline performance telemetry + makes internal buffers configurable.
Pipeline telemetry is comprised of two major pieces:
Utilization Ratio - Measurement of the ratio of how busy a unit of logic is vs it's idle time.
Utilization Items/Bytes - measurement of the number of elements and bytes present in a single component (and it's input channel).
Both of these metrics are exposed as gauges. Due to how fast log messages are processed - the raw data is very noisy. So to mitigate this some simple aggregation is performed:
ingress - egress
every second and reporting it as a Gauge.In order to measure capacity we have to record ingress and egress throughout the logs pipeline. This means adding ingress and egress markers around when channel operations happen.
This PR is broken down into individual commits that should make it easier to review.
Motivation
Increase visibility of logs agent performance to drive optimization efforts.
Describe how to test/QA your changes
Possible Drawbacks / Trade-offs
Additional Notes