Skip to content

Commit

Permalink
updates default for FailClosed to true for probabilistic_samplier pro…
Browse files Browse the repository at this point in the history
…cessor
  • Loading branch information
StefanKurek committed May 24, 2024
1 parent 1c60f9f commit 11853c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (

// DefaultArguments holds default settings for Arguments.
var DefaultArguments = Arguments{
FailClosed: true,
AttributeSource: "traceID",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand All @@ -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"
Expand All @@ -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",
Expand Down

0 comments on commit 11853c3

Please sign in to comment.