Skip to content
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

fix(throttle transform)!: make events_discarded_total internal metric with key tag opt-in #19083

Merged
merged 10 commits into from
Nov 13, 2023

Conversation

dsmith3197
Copy link
Contributor

@dsmith3197 dsmith3197 commented Nov 7, 2023

The key tag has unbounded cardinality, so this tag is now opt-in.

Fixes #17778

@dsmith3197 dsmith3197 marked this pull request as ready for review November 8, 2023 15:35
@@ -8,23 +7,12 @@ pub(crate) struct ThrottleEventDiscarded {

impl InternalEvent for ThrottleEventDiscarded {
fn emit(self) {
// TODO: Technically, the Component Specification states that the discarded events metric
Copy link
Member

@pront pront Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting TODOs sparks joy.

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider making this tag opt-in since users do seem to find it useful to be able to graph dropped events per partition. key is generally a bounded, though potentially large, set.

@pront pront self-requested a review November 8, 2023 16:07
@dsmith3197
Copy link
Contributor Author

I think we should consider making this tag opt-in since users do seem to find it useful to be able to graph dropped events per partition. key is generally a bounded, though potentially large, set.

That is fair. This is very similar to the file tag. It may be worthwhile to come up with a comprehensive solution here. Particularly, I think it would be worthwhile to include cardinality controls for tags with potentially unbounded cardinality. We would set an upper bound on cardinality for the given tag and only include the tag if we're below the limit. Note that the cardinality limit transform is not sufficient here because users have reported performance issues in the internal metrics source itself.

@jszwedko
Copy link
Member

jszwedko commented Nov 8, 2023

We would set an upper bound on cardinality for the given tag and only include the tag if we're below the limit. Note that the cardinality limit transform is not sufficient here because users have reported performance issues in the internal metrics source itself.

Yeah, I agree. It would be useful to come up with a generalized solution here that could be applied across components that could include things like a cardinality limit. In absence of that, I'd suggest just making this one opt-in or opt-out.

@dsmith3197 dsmith3197 requested review from a team as code owners November 10, 2023 19:13
@dsmith3197 dsmith3197 requested a review from a team November 10, 2023 19:13
@github-actions github-actions bot added domain: transforms Anything related to Vector's transform components domain: external docs Anything related to Vector's external, public documentation labels Nov 10, 2023
@dsmith3197 dsmith3197 requested a review from jszwedko November 10, 2023 19:23
@dsmith3197 dsmith3197 changed the title fix(throttle transform): replace metric with unbounded cardinality with a debug log fix(throttle transform)!: replace metric with unbounded cardinality with a debug log Nov 10, 2023

debug!(message, key = self.key, internal_log_rate_limit = true);
if self.emit_events_discarded_per_key {
counter!("events_discarded_total", 1, "key" => self.key);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of the scope of this PR, but we may want to think about renaming this to component_events_discarded_total in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm going back and forth on that. That would require extending the current component specification for the component_events_discarded_total metric and could also significantly increase the cardinality of that metric. If there are cardinality issues, I would prefer that the impact be isolated to a one-off, single-use metric rather than impacting a metric used by all components. However, that does result in an inferior UX on the other hand in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add back the TODO.

dsmith3197 and others added 2 commits November 10, 2023 14:35
@dsmith3197 dsmith3197 enabled auto-merge November 10, 2023 19:44
@dsmith3197 dsmith3197 changed the title fix(throttle transform)!: replace metric with unbounded cardinality with a debug log fix(throttle transform)!: make events_discarded_total internal metric with key tag opt-in Nov 10, 2023
@dsmith3197 dsmith3197 added this pull request to the merge queue Nov 13, 2023
Copy link

Regression Detector Results

Run ID: 53f15605-a4b1-41fd-81f2-052dca114025
Baseline: c68b2b8
Comparison: 678605c
Total vector CPUs: 7

Explanation

A regression test is an integrated performance test for vector in a repeatable rig, with varying configuration for vector. What follows is a statistical summary of a brief vector run for each configuration across SHAs given above. The goal of these tests are to determine quickly if vector performance is changed and to what degree by a pull request.

Because a target's optimization goal performance in each experiment will vary somewhat each time it is run, we can only estimate mean differences in optimization goal relative to the baseline target. We express these differences as a percentage change relative to the baseline target, denoted "Δ mean %". These estimates are made to a precision that balances accuracy and cost control. We represent this precision as a 90.00% confidence interval denoted "Δ mean % CI": there is a 90.00% chance that the true value of "Δ mean %" is in that interval.

We decide whether a change in performance is a "regression" -- a change worth investigating further -- if both of the following two criteria are true:

  1. The estimated |Δ mean %| ≥ 5.00%. This criterion intends to answer the question "Does the estimated change in mean optimization goal performance have a meaningful impact on your customers?". We assume that when |Δ mean %| < 5.00%, the impact on your customers is not meaningful. We also assume that a performance change in optimization goal is worth investigating whether it is an increase or decrease, so long as the magnitude of the change is sufficiently large.

  2. Zero is not in the 90.00% confidence interval "Δ mean % CI" about "Δ mean %". This statement is equivalent to saying that there is at least a 90.00% chance that the mean difference in optimization goal is not zero. This criterion intends to answer the question, "Is there a statistically significant difference in mean optimization goal performance?". It also means there is no more than a 10.00% chance this criterion reports a statistically significant difference when the true difference in mean optimization goal is zero -- a "false positive". We assume you are willing to accept a 10.00% chance of inaccurately detecting a change in performance when no true difference exists.

The table below, if present, lists those experiments that have experienced a statistically significant change in mean optimization goal performance between baseline and comparison SHAs with 90.00% confidence OR have been detected as newly erratic. Negative values of "Δ mean %" mean that baseline is faster, whereas positive values of "Δ mean %" mean that comparison is faster. Results that do not exhibit more than a ±5.00% change in their mean optimization goal are discarded. An experiment is erratic if its coefficient of variation is greater than 0.1. The abbreviated table will be omitted if no interesting change is observed.

No interesting changes in experiment optimization goals with confidence ≥ 90.00% and |Δ mean %| ≥ 5.00%.

Fine details of change detection per experiment.
experiment goal Δ mean % Δ mean % CI confidence
syslog_log2metric_humio_metrics ingress throughput +1.17 [+1.06, +1.28] 100.00%
syslog_regex_logs2metric_ddmetrics ingress throughput +1.05 [+0.95, +1.15] 100.00%
datadog_agent_remap_blackhole ingress throughput +1.03 [+0.95, +1.11] 100.00%
datadog_agent_remap_blackhole_acks ingress throughput +0.49 [+0.40, +0.58] 100.00%
fluent_elasticsearch ingress throughput +0.36 [-0.09, +0.81] 80.68%
datadog_agent_remap_datadog_logs_acks ingress throughput +0.31 [+0.24, +0.39] 100.00%
http_elasticsearch ingress throughput +0.28 [+0.22, +0.34] 100.00%
datadog_agent_remap_datadog_logs ingress throughput +0.22 [+0.12, +0.31] 99.99%
http_to_http_noack ingress throughput +0.16 [+0.06, +0.25] 99.46%
http_to_s3 ingress throughput +0.07 [-0.20, +0.34] 31.50%
http_to_http_acks ingress throughput +0.03 [-1.27, +1.33] 3.24%
http_to_http_json ingress throughput +0.01 [-0.06, +0.08] 19.15%
splunk_hec_to_splunk_hec_logs_acks ingress throughput +0.00 [-0.14, +0.15] 0.69%
splunk_hec_indexer_ack_blackhole ingress throughput -0.00 [-0.14, +0.14] 3.02%
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.02 [-0.13, +0.10] 18.03%
http_text_to_http_json ingress throughput -0.03 [-0.16, +0.11] 24.56%
splunk_hec_route_s3 ingress throughput -0.05 [-0.55, +0.45] 12.82%
enterprise_http_to_http ingress throughput -0.05 [-0.11, +0.01] 82.29%
otlp_grpc_to_blackhole ingress throughput -0.15 [-0.24, -0.05] 98.40%
syslog_humio_logs ingress throughput -0.32 [-0.40, -0.25] 100.00%
syslog_loki ingress throughput -0.44 [-0.49, -0.40] 100.00%
syslog_splunk_hec_logs ingress throughput -0.59 [-0.63, -0.56] 100.00%
file_to_blackhole egress throughput -0.90 [-3.36, +1.56] 45.21%
syslog_log2metric_splunk_hec_metrics ingress throughput -1.76 [-1.88, -1.63] 100.00%
socket_to_socket_blackhole ingress throughput -1.94 [-2.00, -1.88] 100.00%
otlp_http_to_blackhole ingress throughput -2.03 [-2.18, -1.87] 100.00%

Merged via the queue into master with commit 678605c Nov 13, 2023
40 checks passed
@dsmith3197 dsmith3197 deleted the dougsmith/throttle-transform-key branch November 13, 2023 18:34
neuronull pushed a commit that referenced this pull request Nov 13, 2023
…ic with `key` tag opt-in (#19083)

* fix(throttle transform): replace metric with unbounded cardinality with a debug log

* make the counter opt-in

* clean up

* spelling

* remove double the

* OPW-94

* Update website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>

* add back todo

* make internal_metrics optional

---------

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>
pront pushed a commit to dygfloyd/vector that referenced this pull request Nov 15, 2023
…ic with `key` tag opt-in (vectordotdev#19083)

* fix(throttle transform): replace metric with unbounded cardinality with a debug log

* make the counter opt-in

* clean up

* spelling

* remove double the

* OPW-94

* Update website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>

* add back todo

* make internal_metrics optional

---------

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>
neuronull pushed a commit that referenced this pull request Nov 16, 2023
…ic with `key` tag opt-in (#19083)

* fix(throttle transform): replace metric with unbounded cardinality with a debug log

* make the counter opt-in

* clean up

* spelling

* remove double the

* OPW-94

* Update website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>

* add back todo

* make internal_metrics optional

---------

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>
jszwedko pushed a commit that referenced this pull request Nov 16, 2023
…ic with `key` tag opt-in (#19083)

* fix(throttle transform): replace metric with unbounded cardinality with a debug log

* make the counter opt-in

* clean up

* spelling

* remove double the

* OPW-94

* Update website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>

* add back todo

* make internal_metrics optional

---------

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>
dsmith3197 added a commit that referenced this pull request Jan 8, 2024
…ic with `key` tag opt-in (#19083)

* fix(throttle transform): replace metric with unbounded cardinality with a debug log

* make the counter opt-in

* clean up

* spelling

* remove double the

* OPW-94

* Update website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>

* add back todo

* make internal_metrics optional

---------

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>
AndrooTheChen pushed a commit to discord/vector that referenced this pull request Sep 23, 2024
…ic with `key` tag opt-in (vectordotdev#19083)

* fix(throttle transform): replace metric with unbounded cardinality with a debug log

* make the counter opt-in

* clean up

* spelling

* remove double the

* OPW-94

* Update website/content/en/highlights/2023-12-19-0-35-0-upgrade-guide.md

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>

* add back todo

* make internal_metrics optional

---------

Co-authored-by: Esther Kim <esthercodes2019@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation domain: transforms Anything related to Vector's transform components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throttle config option to disable "key" label in events_discarded_total metric
4 participants