Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Custom OTTL with OpenTelemetry-based Telemetry Pipelines #1520

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bcdd383
ADR for custom OTTL with OTel based telemetry pipelines
hisarbalik Oct 14, 2024
536a79d
Merge branch 'main' into ottl-adr
hisarbalik Oct 14, 2024
44f7664
Merge branch 'main' into ottl-adr
hisarbalik Oct 23, 2024
504535c
Merge branch 'ottl-adr' of github.com:hisarbalik/telemetry-manager in…
hisarbalik Oct 23, 2024
3107705
Apply suggestions from code review
hisarbalik Oct 24, 2024
d8568e0
Merge branch 'main' into ottl-adr
hisarbalik Oct 24, 2024
df46ade
Merge branch 'main' into ottl-adr
hisarbalik Oct 25, 2024
c8dd196
updated
hisarbalik Oct 29, 2024
19f045d
updated
hisarbalik Oct 29, 2024
8622a0a
updated
hisarbalik Oct 29, 2024
fb7c72b
Merge branch 'main' into ottl-adr
hisarbalik Oct 29, 2024
9c4e334
updated
hisarbalik Oct 29, 2024
06e4322
updated
hisarbalik Oct 29, 2024
1cc54ad
updated
hisarbalik Oct 29, 2024
4ff1488
fix some typos
hisarbalik Oct 29, 2024
ea9c1c6
Merge branch 'main' into ottl-adr
k15r Oct 29, 2024
c7fdd7c
Update docs/contributor/arch/016-transform-filter-support-for-telemet…
hisarbalik Oct 30, 2024
454b097
update
hisarbalik Oct 31, 2024
86f08fc
Merge branch 'main' into ottl-adr
skhalash Oct 31, 2024
62d1ce4
Update docs/contributor/arch/016-transform-filter-support-for-telemet…
hisarbalik Nov 4, 2024
c3c163f
Merge branch 'main' into ottl-adr
hisarbalik Nov 4, 2024
0a2bdd3
Merge branch 'main' into ottl-adr
hisarbalik Nov 4, 2024
44a8771
Update docs/contributor/arch/016-transform-filter-support-for-telemet…
hisarbalik Nov 6, 2024
7a67c47
Merge branch 'main' into ottl-adr
hisarbalik Nov 6, 2024
3fe9123
Update docs/contributor/arch/016-transform-filter-support-for-telemet…
hisarbalik Nov 6, 2024
32eb2e0
Merge branch 'main' into ottl-adr
hisarbalik Nov 6, 2024
255d441
Apply suggestions from code review
hisarbalik Nov 6, 2024
9c51a88
updated
hisarbalik Nov 6, 2024
ab0045e
Merge branch 'main' into ottl-adr
hisarbalik Nov 6, 2024
2944204
Merge branch 'main' into ottl-adr
hisarbalik Nov 7, 2024
1a40f32
Merge branch 'main' into ottl-adr
hisarbalik Nov 7, 2024
1e2cdd4
Merge branch 'main' into ottl-adr
hisarbalik Nov 7, 2024
b748f17
Merge branch 'main' into ottl-adr
k15r Nov 8, 2024
6961d61
Merge branch 'main' into ottl-adr
k15r Nov 11, 2024
654b799
Merge branch 'main' into ottl-adr
hisarbalik Nov 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 15. Transform and Filter support for OpenTelemetry based Pipelines

Date: 2024-10-10

## Status

Proposed

## Context

In the default setup of Metric and Trace Pipelines, users currently lack the ability to filter or transform/enrich data before it is sent to the backend. To provide more flexibility, users should be able to filter data based on specific conditions and apply transformations or enrichment to the data. This solution must ensure a consistent approach across all OpenTelemetry (OTel) pipelines.
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved

## Decision

We will implement a consolidated solution in the OpenTelemetry Collector (OTel Collector) using a single Filter and Transform Processor. This processor will leverage the OpenTelemetry Transformation and Transport Language (OTTL) to handle both filtering and transformation tasks. The processor will be configurable to meet user requirements, and only a subset of OTTL functions will be supported, focusing on the most common and impactful use cases.
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved

Example configuration Metric Pipeline:
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved

```yaml
apiVersion: telemetry.kyma-project.io/v1alpha1
kind: MetricPipeline
metadata:
name: metricpipeline-sample
spec:
transform:
- context: datapoint
conditions:
- type == METRIC_DATA_TYPE_SUM
statements:
- set(description, "Sum")
filter:
metric:
- type == METRIC_DATA_TYPE_NONE
datapoint:
- metric.name == "k8s.pod.phase" and value_int == 4
input:
istio:
enabled: true
prometheus:
enabled: false
output:
otlp:
endpoint:
value: ingest-otlp.services.sap.hana.ondemand.com:443
```

Example configuration Trace Pipeline:
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved

```yaml
apiVersion: telemetry.kyma-project.io/v1alpha1
kind: TracePipeline
metadata:
name: tracepipeline-sample
spec:
transform:
- context: resource
statements:
- set(status.code, 1) where attributes["http.path"] == "/health"
filter:
span:
- IsMatch(resource.attributes["k8s.pod.name"], "my-pod-name.*")
output:
otlp:
endpoint:
value: ingest-otlp.services.sap.hana.ondemand.com:443
protocol: grpc
```
### Solution

The OTTL library offers functions to validate, filter, and transform data by parsing and executing expressions. To ensure robustness and stability, we will limit the available filter and transform functions to a carefully selected subset.
This subset will be curated based on common use cases, ensuring essential functionality without overcomplicating the configuration process.

### Risk

The OTTL library is still in its alpha phase, meaning that updates to the package may introduce breaking changes, including syntax and semantic updates or bugs. This poses a risk of disrupting running pipelines.

### Mitigation

To mitigate this risk:
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved
- Thorough Testing: We will maintain strict version control of the OTTL library, ensuring that each update is thoroughly tested, automated tests will validate that existing pipelines continue to work as expected.
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved
- Documentation: We will provide detailed documentation and practical examples of how to configure filter and transformation processors using OTTL expressions.
- New Versions with Breaking Changes: New versions with breaking changes of the OTTL library will be rolled out with backward compatibility. This will help users adapt changes and reducing the chance of widespread disruption.
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved

### Open Questions
- How will complex transformation chains be handled efficiently?
hisarbalik marked this conversation as resolved.
Show resolved Hide resolved
- What are the specific failure modes if users misconfigure OTTL processors?
- What are the best practices for ensuring backward compatibility when updating OTTL versions?

Loading