-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Update [email protected] with new GenAI fields #129122
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
Merged
eyalkoren
merged 7 commits into
elastic:main
from
eyalkoren:support-double-EcsDynamicTemplatesIT
Jun 16, 2025
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
852d2b8
Update [email protected] with new GenAI fields
eyalkoren 2cc5df4
Update docs/changelog/129122.yaml
eyalkoren d807638
Merge remote-tracking branch 'upstream/main' into support-double-EcsD…
eyalkoren 72cec7c
Update gen_ai string field mappings
eyalkoren 1fb9af6
Merge branch 'main' into support-double-EcsDynamicTemplatesIT
eyalkoren 851568f
Merge branch 'main' into support-double-EcsDynamicTemplatesIT
eyalkoren 8db3da8
Merge branch 'main' into support-double-EcsDynamicTemplatesIT
eyalkoren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 129122 | ||
| summary: Update [email protected] with new GenAI fields | ||
| area: Data streams | ||
| type: feature | ||
| issues: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit weird indeed. Using
textfor metric dimensions is quite unusual. Especially since TSDB doesn't supporttextfields as dimensions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@susan-shu-c this PR is a followup for elastic/ecs#2475 - it updates our ECS dynamic templates (
ecs@mappings) to include the newgen_ai.*fields.Can you explain the rationale of using
textfor these two?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eyalkoren thanks for catching this. Looking through it, I do agree
keywordwould be better forgen_ai.request.model. I missed it earlier...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the next steps?
Should I make an update on top of elastic/ecs#2475 with a new PR before you can update this PR?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought process on
gen_ai.agent.descriptionbeing text is that it might be 1-2 sentences depending on how verbose it is, say describing a lot of components. Would love to hear what you think as well as your team would be much more aware of best practices!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would make more sense if you change it first and we won't have to merge an "erroneous" state of the mappings. Please let me know how long you expect it to get approved and merged though, because until then we have failing test notifications, so if it's going to take a while, we may prefer merging as is and then fixing. Our change should be very quick.
My thinking was similar to yours, but what @felixbarny says is that if
gen_ai.agent.descriptionis used as metic dimensions, it probably shouldn't betext, because it won't work as expected in TSDB. I see that this field has a semantic conventions counterpart, so the definition there may indicate what it's used for. Its description in your PR says: "Free-form description of the GenAI agent provided by the application", which doesn't sound like something intended to be used as dimension. @felixbarny WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it again, there's a dedicated version of the dynamic ECS mappings for TSDB, incorporating the limited field types available:
ecs-tsdb@template. So maybe it's not as big of a deal, even if this field is used as a metric attribute. But is it really used as a metric attribute or is it something that would rather be attached to other signals, such as logs and traces? A free-form description does sound a bit curious to add as a metric attribute (aka dimension).The
textfield type is useful for full-text search use cases where phrase queries are used a lot. It's powerful but also rather expensive from a storage and indexing perspective. Irrespective of the length of the field, I'd only use it if you have concrete use cases for doing a full-text searches on it. If you just want to store the value to provide additional context, I'd recommend thekeywordfield type. While it has a limit on how many characters it can store indoc_valuesit falls back to storing the value in a stored field ifignore_aboveis set, which seems like a good compromise here. You could potentially disabledoc_valuesand enablestore, however, you wouldn't be able to benefit from the dictionary encoding (ordinals) and other optimizations, like run-length encoding for shorter descriptions. Also, if you don't intend to filter on that field (with an exact value), you may want to setindextofalseto save space and ingest time overhead.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for the OTel field is here, it's of their type "string" so we have to decide ourselves what's best in ECS. I ported the same definition "Free-form description of the GenAI agent provided by the application."
I've created a new PR, could you check if this covers what you mentioned about
ignore_above?elastic/ecs#2489