Skip to content

Commit

Permalink
Add support for otelcol feature gates to the agent, clusterReceiver, …
Browse files Browse the repository at this point in the history
…and gateway (#410)

* Add support for otelcol feature gates to the agent, clusterReceiver, and gateway
  • Loading branch information
jvoravong authored Mar 16, 2022
1 parent d7f12bb commit 4541790
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Added

- Add support for otelcol feature gates to the agent, clusterReceiver, and gateway (#410)

## [0.45.0] - 2022-03-10

### Changed
Expand Down
31 changes: 31 additions & 0 deletions docs/advanced-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,37 @@ autodetect:
prometheus: true
```

## Using feature gates
Enable or disable features of the otel-collector agent, clusterReceiver, and gateway (respectively) using feature
gates. Use the agent.featureGates, clusterReceiver.featureGates, and gateway.featureGates configs to enable or disable
features, these configs will be used to populate the otelcol binary startup argument "--feature-gates". For more
details see the
[feature gate documentation](https://github.com/open-telemetry/opentelemetry-collector/blob/main/service/featuregate/README.md).

Helm Install Example:
```bash
helm install {name} --set agent.featureGates=+feature1 --set clusterReceiver.featureGates=feature2 --set gateway.featureGates=-feature2 {other_flags}
```
Would result in the agent having feature1 enabled, the clusterReceiver having feature2 enabled, and the gateway having
feature2 disabled.

### Highlighted feature gates
- receiver.k8sclusterreceiver.reportCpuMetricsAsDouble
- Description
- The k8s container and node cpu metrics being reported by the k8sclusterreceiver are transitioning from being
reported as integer millicpu units to being reported as double cpu units to adhere to opentelemetry cpu metric
specifications. Please update any monitoring this might affect, the change will cause cpu metrics to be double
instead of integer values as well as metric values will be scaled down by 1000x.
- Availability
- v0.47.0 - v0.53.0
- Usage
- Install with the feature gate enabled:
- helm install {name} --set clusterReceiver.featureGates=receiver.k8sclusterreceiver.reportCpuMetricsAsDouble {other_flags}
- Install with the feature gate disabled:
- helm install {name} --set clusterReceiver.featureGates=-receiver.k8sclusterreceiver.reportCpuMetricsAsDouble {other_flags}
- More Information
- [k8sclusterreceiver feature gate configurations](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/k8sclusterreceiver/README.md#feature-gate-configurations)

## Override underlying OpenTelemetry agent configuration

If you want to use your own OpenTelemetry Agent configuration, you can override it by providing a custom configuration in the `agent.config` parameter in the values.yaml, which will be merged into the default agent configuration, list parts of the configuration (for example, `service.pipelines.logs.processors`) to be fully re-defined.
3 changes: 3 additions & 0 deletions helm-charts/splunk-otel-collector/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ spec:
- /otelcol
- --config=/conf/relay.yaml
{{- end }}
{{- if .Values.agent.featureGates }}
- --feature-gates={{ .Values.agent.featureGates }}
{{- end }}
ports:
{{- range $key, $port := $agent.ports }}
{{- if eq true (and (eq (include "splunk-otel-collector.metricsEnabled" $) "true") (has "metrics" $port.enabled_for)) (and (eq (include "splunk-otel-collector.o11yTracesEnabled" $) "true") (has "traces" $port.enabled_for)) (and (eq (include "splunk-otel-collector.logsEnabled" $) "true") (has "logs" $port.enabled_for)) (and (eq (include "splunk-otel-collector.profilingEnabled" $) "true") (has "profiling" $port.enabled_for)) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ spec:
- --config=/conf/relay.yaml
{{- end }}
{{- end }}
{{- if .Values.clusterReceiver.featureGates }}
- --feature-gates={{ .Values.clusterReceiver.featureGates }}
{{- end }}
image: {{ template "splunk-otel-collector.image.otelcol" . }}
imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }}
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ spec:
- /otelcol
- --config=/conf/relay.yaml
{{- end }}
{{- if .Values.gateway.featureGates }}
- --feature-gates={{ .Values.gateway.featureGates }}
{{- end }}
image: {{ template "splunk-otel-collector.image.otelcol" . }}
imagePullPolicy: {{ .Values.image.otelcol.pullPolicy }}
env:
Expand Down
9 changes: 9 additions & 0 deletions helm-charts/splunk-otel-collector/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,9 @@
"type": "object"
}
},
"featureGates": {
"type": "string"
},
"config": {
"type": "object"
}
Expand Down Expand Up @@ -639,6 +642,9 @@
"type": "object"
}
},
"featureGates": {
"type": "string"
},
"config": {
"type": "object"
}
Expand Down Expand Up @@ -1172,6 +1178,9 @@
"type": "object"
}
},
"featureGates": {
"type": "string"
},
"config": {
"type": "object"
}
Expand Down
9 changes: 9 additions & 0 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ agent:
extraVolumes: []
extraVolumeMounts: []

# Enable or disable features of the agent.
featureGates: ""

# OpenTelemetry Collector configuration for otel-agent daemonset can be overriden in this field.
# Default configuration defined in templates/config/_otel-agent.tpl
# Any additional fields will be merged into the defaults,
Expand Down Expand Up @@ -394,6 +397,9 @@ clusterReceiver:
extraVolumes: []
extraVolumeMounts: []

# Enable or disable features of the cluster receiver.
featureGates: ""

# OpenTelemetry Collector configuration for K8s Cluster Receiver deployment can be overriden in this field.
# Default configuration defined in templates/config/_otel-k8s-cluster-receiver-config.tpl
# Any additional fields will be merged into the defaults,
Expand Down Expand Up @@ -942,6 +948,9 @@ gateway:
extraVolumes: []
extraVolumeMounts: []

# Enable or disable features of the gateway.
featureGates: ""

# OpenTelemetry Collector configuration for standalone otel-collector deployment can be overriden in this field.
# Default configuration defined in config/otel-collector-config.yaml
# Any additional fields will be merged into the defaults,
Expand Down

0 comments on commit 4541790

Please sign in to comment.