Skip to content

Add events attributes keyword dynamic template - #7184

Closed
nssuresh2007 wants to merge 3 commits into
opensearch-project:mainfrom
nssuresh2007:add-events-attributes-keyword-dynamic-template
Closed

nssuresh2007 wants to merge 3 commits into
opensearch-project:mainfrom
nssuresh2007:add-events-attributes-keyword-dynamic-template

Conversation

@nssuresh2007

@nssuresh2007 nssuresh2007 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds dynamic template mapping to keyword for attributes object under events and links which are nested.
Currently the pluggable format index does not support text fields within nested. Without this change, any string present within attributes object under events and links would be rejected.

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Add a string_events_attributes dynamic template so string values nested
under events.attributes (events is a nested field, attributes a bare
object) are mapped as keyword with ignore_above 256, matching the
existing resource/scope/span string attribute templates.

Applied to both span standard templates: the composable
index-template/ variant and the legacy top-level V1 variant, which are
loaded for template_type index_template and V1/ES6 respectively.

Signed-off-by: Suresh N S <nssuresh@amazon.com>
Add a string_links_attributes dynamic template, mirroring
string_events_attributes, so string values under links.attributes (links
is a nested field, attributes a bare object) map to keyword with
ignore_above 256.

With this, every nested field in the span standard templates (events and
links, the only two) has its sole open object (.attributes) covered, so
no dynamic string under a nested field falls back to text. Applied to
both the composable index-template/ and legacy top-level V1 variants.

Signed-off-by: Suresh N S <nssuresh@amazon.com>
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 081e683)

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@bharath-techie bharath-techie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The events/links attributes keyword dynamic templates change the span
standard template mappings. Data Prepper only replaces an existing
index template when the bundled version is higher, so bump both the
composable and legacy V1 copies from 1 to 2 so existing clusters pick
up the new mappings.

Signed-off-by: Suresh N S <nssuresh@amazon.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 081e683

@@ -1,5 +1,5 @@
{
"version": 1,
"version": 2,

@dlvenable dlvenable Oct 9, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the version change I think we have two options:

  1. Increment this version as you have; or
  2. Create a new configuration with a -v2 parameter.

If this is potentially breaking we may want to consider the second option. Thoughts @ps48 , @nssuresh2007 , @vamsimanohar ?

@KarstenSchnitter KarstenSchnitter left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change might be breaking for users, that already defined a different dynamic mapping or use span or link attributes with a different type. I think the same dynamic mapping as for the other attributes should be used to keep the type (long, double, keyword). This might still be considered a breaking change albeit with a much reduced conflict probability. I commented in #7188 that this addition could be provided as a component template without introducing a new index version.

Please also note, that span events are deprecated as of March 17, 2026: https://opentelemetry.io/blog/2026/deprecating-span-events/

@nssuresh2007

Copy link
Copy Markdown
Contributor Author

Closing this PR as this would be breaking change for existing customers and not proceeding with this approach

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.

5 participants