Skip to content

[exporter/elasticsearchexporter] Add function to encode spans in ECS mapping mode #40807

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
merged 15 commits into from
Jun 27, 2025

Conversation

girodav
Copy link
Contributor

@girodav girodav commented Jun 18, 2025

Description

elasticsearchexporter marks traces as supported when using ECS as the mapping mode. However, no actual SemConv to ECS mapping is implemented for traces.
Instead, the exporter falls back to the generic nonOtelEncoder, which doesn't perform any meaningful mapping. This breaks consumers that expect ECS-compliant data (e.g., Elastic APM).

This PR adds a new encodeSpan function for ecsModeEncoder that follows similar logic to encodeLog.

@girodav girodav changed the title [exporter/elasticsearchexporter] Add function to encode spans in ECS mapping mode WIP [exporter/elasticsearchexporter] Add function to encode spans in ECS mapping mode Jun 19, 2025
@girodav girodav marked this pull request as ready for review June 19, 2025 07:19
@girodav girodav requested a review from a team as a code owner June 19, 2025 07:19
@girodav girodav requested a review from dmitryax June 19, 2025 07:19
@girodav girodav changed the title WIP [exporter/elasticsearchexporter] Add function to encode spans in ECS mapping mode [exporter/elasticsearchexporter] Add function to encode spans in ECS mapping mode Jun 19, 2025
@ChrsMark ChrsMark requested a review from JaredTan95 June 19, 2025 09:41
@ChrsMark
Copy link
Member

ChrsMark commented Jun 19, 2025

/cc @carsonip @lahsivjar @JaredTan95

For some reason I cannot assign @carsonip and @lahsivjar as reviewers 🤔

Copy link
Contributor

@carsonip carsonip left a comment

Choose a reason for hiding this comment

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

thanks! I believe the implementation details need to be ironed out before the PR can proceed

Copy link
Member

@gregkalapos gregkalapos left a comment

Choose a reason for hiding this comment

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

Adding a few things.

@github-actions github-actions bot requested a review from lahsivjar June 24, 2025 07:09
Copy link
Member

@lahsivjar lahsivjar left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@gregkalapos gregkalapos left a comment

Choose a reason for hiding this comment

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

lgtm

@ChrsMark ChrsMark added the ready to merge Code review completed; ready to merge by maintainers label Jun 27, 2025
@ChrsMark ChrsMark dismissed carsonip’s stale review June 27, 2025 14:02

@carsonip is out these days, dismissing his review to unblock this PR

@songy23 songy23 merged commit 75f32f3 into open-telemetry:main Jun 27, 2025
177 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/elasticsearch ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants