OpenTelemetry Collector Contrib v0.157.0 introduces lambda expressions to OTTL (OpenTelemetry Transformation Language), enabling higher-order collection functions. Eight new functions are included: Filter, MapEach, MapKeys, Any, All, Find, Reduce, and When. These allow inline anonymous functions to be passed directly to generic operations, replacing the need for hardcoded dedicated functions for each use case. Practical examples cover filtering span attributes, normalizing keys to snake_case, checking conditions across collections, extracting single values, aggregating data, and composing functions together (e.g., redacting PII by combining Filter and MapEach). The feature is experimental in v0.157.0 and requires enabling the ottl.functions.enableLambda feature gate.

4m read timeFrom opentelemetry.io
Post cover image
Table of contents
Filtering and transforming collectionsAsking questions about a collectionExtracting a single valueAggregating a collectionInline conditionalsCombining functionsTrying it out
78 Impressions