Skip to content
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
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ linters:
- linters:
- forbidigo
path: processor/tailsamplingprocessor/
- linters:
- forbidigo
path: processor/transformprocessor/
- linters:
- forbidigo
path: receiver/awscontainerinsightreceiver/
Expand Down
1 change: 1 addition & 0 deletions processor/transformprocessor/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This component has the following feature gates:

| Feature Gate | Stage | Description | From Version | To Version | Reference |
| ------------ | ----- | ----------- | ------------ | ---------- | --------- |
| `processor.transform.defaultErrorModeIgnore` | alpha | Changes the default error_mode of the transform processor from propagate to ignore | v0.150.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/47231) |
| `transform.flatten.logs` | alpha | Flatten log data prior to transformation so every record has a unique copy of the resource and scope. Regroups logs based on resource and scope after transformations. | v0.103.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32080#issuecomment-2120764953) |

For more information about feature gates, see the [Feature Gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md) documentation.
13 changes: 1 addition & 12 deletions processor/transformprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/xconsumer"
"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorhelper"
"go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper"
Expand All @@ -34,16 +33,6 @@ import (

var processorCapabilities = consumer.Capabilities{MutatesData: true}

const defaultErrorModeIgnoreGateID = "processor.transform.defaultErrorModeIgnore"

var defaultErrorModeIgnoreFeatureGate = featuregate.GlobalRegistry().MustRegister(
defaultErrorModeIgnoreGateID,
featuregate.StageAlpha,
featuregate.WithRegisterDescription("Changes the default error_mode of the transform processor from propagate to ignore"),
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/47231"),
featuregate.WithRegisterFromVersion("v0.150.0"),
)

type transformProcessorFactory struct {
dataPointFunctions map[string]ottl.Factory[*ottldatapoint.TransformContext]
logFunctions map[string]ottl.Factory[*ottllog.TransformContext]
Expand Down Expand Up @@ -218,7 +207,7 @@ func NewFactoryWithOptions(options ...FactoryOption) processor.Factory {

func (f *transformProcessorFactory) createDefaultConfig() component.Config {
defaultErrorMode := ottl.PropagateError
if defaultErrorModeIgnoreFeatureGate.IsEnabled() {
if metadata.ProcessorTransformDefaultErrorModeIgnoreFeatureGate.IsEnabled() {
defaultErrorMode = ottl.IgnoreError
}
return &Config{
Expand Down
4 changes: 2 additions & 2 deletions processor/transformprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestFactory_Type(t *testing.T) {

func TestFactory_CreateDefaultConfig(t *testing.T) {
t.Cleanup(func() {
_ = featuregate.GlobalRegistry().Set(defaultErrorModeIgnoreGateID, false)
_ = featuregate.GlobalRegistry().Set(metadata.ProcessorTransformDefaultErrorModeIgnoreFeatureGate.ID(), false)
})

factory := NewFactory()
Expand All @@ -77,7 +77,7 @@ func TestFactory_CreateDefaultConfig(t *testing.T) {
assertConfigContainsDefaultFunctions(t, *cfg.(*Config))
require.NoError(t, componenttest.CheckConfigStruct(cfg))

err := featuregate.GlobalRegistry().Set(defaultErrorModeIgnoreGateID, true)
err := featuregate.GlobalRegistry().Set(metadata.ProcessorTransformDefaultErrorModeIgnoreFeatureGate.ID(), true)
require.NoError(t, err)

cfg = factory.CreateDefaultConfig()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion processor/transformprocessor/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ status:
seeking_new: true

feature_gates:
- id: "processor.transform.defaultErrorModeIgnore"
description: Changes the default error_mode of the transform processor from propagate to ignore
stage: alpha
from_version: v0.150.0
reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/47231

- id: "transform.flatten.logs"
description: Flatten log data prior to transformation so every record has a unique copy of the resource and scope. Regroups logs based on resource and scope after transformations.
stage: alpha
from_version: v0.103.0
reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32080#issuecomment-2120764953

tests:
config:
Loading