Skip to content

Commit d58b47e

Browse files
authored
Catchup with otel version since stackdriver released 0.17.0 (#2613)
* Catchup with otel version since stackdriver released 0.17.0 Signed-off-by: Bogdan Drutu <[email protected]> * Update README Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 16d8ca9 commit d58b47e

File tree

12 files changed

+92
-192
lines changed

12 files changed

+92
-192
lines changed

exporter/stackdriverexporter/README.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@ The following configuration options are supported:
1212
- `number_of_workers` (optional): NumberOfWorkers sets the number of go rountines that send requests. The minimum number of workers is 1.
1313
- `resource_mappings` (optional): ResourceMapping defines mapping of resources from source (OpenCensus) to target (Stackdriver).
1414
- `label_mappings` (optional): Optional flag signals whether we can proceed with transformation if a label is missing in the resource.
15+
- `retry_on_failure` (optional): Configuration for how to handle retries when sending data to Google Cloud fails.
16+
- `enabled` (default = true)
17+
- `initial_interval` (default = 5s): Time to wait after the first failure before retrying; ignored if `enabled` is `false`
18+
- `max_interval` (default = 30s): Is the upper bound on backoff; ignored if `enabled` is `false`
19+
- `max_elapsed_time` (default = 120s): Is the maximum amount of time spent trying to send a batch; ignored if `enabled` is `false`
20+
- `sending_queue` (optional): Configuration for how to buffer traces before sending.
21+
- `enabled` (default = true)
22+
- `num_consumers` (default = 10): Number of consumers that dequeue batches; ignored if `enabled` is `false`
23+
- `queue_size` (default = 5000): Maximum number of batches kept in memory before data; ignored if `enabled` is `false`;
24+
User should calculate this as `num_seconds * requests_per_second` where:
25+
- `num_seconds` is the number of seconds to buffer in case of a backend outage
26+
- `requests_per_second` is the average number of requests per seconds.
1527

16-
Additional configuration for the trace exporter:
17-
18-
- `trace.bundle_delay_threshold` (optional): Starting from the time that the first span is added to a bundle, once this delay has passed, handle the bundle. If not set, uses the exporter default.
19-
- `trace.bundle_count_threshold` (optional): Once a bundle has this many spans, handle the bundle. Since only one span at a time is added to a bundle, no bundle will exceed this threshold, so it also serves as a limit. If not set, uses the exporter default.
20-
- `trace.bundle_byte_threshold` (optional): Once the number of bytes in current bundle reaches this threshold, handle the bundle. This triggers handling, but does not cap the total size of a bundle. If not set, uses the exporter default.
21-
- `trace.bundle_byte_limit` (optional): The maximum size of a bundle, in bytes. Zero means unlimited.
22-
- `trace.buffer_max_bytes` (optional): The maximum number of bytes that the Bundler will keep in memory before returning ErrOverflow. If not set, uses the exporter default.
28+
Note: These `retry_on_failure` and `sending_queue` are provided (and documented) by the [Exporter Helper](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/exporterhelper#configuration)
2329

2430
Additional configuration for the metric exporter:
2531

@@ -48,12 +54,15 @@ exporters:
4854
- source_key: source.label1
4955
target_key: target_label_1
5056

51-
trace:
52-
bundle_delay_threshold: 2s
53-
bundle_count_threshold: 50
54-
bundle_byte_threshold: 15e3
55-
bundle_byte_limit: 0
56-
buffer_max_bytes: 8e6
57+
retry_on_failure:
58+
enabled: true
59+
initial_interval: 5s
60+
max_interval: 30s
61+
max_elapsed_time: 120s
62+
sending_queue:
63+
enabled: true
64+
num_consumers: 2
65+
queue_size: 50
5766

5867
metric:
5968
prefix: prefix
@@ -70,3 +79,23 @@ following proxy environment variables:
7079
7180
If set at Collector start time then exporters, regardless of protocol,
7281
will or will not proxy traffic as defined by these environment variables.
82+
83+
84+
# Recommendations
85+
86+
It is recommended to always run a [batch processor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor)
87+
and [memory limiter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiter) for tracing pipelines to ensure
88+
optimal network usage and avoiding memory overruns. You may also want to run an additional
89+
[sampler](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/probabilisticsamplerprocessor), depending on your needs.
90+
91+
92+
# Deprecatations
93+
94+
The previous trace configuration (v0.21.0) has been deprecated in favor of the common configuration options available in OpenTelemetry. These will cause a failure to start
95+
and should be migrated:
96+
97+
- `trace.bundle_delay_threshold` (optional): Use `batch` processor instead ([docs](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor)).
98+
- `trace.bundle_count_threshold` (optional): Use `batch` processor instead ([docs](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor)).
99+
- `trace.bundle_byte_threshold` (optional): Use `memorylimiter` processor instead ([docs](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiter))
100+
- `trace.bundle_byte_limit` (optional): Use `memorylimiter` processor instead ([docs](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiter))
101+
- `trace.buffer_max_bytes` (optional): Use `memorylimiter` processor instead ([docs](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiter))

exporter/stackdriverexporter/config.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
package stackdriverexporter
1616

1717
import (
18-
"time"
19-
2018
"go.opentelemetry.io/collector/config/configmodels"
2119
"go.opentelemetry.io/collector/exporter/exporterhelper"
2220
"google.golang.org/api/option"
@@ -30,26 +28,20 @@ type Config struct {
3028
Endpoint string `mapstructure:"endpoint"`
3129
// Only has effect if Endpoint is not ""
3230
UseInsecure bool `mapstructure:"use_insecure"`
31+
3332
// Timeout for all API calls. If not set, defaults to 12 seconds.
3433
exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
35-
ResourceMappings []ResourceMapping `mapstructure:"resource_mappings"`
34+
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
35+
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
36+
37+
ResourceMappings []ResourceMapping `mapstructure:"resource_mappings"`
3638
// GetClientOptions returns additional options to be passed
3739
// to the underlying Google Cloud API client.
3840
// Must be set programmatically (no support via declarative config).
3941
// Optional.
4042
GetClientOptions func() []option.ClientOption
4143

42-
TraceConfig TraceConfig `mapstructure:"trace"`
4344
MetricConfig MetricConfig `mapstructure:"metric"`
44-
NumOfWorkers int `mapstructure:"number_of_workers"`
45-
}
46-
47-
type TraceConfig struct {
48-
BundleDelayThreshold time.Duration `mapstructure:"bundle_delay_threshold"`
49-
BundleCountThreshold int `mapstructure:"bundle_count_threshold"`
50-
BundleByteThreshold int `mapstructure:"bundle_byte_threshold"`
51-
BundleByteLimit int `mapstructure:"bundle_byte_limit"`
52-
BufferMaxBytes int `mapstructure:"buffer_max_bytes"`
5345
}
5446

5547
type MetricConfig struct {

exporter/stackdriverexporter/config_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@ func TestLoadConfig(t *testing.T) {
7878
TargetType: "target-resource2",
7979
},
8080
},
81-
NumOfWorkers: 3,
82-
TraceConfig: TraceConfig{
83-
BundleDelayThreshold: 2 * time.Second,
84-
BundleCountThreshold: 50,
85-
BundleByteThreshold: 15000,
86-
BundleByteLimit: 0,
87-
BufferMaxBytes: 8000000,
81+
RetrySettings: exporterhelper.RetrySettings{
82+
Enabled: true,
83+
InitialInterval: 10 * time.Second,
84+
MaxInterval: 1 * time.Minute,
85+
MaxElapsedTime: 10 * time.Minute,
86+
},
87+
QueueSettings: exporterhelper.QueueSettings{
88+
Enabled: true,
89+
NumConsumers: 2,
90+
QueueSize: 10,
8891
},
8992
MetricConfig: MetricConfig{
9093
Prefix: "prefix",

exporter/stackdriverexporter/factory.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ func createDefaultConfig() configmodels.Exporter {
5656
NameVal: typeStr,
5757
},
5858
TimeoutSettings: exporterhelper.TimeoutSettings{Timeout: defaultTimeout},
59+
RetrySettings: exporterhelper.DefaultRetrySettings(),
60+
QueueSettings: exporterhelper.DefaultQueueSettings(),
5961
UserAgent: "opentelemetry-collector-contrib {{version}}",
6062
}
6163
}

exporter/stackdriverexporter/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ go 1.14
44

55
require (
66
contrib.go.opencensus.io/exporter/stackdriver v0.13.5
7-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.16.0
7+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0
88
github.com/census-instrumentation/opencensus-proto v0.3.0
99
github.com/stretchr/testify v1.7.0
1010
go.opencensus.io v0.23.0
1111
go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383
1212
go.opentelemetry.io/otel v0.17.0
13-
go.opentelemetry.io/otel/sdk v0.16.0
13+
go.opentelemetry.io/otel/sdk v0.17.0
1414
go.opentelemetry.io/otel/trace v0.17.0
1515
go.uber.org/zap v1.16.0
1616
google.golang.org/api v0.40.0

exporter/stackdriverexporter/go.sum

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q
7878
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
7979
github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
8080
github.com/DataDog/zstd v1.4.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
81-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.16.0 h1:ljU7eS7Fe0eGWEJxhoIjGANPEhx2f5PKTbDjvT61Kwk=
82-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.16.0/go.mod h1:TLDTgf8D4fD8Y1DizdJKtfIjkHJZU1J+mieFB1qS5T8=
81+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0 h1:DwS87jXZh62gXN8QAG0c+qYQApxOPq1CMbVHCKt4w5o=
82+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0/go.mod h1:yZU4uaWc5QB5NYG0oAG1/1x8JKs1gOsy4sevZ9zR2Ok=
8383
github.com/HdrHistogram/hdrhistogram-go v0.9.0/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4=
8484
github.com/HdrHistogram/hdrhistogram-go v1.0.1 h1:GX8GAYDuhlFQnI2fRDHQhTlkHMz8bEn0jTI6LJU0mpw=
8585
github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM=
@@ -139,7 +139,6 @@ github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/
139139
github.com/aws/aws-sdk-go v1.37.8 h1:9kywcbuz6vQuTf+FD+U7FshafrHzmqUCjgAEiLuIJ8U=
140140
github.com/aws/aws-sdk-go v1.37.8/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
141141
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
142-
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
143142
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
144143
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
145144
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -1059,15 +1058,14 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
10591058
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
10601059
go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 h1:ZQxlOelL8x2D9uiCN0r7aiCHIttvPfyF6XDJN4t7jhs=
10611060
go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383/go.mod h1:sBkAGYUQSh1f+owCK0aPV2uLcUB6rPHEOWjdvuE2SdQ=
1062-
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
10631061
go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U=
10641062
go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
10651063
go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug=
10661064
go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
10671065
go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4=
10681066
go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
1069-
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
1070-
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
1067+
go.opentelemetry.io/otel/sdk v0.17.0 h1:eHXQwanmbtSHM/GcJYbJ8FyyH/sT9a0e+1Z9ZWkF7Ug=
1068+
go.opentelemetry.io/otel/sdk v0.17.0/go.mod h1:INs1PePjjF2hf842AXsxGTe5lH023QfLTZRFPiV/RUk=
10711069
go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY=
10721070
go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
10731071
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=

exporter/stackdriverexporter/spandata.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ func pdataLinksToOTLinks(links pdata.SpanLinkSlice) []apitrace.Link {
157157
return otLinks
158158
}
159159

160-
func pdataEventsToOTMessageEvents(events pdata.SpanEventSlice) []export.Event {
160+
func pdataEventsToOTMessageEvents(events pdata.SpanEventSlice) []apitrace.Event {
161161
size := events.Len()
162-
otEvents := make([]export.Event, 0, size)
162+
otEvents := make([]apitrace.Event, 0, size)
163163
for i := 0; i < size; i++ {
164164
event := events.At(i)
165-
otEvents = append(otEvents, export.Event{
165+
otEvents = append(otEvents, apitrace.Event{
166166
Name: event.Name(),
167167
Attributes: pdataAttributesToOTAttributes(event.Attributes(), pdata.NewResource()),
168168
Time: time.Unix(0, int64(event.Timestamp())),

exporter/stackdriverexporter/spandata_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func TestPDataResourceSpansToOTSpanData_endToEnd(t *testing.T) {
101101
Name: "End-To-End Here",
102102
StartTime: startTime,
103103
EndTime: endTime,
104-
MessageEvents: []trace.Event{
104+
MessageEvents: []apitrace.Event{
105105
{
106106
Time: startTime,
107107
Name: "start",

exporter/stackdriverexporter/stackdriver.go

Lines changed: 6 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"context"
2121
"fmt"
2222
"strings"
23-
"time"
2423

2524
"contrib.go.opencensus.io/exporter/stackdriver"
2625
cloudtrace "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace"
@@ -35,8 +34,6 @@ import (
3534
"google.golang.org/grpc"
3635
)
3736

38-
const name = "stackdriver"
39-
4037
// traceExporter is a wrapper struct of OT cloud trace exporter
4138
type traceExporter struct {
4239
texporter *cloudtrace.Exporter
@@ -47,14 +44,6 @@ type metricsExporter struct {
4744
mexporter *stackdriver.Exporter
4845
}
4946

50-
func (*traceExporter) Name() string {
51-
return name
52-
}
53-
54-
func (*metricsExporter) Name() string {
55-
return name
56-
}
57-
5847
func (te *traceExporter) Shutdown(ctx context.Context) error {
5948
return te.texporter.Shutdown(ctx)
6049
}
@@ -111,14 +100,6 @@ func newStackdriverTraceExporter(cfg *Config, params component.ExporterCreatePar
111100
return nil, err
112101
}
113102
topts = append(topts, cloudtrace.WithTraceClientOptions(copts))
114-
if cfg.NumOfWorkers > 0 {
115-
topts = append(topts, cloudtrace.WithMaxNumberOfWorkers(cfg.NumOfWorkers))
116-
}
117-
118-
topts, err = appendBundleOptions(topts, cfg.TraceConfig)
119-
if err != nil {
120-
return nil, err
121-
}
122103

123104
exp, err := cloudtrace.NewExporter(topts...)
124105
if err != nil {
@@ -134,60 +115,9 @@ func newStackdriverTraceExporter(cfg *Config, params component.ExporterCreatePar
134115
exporterhelper.WithShutdown(tExp.Shutdown),
135116
// Disable exporterhelper Timeout, since we are using a custom mechanism
136117
// within exporter itself
137-
exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}))
138-
}
139-
140-
func appendBundleOptions(topts []cloudtrace.Option, cfg TraceConfig) ([]cloudtrace.Option, error) {
141-
topts, err := validateAndAppendDurationOption(topts, "BundleDelayThreshold", cfg.BundleDelayThreshold, cloudtrace.WithBundleDelayThreshold(cfg.BundleDelayThreshold))
142-
if err != nil {
143-
return nil, err
144-
}
145-
146-
topts, err = validateAndAppendIntOption(topts, "BundleCountThreshold", cfg.BundleCountThreshold, cloudtrace.WithBundleCountThreshold(cfg.BundleCountThreshold))
147-
if err != nil {
148-
return nil, err
149-
}
150-
151-
topts, err = validateAndAppendIntOption(topts, "BundleByteThreshold", cfg.BundleByteThreshold, cloudtrace.WithBundleByteThreshold(cfg.BundleByteThreshold))
152-
if err != nil {
153-
return nil, err
154-
}
155-
156-
topts, err = validateAndAppendIntOption(topts, "BundleByteLimit", cfg.BundleByteLimit, cloudtrace.WithBundleByteLimit(cfg.BundleByteLimit))
157-
if err != nil {
158-
return nil, err
159-
}
160-
161-
topts, err = validateAndAppendIntOption(topts, "BufferMaxBytes", cfg.BufferMaxBytes, cloudtrace.WithBufferMaxBytes(cfg.BufferMaxBytes))
162-
if err != nil {
163-
return nil, err
164-
}
165-
166-
return topts, nil
167-
}
168-
169-
func validateAndAppendIntOption(topts []cloudtrace.Option, name string, val int, opt cloudtrace.Option) ([]cloudtrace.Option, error) {
170-
if val < 0 {
171-
return nil, fmt.Errorf("invalid value for: %s", name)
172-
}
173-
174-
if val > 0 {
175-
topts = append(topts, opt)
176-
}
177-
178-
return topts, nil
179-
}
180-
181-
func validateAndAppendDurationOption(topts []cloudtrace.Option, name string, val time.Duration, opt cloudtrace.Option) ([]cloudtrace.Option, error) {
182-
if val < 0 {
183-
return nil, fmt.Errorf("invalid value for: %s", name)
184-
}
185-
186-
if val > 0 {
187-
topts = append(topts, opt)
188-
}
189-
190-
return topts, nil
118+
exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}),
119+
exporterhelper.WithQueue(cfg.QueueSettings),
120+
exporterhelper.WithRetry(cfg.RetrySettings))
191121
}
192122

193123
func newStackdriverMetricsExporter(cfg *Config, params component.ExporterCreateParams) (component.MetricsExporter, error) {
@@ -220,9 +150,6 @@ func newStackdriverMetricsExporter(cfg *Config, params component.ExporterCreateP
220150
options.TraceClientOptions = copts
221151
options.MonitoringClientOptions = copts
222152

223-
if cfg.NumOfWorkers > 0 {
224-
options.NumberOfWorkers = cfg.NumOfWorkers
225-
}
226153
if cfg.MetricConfig.SkipCreateMetricDescriptor {
227154
options.SkipCMD = true
228155
}
@@ -246,7 +173,9 @@ func newStackdriverMetricsExporter(cfg *Config, params component.ExporterCreateP
246173
exporterhelper.WithShutdown(mExp.Shutdown),
247174
// Disable exporterhelper Timeout, since we are using a custom mechanism
248175
// within exporter itself
249-
exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}))
176+
exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}),
177+
exporterhelper.WithQueue(cfg.QueueSettings),
178+
exporterhelper.WithRetry(cfg.RetrySettings))
250179
}
251180

252181
// pushMetrics calls StackdriverExporter.PushMetricsProto on each element of the given metrics

0 commit comments

Comments
 (0)