Skip to content

Commit 96a5fd3

Browse files
committed
Add ARC support
1 parent a6a1766 commit 96a5fd3

22 files changed

+1712
-28
lines changed

.chloggen/arc-feature.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
change_type: enhancement
2+
component: pkg/exporterhelper
3+
note: >
4+
Add Adaptive Request Concurrency (ARC) to exporterhelper: a controller that
5+
dynamically adjusts exporter concurrency based on observed RTT and
6+
backpressure signals. Integrates with the queue/batch send path and exposes
7+
new telemetry. Disabled by default; no behavior change unless enabled.
8+
issues: [14080]
9+
subtext: |
10+
Configuration (exporterhelper / queue-batch settings):
11+
- enabled: turn ARC on/off (default: false)
12+
- initial_concurrency: starting permits (default: 1)
13+
- max_concurrency: upper bound (default: 200)
14+
- decrease_ratio: multiplicative decrease factor on pressure (default: 0.9)
15+
- ewma_alpha: smoothing for RTT EWMA (default: 0.4)
16+
- rtt_deviation_scale: N·σ spike threshold for decrease (default: 2.5)
17+
18+
Telemetry (new metrics):
19+
- otelcol_exporter_arc_acquire_wait_ms (histogram; attrs: exporter, data_type)
20+
- otelcol_exporter_arc_rtt_ms (histogram; attrs: exporter, data_type)
21+
- otelcol_exporter_arc_failures (sum, monotonic; attrs: exporter, data_type)
22+
- otelcol_exporter_arc_backoff_events (sum, monotonic; attrs: exporter, data_type)
23+
- otelcol_exporter_arc_limit_changes (sum, monotonic; attrs: exporter, data_type, direction=up|down)
24+
- otelcol_exporter_arc_limit (async gauge; attrs: exporter, data_type)
25+
- otelcol_exporter_arc_permits_in_use (async gauge; attrs: exporter, data_type)
26+
27+
Notes:
28+
- ARC increases concurrency additively and decreases multiplicatively on
29+
backpressure or RTT spikes (mean + rtt_deviation_scale·σ).
30+
- Direction attribute values: "up", "down".
31+
change_logs: [user]
32+

exporter/exporterhelper/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following configuration options can be modified:
2929
- `bytes`: the size of serialized data in bytes (the least performant option).
3030
- `queue_size` (default = 1000): Maximum size the queue can accept. Measured in units defined by `sizer`
3131
- `batch`: see below.
32+
- `arc`: see below.
3233

3334
#### Sending queue batch settings
3435

@@ -50,6 +51,19 @@ Available `batch::sizer` options:
5051

5152
- `items`: number of the smallest parts of each signal (spans, metric data points, log records);
5253
- `bytes`: the size of serialized data in bytes (the least performant option).
54+
55+
#### Sending queue Adaptive Concurrency Limiter (ARC) Settings
56+
57+
The Adaptive Concurrency Limiter (ARC) dynamically adjusts the number of concurrent requests (`num_consumers`) based on observed RTTs and backpressure signals. It aims to maximize throughput while minimizing errors and latency. It is disabled by default.
58+
59+
- `arc`
60+
- `enabled` (default = false): Set to `true` to enable ARC.
61+
- `initial_limit` (default = 1): The starting concurrency limit.
62+
- `max_concurrency` (default = 200): The maximum number of concurrent requests ARC will allow.
63+
- `decrease_ratio` (default = 0.9): The multiplicative factor to apply when decreasing the limit (e.g., 0.9 = 10% decrease).
64+
- `ewma_alpha` (default = 0.4): The smoothing factor for the EWMA (Exponentially Weighted Moving Average) of RTTs.
65+
- `deviation_scale` (default = 2.5): The number of standard deviations from the mean RTT to tolerate before triggering a backoff.
66+
5367
### Timeout
5468

5569
- `timeout` (default = 5s): Time to wait per individual attempt to send data to a backend

exporter/exporterhelper/documentation.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,68 @@
66

77
The following telemetry is emitted by this component.
88

9+
### otelcol_exporter_arc_acquire_wait_ms
10+
11+
Time a worker waited to acquire an ARC permit. [Alpha]
12+
13+
| Unit | Metric Type | Value Type | Stability |
14+
| ---- | ----------- | ---------- | --------- |
15+
| ms | Histogram | Int | Alpha |
16+
17+
### otelcol_exporter_arc_backoff_events
18+
19+
Number of ARC backoff (shrink) events triggered by error or RTT signal. [Alpha]
20+
21+
| Unit | Metric Type | Value Type | Monotonic | Stability |
22+
| ---- | ----------- | ---------- | --------- | --------- |
23+
| {events} | Sum | Int | true | Alpha |
24+
25+
### otelcol_exporter_arc_failures
26+
27+
Number of requests considered failures by ARC (feeds adaptive shrink). [Alpha]
28+
29+
| Unit | Metric Type | Value Type | Monotonic | Stability |
30+
| ---- | ----------- | ---------- | --------- | --------- |
31+
| {requests} | Sum | Int | true | Alpha |
32+
33+
### otelcol_exporter_arc_limit
34+
35+
Current ARC dynamic concurrency limit. [Alpha]
36+
37+
| Unit | Metric Type | Value Type | Stability |
38+
| ---- | ----------- | ---------- | --------- |
39+
| {permits} | Gauge | Int | Alpha |
40+
41+
### otelcol_exporter_arc_limit_changes
42+
43+
Number of times ARC changed its concurrency limit. [Alpha]
44+
45+
| Unit | Metric Type | Value Type | Monotonic | Stability |
46+
| ---- | ----------- | ---------- | --------- | --------- |
47+
| {events} | Sum | Int | true | Alpha |
48+
49+
#### Attributes
50+
51+
| Name | Description | Values |
52+
| ---- | ----------- | ------ |
53+
| direction | up or down | Str: ``up``, ``down`` |
54+
55+
### otelcol_exporter_arc_permits_in_use
56+
57+
Number of permits currently acquired. [Alpha]
58+
59+
| Unit | Metric Type | Value Type | Stability |
60+
| ---- | ----------- | ---------- | --------- |
61+
| {permits} | Gauge | Int | Alpha |
62+
63+
### otelcol_exporter_arc_rtt_ms
64+
65+
Request round-trip-time measured by ARC (from permit acquire to release). [Alpha]
66+
67+
| Unit | Metric Type | Value Type | Stability |
68+
| ---- | ----------- | ---------- | --------- |
69+
| ms | Histogram | Int | Alpha |
70+
971
### otelcol_exporter_enqueue_failed_log_records
1072

1173
Number of log records failed to be added to the sending queue. [Alpha]

exporter/exporterhelper/generated_package_test.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/exporterhelper/go.mod

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ require (
1616
go.opentelemetry.io/collector/consumer/consumererror v0.139.0
1717
go.opentelemetry.io/collector/consumer/consumertest v0.139.0
1818
go.opentelemetry.io/collector/exporter v1.45.0
19-
go.opentelemetry.io/collector/exporter/exportertest v0.139.0
20-
go.opentelemetry.io/collector/extension/extensiontest v0.139.0
19+
go.opentelemetry.io/collector/exporter/exportertest v0.138.0
20+
go.opentelemetry.io/collector/extension/extensiontest v0.138.0
2121
go.opentelemetry.io/collector/extension/xextension v0.139.0
2222
go.opentelemetry.io/collector/featuregate v1.45.0
2323
go.opentelemetry.io/collector/pdata v1.45.0
@@ -33,6 +33,7 @@ require (
3333
go.uber.org/goleak v1.3.0
3434
go.uber.org/multierr v1.11.0
3535
go.uber.org/zap v1.27.0
36+
google.golang.org/grpc v1.76.0
3637
google.golang.org/protobuf v1.36.10
3738
)
3839

@@ -61,9 +62,9 @@ require (
6162
go.opentelemetry.io/collector/receiver/receivertest v0.139.0 // indirect
6263
go.opentelemetry.io/collector/receiver/xreceiver v0.139.0 // indirect
6364
go.yaml.in/yaml/v3 v3.0.4 // indirect
64-
golang.org/x/sys v0.35.0 // indirect
65-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
66-
google.golang.org/grpc v1.76.0 // indirect
65+
golang.org/x/sys v0.36.0 // indirect
66+
golang.org/x/text v0.29.0 // indirect
67+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
6768
gopkg.in/yaml.v3 v3.0.1 // indirect
6869
)
6970

exporter/exporterhelper/go.sum

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)