Skip to content

Commit 98552ac

Browse files
authored
Merge pull request #145 from kube-logging/chore/bump-axo-otelcol
chore: bump axoflow-otelcol version to v0.120.0
2 parents b47ca1a + 5bc051b commit 98552ac

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

internal/controller/telemetry/collector_controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import (
5050
const (
5151
otelCollectorKind = "OpenTelemetryCollector"
5252
requeueDelayOnFailedTenant = 20 * time.Second
53-
axoflowOtelCollectorImageRef = "ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:0.112.0-dev12"
53+
axoflowOtelCollectorImageRef = "ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:0.120.0"
5454
)
5555

5656
var (
@@ -507,7 +507,7 @@ func (r *CollectorReconciler) reconcileClusterRole(ctx context.Context, collecto
507507
{
508508
Verbs: []string{"get", "watch", "list"},
509509
APIGroups: []string{""},
510-
Resources: []string{"pods", "namespaces"},
510+
Resources: []string{"pods", "namespaces", "nodes"},
511511
},
512512
{
513513
Verbs: []string{"get", "watch", "list"},

internal/controller/telemetry/otel_conf_gen/otel_conf_gen.go

+27-7
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,40 @@ func (cfgInput *OtelColConfigInput) AssembleConfig(ctx context.Context) (otelv1b
333333

334334
func assembleAdditionalArgs(otelConfig *otelv1beta1.Config) map[string]string {
335335
const (
336-
featureGatesKey = "feature-gates"
337-
flattenLogsFeatureGateValue = "transform.flatten.logs"
338-
336+
featureGatesKey = "feature-gates"
339337
transformProcessorID = "transform"
340338
flattenDataKey = "flatten_data"
341339
)
340+
const (
341+
flattenLogsFeatureGateValue = "transform.flatten.logs"
342+
telemetryDisableAddressFieldForInternalTelemetry = "telemetry.disableAddressFieldForInternalTelemetry"
343+
)
342344

345+
type enableConstraint func() bool
343346
args := make(map[string]string)
344-
for processorName, processorConfig := range otelConfig.Processors.Object {
345-
if strings.Contains(processorName, transformProcessorID) && processorConfig.(processor.TransformProcessor).FlattenData {
346-
args[featureGatesKey] = flattenLogsFeatureGateValue
347-
break
347+
availableFeatureGates := map[string]enableConstraint{
348+
flattenLogsFeatureGateValue: func() bool {
349+
for processorName, processorConfig := range otelConfig.Processors.Object {
350+
if strings.Contains(processorName, transformProcessorID) && processorConfig.(processor.TransformProcessor).FlattenData {
351+
return true
352+
}
353+
}
354+
return false
355+
},
356+
telemetryDisableAddressFieldForInternalTelemetry: func() bool {
357+
return true
358+
},
359+
}
360+
361+
var enabledFeatureGates []string
362+
for featureGate, isFeatureGateEnabled := range availableFeatureGates {
363+
if isFeatureGateEnabled() {
364+
enabledFeatureGates = append(enabledFeatureGates, featureGate)
348365
}
349366
}
367+
if len(enabledFeatureGates) > 0 {
368+
args[featureGatesKey] = strings.Join(enabledFeatureGates, ",")
369+
}
350370

351371
return args
352372
}

0 commit comments

Comments
 (0)