Skip to content

feat: inject OTTL statements from elasticapm connector to lsmintervaltree processor#1138

Merged
lahsivjar merged 5 commits intomainfrom
elasticapmconnector/custom-statements
Apr 10, 2026
Merged

feat: inject OTTL statements from elasticapm connector to lsmintervaltree processor#1138
lahsivjar merged 5 commits intomainfrom
elasticapmconnector/custom-statements

Conversation

@inge4pres
Copy link
Copy Markdown
Contributor

Reason for this PR

Some data manipulations that are necessary in the elasticapm connector can be achieved with OTTL transforms, especially now that an upstream feature in OTTL to read from context is merged and released
open-telemetry/opentelemetry-collector-contrib#41879

Details

  • Create a new field Statements that is part of the elasticapm connector config to allow forwarding OTTL statements to downstream components
  • append the statements to existing ones
  • propagate execution to lsmintervaltree processor

@inge4pres inge4pres requested review from a team as code owners April 1, 2026 16:07
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8618ff13-4961-4d0a-896d-9b7e70d10457

📥 Commits

Reviewing files that changed from the base of the PR and between 2759cf4 and 965d2a9.

📒 Files selected for processing (3)
  • connector/elasticapmconnector/config.go
  • connector/elasticapmconnector/connector_test.go
  • processor/lsmintervalprocessor/processor.go
✅ Files skipped from review due to trivial changes (1)
  • processor/lsmintervalprocessor/processor.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • connector/elasticapmconnector/connector_test.go
  • connector/elasticapmconnector/config.go

📝 Walkthrough

Walkthrough

This change extends the Elastic APM connector to support injecting custom OTTL statements into per-interval metric processing. The AggregationConfig struct gains a Statements field to specify additional rules. The processor's metadata handling was refactored to create per-iteration contexts, enabling OTTL statements to access otelcol.client.metadata during execution. A new test validates that OTTL statements can conditionally rewrite metric attributes based on client metadata values.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch elasticapmconnector/custom-statements
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@inge4pres inge4pres marked this pull request as draft April 1, 2026 22:25
inge4pres and others added 5 commits April 10, 2026 19:43
…tree processor

Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
@lahsivjar lahsivjar force-pushed the elasticapmconnector/custom-statements branch from 1afb112 to 965d2a9 Compare April 10, 2026 18:56
@lahsivjar lahsivjar marked this pull request as ready for review April 10, 2026 18:56
@lahsivjar lahsivjar enabled auto-merge (squash) April 10, 2026 19:01
@lahsivjar lahsivjar merged commit 0e44f5d into main Apr 10, 2026
17 of 18 checks passed
@lahsivjar lahsivjar deleted the elasticapmconnector/custom-statements branch April 10, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants