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

[exporter/splunk_hec] Update limits for max_content_length settings #11550

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- `prometheusreceiver`: Add `target_info` labels to resource attributes. (#11034)
- `saphanareceiver`: Fix component memory query, add better error handling (#11507)
- `sapmexporter`: Add config option to log responses from Splunk APM. (#11425)
- `splunkhecexporter`: Update limits for max_content_length settings (#11550)
- `filterprocessor`: Add ability to filter `Spans` (#6341)
- `tracegen`: support add additional resource attributes. (#11145)

Expand Down
12 changes: 10 additions & 2 deletions exporter/splunkhecexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ The following configuration options can also be configured:
- `ca_file` (no default) Path to the CA cert to verify the server being connected to.
- `cert_file` (no default) Path to the TLS cert to use for client connections when TLS client auth is required.
- `key_file` (no default) Path to the TLS key to use for TLS required connections.
- `max_content_length_logs` (default: 2097152): Maximum log data size in bytes per HTTP post limited to 2097152 bytes (2 MiB).
- `max_content_length_metrics` (default: 2097152): Maximum metric data size in bytes per HTTP post limited to 2097152 bytes (2 MiB).
- `max_content_length_logs` (default: 2097152): Maximum log payload size in bytes. Log batches of bigger size will be
broken down into several requests. Default value is 2097152 bytes (2 MiB). Maximum allowed value is 838860800
(~ 800 MB). Keep in mind that Splunk Observability backend doesn't accept requests bigger than 2 MiB. This
configuration value can be raised only if used with Splunk Core/Cloud.
- `max_content_length_metrics` (default: 2097152): Maximum metric payload size in bytes. Metric batches of bigger size
will be broken down into several requests. Default value is 2097152 bytes (2 MiB). Maximum allowed value is 838860800
(~ 800 MB).
- `max_content_length_metrics` (default: 2097152): Maximum trace payload size in bytes. Trace batches of bigger size
will be broken down into several requests. Default value is 2097152 bytes (2 MiB). Maximum allowed value is 838860800
(~ 800 MB).
- `splunk_app_name` (default: "OpenTelemetry Collector Contrib") App name is used to track telemetry information for Splunk App's using HEC by App name.
- `splunk_app_version` (default: Current OpenTelemetry Collector Contrib Build Version): App version is used to track telemetry information for Splunk App's using HEC by App version.
- `log_data_enabled` (default: true): Specifies whether the log data is exported. Set it to `false` if you want the log
Expand Down
20 changes: 13 additions & 7 deletions exporter/splunkhecexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ import (

const (
// hecPath is the default HEC path on the Splunk instance.
hecPath = "services/collector"
maxContentLengthLogsLimit = 2 * 1024 * 1024
maxContentLengthMetricsLimit = 2 * 1024 * 1024
maxContentLengthTracesLimit = 2 * 1024 * 1024
hecPath = "services/collector"
defaultContentLengthLogsLimit = 2 * 1024 * 1024
defaultContentLengthMetricsLimit = 2 * 1024 * 1024
defaultContentLengthTracesLimit = 2 * 1024 * 1024
maxContentLengthLogsLimit = 800 * 1024 * 1024
maxContentLengthMetricsLimit = 800 * 1024 * 1024
maxContentLengthTracesLimit = 800 * 1024 * 1024
)

// OtelToHecFields defines the mapping of attributes to HEC fields
Expand Down Expand Up @@ -80,13 +83,16 @@ type Config struct {
// Disable GZip compression. Defaults to false.
DisableCompression bool `mapstructure:"disable_compression"`

// Maximum log data size in bytes per HTTP post. Defaults to the backend limit of 2097152 bytes (2MiB).
// Maximum log payload size in bytes. Default value is 2097152 bytes (2MiB).
// Maximum allowed value is 838860800 (~ 800 MB).
MaxContentLengthLogs uint `mapstructure:"max_content_length_logs"`

// Maximum metric data size in bytes per HTTP post. Defaults to the backend limit of 2097152 bytes (2MiB).
// Maximum metric payload size in bytes. Default value is 2097152 bytes (2MiB).
// Maximum allowed value is 838860800 (~ 800 MB).
MaxContentLengthMetrics uint `mapstructure:"max_content_length_metrics"`

// Maximum trace data size in bytes per HTTP post. Defaults to the backend limit of 2097152 bytes (2MiB).
// Maximum trace payload size in bytes. Default value is 2097152 bytes (2MiB).
// Maximum allowed value is 838860800 (~ 800 MB).
MaxContentLengthTraces uint `mapstructure:"max_content_length_traces"`

// TLSSetting struct exposes TLS client configuration.
Expand Down
6 changes: 3 additions & 3 deletions exporter/splunkhecexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func createDefaultConfig() config.Exporter {
QueueSettings: exporterhelper.NewDefaultQueueSettings(),
DisableCompression: false,
MaxConnections: defaultMaxIdleCons,
MaxContentLengthLogs: maxContentLengthLogsLimit,
MaxContentLengthMetrics: maxContentLengthMetricsLimit,
MaxContentLengthTraces: maxContentLengthTracesLimit,
MaxContentLengthLogs: defaultContentLengthLogsLimit,
MaxContentLengthMetrics: defaultContentLengthMetricsLimit,
MaxContentLengthTraces: defaultContentLengthTracesLimit,
HecToOtelAttrs: splunk.HecToOtelAttrs{
Source: splunk.DefaultSourceLabel,
SourceType: splunk.DefaultSourceTypeLabel,
Expand Down