Skip to content

Commit

Permalink
[exporter/splunk_hec] Update limits for max_content_length settings (o…
Browse files Browse the repository at this point in the history
…pen-telemetry#11550)

Splunk Core/Cloud support request payloads up to 800 Mb (https://docs.splunk.com/Documentation/Splunk/8.2.2/Admin/Limitsconf#.5Bhttp_input.5D), but the exporter currently doesn't allow sending payloads more than 2 Mb due to a Splunk Observability ingest limitation. This change updates the limits to make it possible to send bigger requests.
  • Loading branch information
dmitryax authored Jun 29, 2022
1 parent 39a9938 commit ea8fcf2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- `saphanareceiver`: Fix component memory query, add better error handling (#11507)
- `sqlqueryreceiver`: Add core functionality to SQL query receiver (#10867)
- `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)
- `prometheusexporter` : Added a feature to prometheusexporter to export exemplars along with histogram metrics (#9945)
- `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

0 comments on commit ea8fcf2

Please sign in to comment.