Skip to content

Commit 70b5a13

Browse files
authored
[Service Control exporter] Update the Service Control exporter's config for v0.123.0 (#291)
1 parent ecf2f76 commit 70b5a13

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

components/google-built-opentelemetry-collector/exporter/googleservicecontrolexporter/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ type Config struct {
4141
UseInsecure bool `mapstructure:"use_insecure"`
4242
LogConfig LogConfig `mapstructure:"log"`
4343

44-
exporterhelper.TimeoutConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
45-
configretry.BackOffConfig `mapstructure:"retry_on_failure"`
46-
exporterhelper.QueueConfig `mapstructure:"sending_queue"`
44+
TimeoutConfig exporterhelper.TimeoutConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
45+
configretry.BackOffConfig `mapstructure:"retry_on_failure"`
46+
QueueConfig exporterhelper.QueueConfig `mapstructure:"sending_queue"`
4747
}
4848

4949
type LogConfig struct {

components/google-built-opentelemetry-collector/exporter/googleservicecontrolexporter/factory.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ func createDefaultConfig() component.Config {
8585
// Limit queue size to prevent memory growing in case of API outage.
8686
// This queue grows only in case of retries.
8787
QueueSize: 3000,
88+
// SizerTypeRequests (RequestSizerTypeRequests) is the default in NewDefaultQueueConfig()
89+
Sizer: exporterhelper.RequestSizerTypeRequests,
8890
},
8991
LogConfig: LogConfig{
9092
OperationName: LogDefaultOperationName,

components/google-built-opentelemetry-collector/exporter/googleservicecontrolexporter/factory_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func TestCreateExporterFromConfig(t *testing.T) {
6868
Enabled: true,
6969
NumConsumers: 5,
7070
QueueSize: 1000,
71+
Sizer: exporterhelper.RequestSizerTypeRequests,
7172
},
7273
ServiceControlEndpoint: "test.googleapis.com:443",
7374
ConsumerProject: "my-project-id",

components/google-built-opentelemetry-collector/exporter/googleservicecontrolexporter/testdata/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ exporters:
2626
enabled: true
2727
num_consumers: 5
2828
queue_size: 1000
29+
sizer: "requests"
2930
log:
3031
default_log_name: "log-name"
3132
operation_name: "test-operation-name"

0 commit comments

Comments
 (0)