diff --git a/docs/sources/reference/components/otelcol.processor.probabilistic_sampler.md b/docs/sources/reference/components/otelcol.processor.probabilistic_sampler.md index 99a2704c03..bef0583f03 100644 --- a/docs/sources/reference/components/otelcol.processor.probabilistic_sampler.md +++ b/docs/sources/reference/components/otelcol.processor.probabilistic_sampler.md @@ -34,7 +34,7 @@ Name | Type | Description ----------------------|-----------|----------------------------------------------------------------------------------------------------------------------|-------------|--------- `hash_seed` | `uint32` | An integer used to compute the hash algorithm. | `0` | no `sampling_percentage` | `float32` | Percentage of traces or logs sampled. | `0` | no -`fail_closed` | `bool` | Whether to reject items with sampling-related errors. | `false` | no +`fail_closed` | `bool` | Whether to reject items with sampling-related errors. | `true` | no `attribute_source` | `string` | Defines where to look for the attribute in `from_attribute`. | `"traceID"` | no `from_attribute` | `string` | The name of a log record attribute used for sampling purposes. | `""` | no `sampling_priority` | `string` | The name of a log record attribute used to set a different sampling priority from the `sampling_percentage` setting. | `""` | no @@ -46,8 +46,6 @@ It is also possible to leverage a different `hash_seed` at different collector t `sampling_percentage` determines the percentage at which traces or logs are sampled. All traces or logs are sampled if you set this argument to a value greater than or equal to 100. -`fail_closed` determines whether items with sampling-related errors will be rejected. - `attribute_source` (logs only) determines where to look for the attribute in `from_attribute`. The allowed values are `traceID` or `record`. `from_attribute` (logs only) determines the name of a log record attribute used for sampling purposes, such as a unique log record ID. The value of the attribute is only used if the trace ID is absent or if `attribute_source` is set to `record`. diff --git a/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler.go b/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler.go index a1899001bf..59031059a0 100644 --- a/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler.go +++ b/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler.go @@ -47,6 +47,7 @@ var ( // DefaultArguments holds default settings for Arguments. var DefaultArguments = Arguments{ + FailClosed: true, AttributeSource: "traceID", } diff --git a/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go b/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go index 8370482ed2..45e9f892f4 100644 --- a/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go +++ b/internal/component/otelcol/processor/probabilistic_sampler/probabilistic_sampler_test.go @@ -28,7 +28,7 @@ func TestArguments_UnmarshalAlloy(t *testing.T) { expected: probabilisticsamplerprocessor.Config{ SamplingPercentage: 0, HashSeed: 0, - FailClosed: false, + FailClosed: true, AttributeSource: "traceID", FromAttribute: "", SamplingPriority: "", @@ -39,7 +39,7 @@ func TestArguments_UnmarshalAlloy(t *testing.T) { cfg: ` sampling_percentage = 10 hash_seed = 123 - fail_closed = true + fail_closed = false attribute_source = "record" from_attribute = "logID" sampling_priority = "priority" @@ -48,7 +48,7 @@ func TestArguments_UnmarshalAlloy(t *testing.T) { expected: probabilisticsamplerprocessor.Config{ SamplingPercentage: 10, HashSeed: 123, - FailClosed: true, + FailClosed: false, AttributeSource: "record", FromAttribute: "logID", SamplingPriority: "priority",