Skip to content

Commit b37a55e

Browse files
authored
[exporter/signalfx] [exporter/splunkhec] Remove max_connections config parameter (#27611)
**Description:** The max_connections config setting were deprecated with #16837 and #16838. It has been 10 months since these changes have been made and it is time to remove this configuration setting altogether. **Link to tracking Issue:** #27610
1 parent 30024d9 commit b37a55e

File tree

9 files changed

+56
-43
lines changed

9 files changed

+56
-43
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: splunkhecexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Remove `max_connections` configuration setting.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [27610]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
use max_idle_conns or max_idle_conns_per_host instead.
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: []

.chloggen/remove-max-connections.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: signalfxexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Remove `max_connections` configuration setting.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [27610]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
use max_idle_conns or max_idle_conns_per_host instead.
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: []

exporter/signalfxexporter/config.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ type Config struct {
130130
// to be used in a dimension key.
131131
NonAlphanumericDimensionChars string `mapstructure:"nonalphanumeric_dimension_chars"`
132132

133-
// MaxConnections is used to set a limit to the maximum idle HTTP connection the exporter can keep open.
134-
// Deprecated: use HTTPClientSettings.MaxIdleConns or HTTPClientSettings.MaxIdleConnsPerHost instead.
135-
MaxConnections int `mapstructure:"max_connections"`
136-
137133
// Whether to drop histogram bucket metrics dispatched to Splunk Observability.
138134
// Default value is set to false.
139135
DropHistogramBuckets bool `mapstructure:"drop_histogram_buckets"`
@@ -226,10 +222,6 @@ func (cfg *Config) Validate() error {
226222
return errors.New(`cannot have a negative "timeout"`)
227223
}
228224

229-
if cfg.MaxConnections < 0 {
230-
return errors.New(`cannot have a negative "max_connections"`)
231-
}
232-
233225
return nil
234226
}
235227

exporter/signalfxexporter/config_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,6 @@ func TestConfigValidateErrors(t *testing.T) {
484484
APIURL: "https://api.us1.signalfx.com/",
485485
},
486486
},
487-
{
488-
name: "Negative MaxConnections",
489-
cfg: &Config{
490-
Realm: "us0",
491-
AccessToken: "access_token",
492-
MaxConnections: -1,
493-
},
494-
},
495487
{
496488
name: "Negative Timeout",
497489
cfg: &Config{

exporter/signalfxexporter/exporter.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ func (se *signalfxExporter) startLogs(_ context.Context, host component.Host) er
212212
func (se *signalfxExporter) createClient(host component.Host) (*http.Client, error) {
213213
se.config.HTTPClientSettings.TLSSetting = se.config.IngestTLSSettings
214214

215-
if se.config.MaxConnections != 0 && (se.config.MaxIdleConns == nil || se.config.HTTPClientSettings.MaxIdleConnsPerHost == nil) {
216-
se.logger.Warn("You are using the deprecated `max_connections` option that will be removed soon; use `max_idle_conns` and/or `max_idle_conns_per_host` instead: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/signalfxexporter#advanced-configuration")
217-
if se.config.HTTPClientSettings.MaxIdleConns == nil {
218-
se.config.HTTPClientSettings.MaxIdleConns = &se.config.MaxConnections
219-
}
220-
if se.config.HTTPClientSettings.MaxIdleConnsPerHost == nil {
221-
se.config.HTTPClientSettings.MaxIdleConnsPerHost = &se.config.MaxConnections
222-
}
223-
}
224-
225215
return se.config.ToClient(host, se.telemetrySettings)
226216
}
227217

exporter/splunkhecexporter/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ The following configuration options can also be configured:
2626
- `source` (no default): Optional Splunk source: https://docs.splunk.com/Splexicon:Source
2727
- `sourcetype` (no default): Optional Splunk source type: https://docs.splunk.com/Splexicon:Sourcetype
2828
- `index` (no default): Splunk index, optional name of the Splunk index targeted
29-
- `max_connections` (default: 100): Maximum HTTP connections to use simultaneously when sending data. Deprecated: use `max_idle_conns` or `max_idle_conns_per_host` instead. See [HTTP settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confighttp/README.md) for more info.
3029
- `use_multi_metric_format` (default: false): Combines metrics with the same metadata to reduce ingest using the [multiple-metric JSON format](https://docs.splunk.com/Documentation/Splunk/9.0.0/Metrics/GetMetricsInOther#The_multiple-metric_JSON_format). Applicable in the `metrics` pipeline only.
3130
- `disable_compression` (default: false): Whether to disable gzip compression over HTTP.
3231
- `timeout` (default: 10s): HTTP timeout when sending data.

exporter/splunkhecexporter/client.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -664,16 +664,6 @@ func checkHecHealth(ctx context.Context, client *http.Client, healthCheckURL *ur
664664
func buildHTTPClient(config *Config, host component.Host, telemetrySettings component.TelemetrySettings) (*http.Client, error) {
665665
// we handle compression explicitly.
666666
config.HTTPClientSettings.Compression = ""
667-
if config.MaxConnections != 0 && (config.MaxIdleConns == nil || config.HTTPClientSettings.MaxIdleConnsPerHost == nil) {
668-
telemetrySettings.Logger.Warn("You are using the deprecated `max_connections` option that will be removed soon; use `max_idle_conns` and/or `max_idle_conns_per_host` instead: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/splunkhecexporter#advanced-configuration")
669-
intMaxConns := int(config.MaxConnections)
670-
if config.HTTPClientSettings.MaxIdleConns == nil {
671-
config.HTTPClientSettings.MaxIdleConns = &intMaxConns
672-
}
673-
if config.HTTPClientSettings.MaxIdleConnsPerHost == nil {
674-
config.HTTPClientSettings.MaxIdleConnsPerHost = &intMaxConns
675-
}
676-
}
677667
return config.ToClient(host, telemetrySettings)
678668
}
679669

exporter/splunkhecexporter/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ type Config struct {
8686
// Splunk index, optional name of the Splunk index.
8787
Index string `mapstructure:"index"`
8888

89-
// MaxConnections is used to set a limit to the maximum idle HTTP connection the exporter can keep open. Defaults to 100.
90-
// Deprecated: use HTTPClientSettings.MaxIdleConns or HTTPClientSettings.MaxIdleConnsPerHost instead.
91-
MaxConnections uint `mapstructure:"max_connections"`
92-
9389
// Disable GZip compression. Defaults to false.
9490
DisableCompression bool `mapstructure:"disable_compression"`
9591

exporter/splunkhecexporter/example/otel-collector-config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ exporters:
2121
sourcetype: "otel"
2222
# Splunk index, optional name of the Splunk index targeted.
2323
index: "metrics"
24-
# Maximum HTTP connections to use simultaneously when sending data. Defaults to 100.
25-
max_connections: 20
2624
# Whether to disable gzip compression over HTTP. Defaults to false.
2725
disable_compression: false
2826
# HTTP timeout when sending data. Defaults to 10s.

0 commit comments

Comments
 (0)