Skip to content

Commit

Permalink
Unenforce the otlp_receiver feature flag (#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferbrecht authored Aug 9, 2023
1 parent d069871 commit dce9ca8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
4 changes: 2 additions & 2 deletions confgenerator/confgenerator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,6 @@ func init() {
// Set up the test environment with mocked data.
confgenerator.MetadataResource = testResource

// Enable experimental features.
os.Setenv("EXPERIMENTAL_FEATURES", "otlp_receiver")
// Enable experimental features here by calling:
// os.Setenv("EXPERIMENTAL_FEATURES", "...(comma-separated feature list)...")
}
15 changes: 12 additions & 3 deletions confgenerator/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ import (
"github.com/go-playground/validator/v10"
)

var requiredFeatureForType = map[string]string{
"otlp": "otlp_receiver",
}
// requiredFeatureForType maps a component type to a feature that must
// be enabled (via EXPERIMENTAL_FEATURES) in order to use that component
// in an Ops Agent configuration.
// For example, the following would require the user to define the
// "otlp_receiver" feature flag inside EXPERIMENTAL_FEATURES in order to
// be able to use the "otlp" combined receiver:
//
// "otlp": "otlp_receiver"
//
// N.B. There are no enforced feature flags today, so this map is
// intentionally left empty.
var requiredFeatureForType = map[string]string{}

func IsExperimentalFeatureEnabled(feature string) bool {
enabledList := strings.Split(os.Getenv("EXPERIMENTAL_FEATURES"), ",")
Expand Down
19 changes: 0 additions & 19 deletions integration_test/ops_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3603,12 +3603,6 @@ func TestOTLPMetricsGCM(t *testing.T) {
gce.RunForEachPlatform(t, func(t *testing.T, platform string) {
t.Parallel()
ctx, logger, vm := agents.CommonSetup(t, platform)

// Turn on the otlp feature gate.
if err := gce.SetEnvironmentVariables(ctx, logger.ToMainLog(), vm, map[string]string{"EXPERIMENTAL_FEATURES": "otlp_receiver"}); err != nil {
t.Fatal(err)
}

otlpConfig := `
combined:
receivers:
Expand Down Expand Up @@ -3714,12 +3708,6 @@ func TestOTLPMetricsGMP(t *testing.T) {
gce.RunForEachPlatform(t, func(t *testing.T, platform string) {
t.Parallel()
ctx, logger, vm := agents.CommonSetup(t, platform)

// Turn on the otlp feature gate.
if err := gce.SetEnvironmentVariables(ctx, logger.ToMainLog(), vm, map[string]string{"EXPERIMENTAL_FEATURES": "otlp_receiver"}); err != nil {
t.Fatal(err)
}

otlpConfig := `
combined:
receivers:
Expand Down Expand Up @@ -3818,12 +3806,6 @@ func TestOTLPTraces(t *testing.T) {
gce.RunForEachPlatform(t, func(t *testing.T, platform string) {
t.Parallel()
ctx, logger, vm := agents.CommonSetup(t, platform)

// Turn on the otlp feature gate.
if err := gce.SetEnvironmentVariables(ctx, logger.ToMainLog(), vm, map[string]string{"EXPERIMENTAL_FEATURES": "otlp_receiver"}); err != nil {
t.Fatal(err)
}

otlpConfig := `
combined:
receivers:
Expand Down Expand Up @@ -4057,7 +4039,6 @@ func TestParsingFailureCheck(t *testing.T) {
})
}


func TestBufferLimitSizeOpsAgent(t *testing.T) {
t.Parallel()
gce.RunForEachPlatform(t, func(t *testing.T, platform string) {
Expand Down

0 comments on commit dce9ca8

Please sign in to comment.