OTLP Exporter#
| Description | OTLP Exporter publishes EDA metrics to an OpenTelemetry receiver. |
| Author | Nokia |
| Supported OS | N/A |
| Catalog | nokia-eda/catalog |
| Language | Go |
Overview#
The OTLP Exporter app converts EDA state into OpenTelemetry metrics and sends them to one or more OTLP receivers.
It exposes four resources:
Receiver: namespace-scoped OTLP receiver (destination for OpenTelemetry metrics).MetricExport: namespace-scoped export definition that references one or moreReceiverobjects.ClusterReceiver: cluster-scoped OTLP destination created in the EDA base namespace.ClusterMetricExport: cluster-scoped export definition created in the EDA base namespace.
The app supports both OTLP/HTTP and OTLP/gRPC receivers, optional authorization headers, and TLS options. It also raises an EDA alarm if a configured receiver becomes unreachable.
Installation#
Install the app from EDA Store or with kubectl:
Configuration#
The setup consists of two steps:
- Create a
ReceiverorClusterReceiverresource that defines where metrics should be sent. - Create a
MetricExportorClusterMetricExportresource that defines what to export and which receivers to use.
Namespace behavior
Receiver and MetricExport resources must be created outside the EDA base namespace. ClusterReceiver and ClusterMetricExport resources must be created in the EDA base namespace.
ClusterReceiver and Receiver Resources#
A receiver defines the OTLP destination and transport settings.
Important fields:
endpoint: receiver URL or host endpoint.protocol:httporgrpc.authorization: optional authorization type and credentials.writeOptions.flushInterval: how often buffered metrics are flushed.writeOptions.bufferSize: local buffer threshold.writeOptions.maxMetricsPerExport: maximum metrics per export request.writeOptions.timeout: export timeout.writeOptions.retries: retry behavior.tls: optional TLS configuration from files, a secret, or a trust bundle.
The controller updates the receiver status with reachability information:
status.reachablestatus.errorstatus.lastChecked
Example namespace-scoped Receiver:
apiVersion: otlp.eda.nokia.com/v1alpha1
kind: Receiver
metadata:
name: receiver1
namespace: eda
spec:
endpoint: http://otel-collector.example.com:4318/v1/metrics
protocol: http
authorization:
type: Bearer
credentials: ""
writeOptions:
bufferSize: 1000
compression: gzip
flushInterval: 10s
maxMetricsPerExport: 500
retries:
initialInterval: 1s
maxElapsedTime: 100s
maxInterval: 60s
timeout: 10s
headers: []
cat << 'EOF' | kubectl apply -f -
apiVersion: otlp.eda.nokia.com/v1alpha1
kind: Receiver
metadata:
name: receiver1
namespace: eda
spec:
endpoint: http://otel-collector.example.com:4318/v1/metrics
protocol: http
authorization:
type: Bearer
credentials: ""
writeOptions:
bufferSize: 1000
compression: gzip
flushInterval: 10s
maxMetricsPerExport: 500
retries:
initialInterval: 1s
maxElapsedTime: 100s
maxInterval: 60s
timeout: 10s
headers: []
EOF
Receiver Validation#
The receiver admission webhooks enforce several important rules:
flushIntervalmust be at least1s.timeoutmust be at least1s.- If
tls.fromFiles.certFileis set,tls.fromFiles.keyFilemust also be set, and vice versa. - If
tls.fromFiles.skipVerifyisfalse,tls.fromFiles.caFilemust be provided.
If skipVerify is true and a CA file is also set, the webhook accepts the resource but returns a warning that the CA file will not be used.
ClusterMetricExport and MetricExport Resources#
A MetricExport or ClusterMetricExport defines which data becomes metrics and where those metrics are sent.
Each entry under spec.exports can export metrics from either:
- a state DB path in
path, or - a custom resource source in
resource
If path is omitted, resource.group, resource.version, and resource.kind must be provided.
Important fields:
path: EDA state path to watch.fields: fields to export and whether each should be aGaugeorSum.where: optional filter expression.mode:on-change,periodic, orperiodic-on-change.interval: polling interval for periodic modes.metricName.regexandmetricName.replacement: optional metric renaming.attributes.static: add fixed attributes to every metric.attributes.dynamic: derive attributes from another state path and field.mappings: map source values such asenable/disableto numeric values.receivers: one or more receiver names.
For namespace-scoped MetricExport resources, the controller automatically rewrites .namespace... paths so they stay inside the export namespace.
Example namespace-scoped MetricExport:
apiVersion: otlp.eda.nokia.com/v1alpha1
kind: MetricExport
metadata:
name: metricexport1
namespace: eda
spec:
exports:
- path: .namespace.node{.name=="leaf-1"}.srl.interface{.name=="mgmt0"}.statistics
fields:
- name: out-octets
type: Gauge
interval: 10s
mode: periodic
metricName:
regex: out_octets
replacement: interface_out_octets
resource: {}
attributes:
static:
- name: exporter
value: eda
mappings: []
receivers:
- receiver1
cat << 'EOF' | kubectl apply -f -
apiVersion: otlp.eda.nokia.com/v1alpha1
kind: MetricExport
metadata:
name: metricexport1
namespace: eda
spec:
exports:
- path: .namespace.node{.name=="leaf-1"}.srl.interface{.name=="mgmt0"}.statistics
fields:
- name: out-octets
type: Gauge
interval: 10s
mode: periodic
metricName:
regex: out_octets
replacement: interface_out_octets
resource: {}
attributes:
static:
- name: exporter
value: eda
mappings: []
receivers:
- receiver1
EOF
Export Modes#
The exporter supports three collection modes:
on-change: export when matching data changes.periodic: poll and export at the configuredinterval.periodic-on-change: combine both behaviors.
For the periodic and periodic-on-changemodes, the webhook requires an interval of at least 1s.
Value Mapping And Attributes#
Metric values must become numeric before they can be sent as OTLP metrics.
Use mappings when the source value is text, for example:
enable -> 1disable -> 0
You can also enrich exported metrics with:
- static attributes from
attributes.static - dynamic attributes from
attributes.dynamic - CR-derived metadata when using
resource
Receiver Alarm#
The app raises an EDA alarm when it cannot connect to a configured OTLP receiver.
Alarm details:
- Alarm type:
OpenTelemetryReceiverConnectionFailed - Severity:
major - Resource: receiver name
- Group/kind:
ReceiverorClusterReceiver, depending on the failing resource
The alarm description indicates that the OpenTelemetry receiver is unreachable or that the receiver resource is misconfigured.
Typical causes:
- receiver endpoint is wrong
- OTLP service is down or unreachable
- TLS settings are invalid
- authorization or custom headers are incorrect
The alarm is automatically cleared when the receiver becomes reachable again.
Cluster-Scoped Resources#
Use the ClusterReceiver and ClusterMetricExport resources when you want centralized exports from the EDA base namespace.
The field model is the same as the namespace-scoped resources, but:
ClusterReceivermust exist in the EDA base namespace.ClusterMetricExportreferencesClusterReceivernames.- cluster-scoped exports can watch cross-namespace data.
- resource-backed exports can optionally narrow to a specific namespace with
resource.namespace.
Advanced Configuration#
The app installer exposes a few runtime settings:
otelCPULimit: CPU limit for the controller.otelMemoryLimit: memory limit for the controller.proxyConfigName: config map name used forHTTP_PROXY,HTTPS_PROXY, andNO_PROXY.otelLogLevel: controller log level.
If you need a proxy, create or reuse a config map such as proxy-config in the EDA base namespace with the standard proxy keys.