Skip to content

Improve OTel bridge mapping of newer semcon for databases - #2768

Merged
stevejgordon merged 3 commits into
mainfrom
mongodb-bridge
Jun 11, 2026
Merged

stevejgordon merged 3 commits into
mainfrom
mongodb-bridge

Conversation

@stevejgordon

Copy link
Copy Markdown
Contributor

Updates the OTel bridge to handle newer semantic conventions, ensuring these map to required ECS fields on the spans that drive the Kibana UI (service map and dependencies).

@stevejgordon
stevejgordon requested a review from Copilot June 11, 2026 08:22
@github-actions

Copy link
Copy Markdown

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the OpenTelemetry bridge’s database span mapping to support newer OTel semantic conventions and ensure the resulting spans populate the ECS fields used by Kibana (service map/dependencies).

Changes:

  • Add support for newer DB attributes (db.system.name, db.namespace, db.query.text) while preserving compatibility with legacy keys (db.system, db.name, db.statement).
  • Improve destination mapping by recognizing stable network attributes (network.peer.address, network.peer.port) and correctly handling numeric port tag types.
  • Normalize azure.cosmosdb to cosmosdb for ECS-mapped fields, while keeping the raw OTel attribute value in otel.attributes, and add comprehensive regression tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/opentelemetry/Elastic.Apm.OpenTelemetry.Tests/OTelDbSpanTests.cs New end-to-end tests covering old/new DB semconv mappings, destination resolution, action normalization, and Cosmos DB subtype normalization.
test/opentelemetry/Elastic.Apm.OpenTelemetry.Tests/OpenTelemetryTests.cs Strengthens an existing span-kind test to assert DB context mapping is populated.
src/Elastic.Apm/OpenTelemetry/SemanticConventions.cs Adds constants for newer DB and stable network semantic convention keys.
src/Elastic.Apm/OpenTelemetry/OTelActivityMapper.cs Implements the new DB attribute mapping logic, destination attribute fallbacks, and Cosmos DB subtype normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stevejgordon
stevejgordon requested a review from a team June 11, 2026 10:51
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.

3 participants