Skip to content

[Playground] OTLP-Mapper - instana to otlp span mapper#2534

Draft
abhilash-sivan wants to merge 103 commits into
mainfrom
chore-otel-span-mapper
Draft

[Playground] OTLP-Mapper - instana to otlp span mapper#2534
abhilash-sivan wants to merge 103 commits into
mainfrom
chore-otel-span-mapper

Conversation

@abhilash-sivan

@abhilash-sivan abhilash-sivan commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces the Instana-to-OTLP Converter Playground.

  • Adds support for exporting traces via OTLP (4318/v1/traces).
  • Supports OpenTelemetry Semantic Conventions (SemConv) v1.23.

Out of Scope

  • Metrics export
  • Logs export

TODO

Core Implementation

  • Handle agent port usage (data port vs. connection port) (chore: make agent data port configurable independently from the agent connection port #2559)
  • Support multiple span data keys (e.g., span.data.peer, span.data.mongo)
  • Finalize overall design
  • Implement SemConv lookup handling
  • Implement span name mapping
  • Complete metadata attribute mapping:
  • Direct mappings
  • Computed mappings
  • Research span status mapping
  • Research span name mapping (@abhilash-sivan)
  • Implement OpenTelemetry instrumentation-specific handling
  • Implement log-specific handling
  • Implement resource mapping
  • Implement required metrics mappings
  • Implement agent connection logic
  • Error handling
  • Resource-service name mapping
  • Dual transformation flow in span data @abhilash-sivan
  • Implement configuration option for enabling OTLP export (INSTANA_OTLP_ENABLED?) - NOT PART OF THIS

Span Data Mapping

  • HTTP
  • Kafka
  • Databases
  • Cloud services
  • OpenTelemetry instrumentation

Testing

Unit Tests

  • Single-span scenarios
  • Multi-span scenarios

End-to-End Testing (@abhilash-sivan)

  • SemConv v1.23 validation with the current design
  • SemConv v1.41 compatibility validation
  • OpenTelemetry wrapper instrumentation testing
  • Metadata validation with SemConv v1.23 and span data validation with v1.43
  • without metrics

Performance Testing

  • Performance testing

Special Cases

  • Fix type definitions

Issue Tracking

Validation Checklist

Before merging, verify the following:

  • Traces are successfully exported through the OTLP endpoint (4318/v1/traces).
  • Metrics continue to be exported through the existing endpoint.
  • The UI correctly identifies and displays applications.

Future Enhancements/TODO

  • Support the agent announcement cycle disablement use case.
  • Evaluate exporting logs to the OTLP /v1/logs endpoint.
  • Implement metrics mapping.
  • Refactor the current dual transformation flow in span data (internal mapping and OTLP mapping).

References

@abhilash-sivan abhilash-sivan force-pushed the chore-otel-span-mapper branch from 4490ab0 to f1c0d6f Compare May 4, 2026 18:07
@abhilash-sivan abhilash-sivan changed the base branch from main to chore-otlp-playground May 7, 2026 06:42
@abhilash-sivan abhilash-sivan force-pushed the chore-otel-span-mapper branch from 53e1fcc to d261bc5 Compare May 7, 2026 12:45
Comment thread packages/collector/src/agentConnection.js
Comment thread packages/core/src/tracing/otlp_mapper/mapper.js Outdated
Comment thread packages/core/src/tracing/otlpTransformer.js Outdated
Comment thread packages/core/src/tracing/otlpTransformer.js Outdated
Comment thread packages/core/src/tracing/otlpTransformer.js Outdated
Comment thread packages/core/src/tracing/spanBuffer.js Outdated
@abhilash-sivan abhilash-sivan changed the title Chore otel span mapper chore: instana-otlp span mapper May 7, 2026
@abhilash-sivan abhilash-sivan changed the title chore: instana-otlp span mapper [Playground] OTLP-Mapper - instana to otlp span mapper May 8, 2026
Comment thread packages/collector/src/agentConnection.js Outdated
Comment thread packages/core/src/tracing/backend_mappers/index.js Outdated
Comment thread packages/core/src/tracing/otlp_mapper/mapper.js Outdated
@kirrg001

Copy link
Copy Markdown
Contributor

test: send traces via otlp port and metrics via standard port - Idenfies 2 diff apps 1. Otel and 2. Node.js

This needs to be communicated in the next WG. Traces & Metrics mapping is required.

@abhilash-sivan abhilash-sivan force-pushed the chore-otel-span-mapper branch from 08a2757 to e827e9c Compare May 15, 2026 05:57
@abhilash-sivan abhilash-sivan force-pushed the chore-otel-span-mapper branch from e827e9c to d6c01a6 Compare May 15, 2026 05:58
@@ -0,0 +1,170 @@
# OTLP (OpenTelemetry Protocol) Converter

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.

qs: Why is the OTLP module not part of the tracing folder?

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.

This module handles all telemetry signals- Traces, Metrics, and Logs. Placing it under the tracing folder would unnecessarily couple it to tracing-specific concepts such as spans. Keeping it at the root allows the logic to remain shared and signal-agnostic. It also provides flexibility for future enhancements, such as extending the OTLP implementation to emit additional telemetry signals like logs.

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.

IMO it belongs to core/tracing/exporters

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.

We can discuss this before merging. No big topic

Comment thread packages/core/src/otlp/index.js Outdated
Comment thread packages/core/src/otlp/metrics/index.js Outdated
};

const originFrom = rawSpan.data?.resource || null;
const rKey = resourceFactory.getResourceKey(originFrom);

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.

  const originFrom = rawSpan.data?.resource || null;
 const rKey = resourceFactory.getResourceKey(originFrom);

This looks wrong to me? 🤔

This must be rawSpan.f?

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.

Any instana span has .f - doesn't matter if its coming from ours instrumentations or from otel integration.

Comment thread packages/core/src/otlp/traces/converter.js Outdated
Comment thread packages/core/src/otlp/traces/converter.js Outdated

// 1.23 matches baseline parameters identically. No overrides required.

const LOOKUP_OVERRIDES = {};

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.

// base loopup based on v1.23 with some common mappings as well

Okay I understood the current sem conv structure. So yeah the base mappings are secretly from v1.23.

I'd like to suggest this:

index.js

const VERSIONS = {
  '1.23': require('./v1.23'), // explicit version
  '1.42': require('./v1.42') // explicit version
};

Three folders

  • base/
    • mappings.js
  • v1.23/
    • index.js
    • mappings.js
  • v1.43/
    • index.js
    • mappings.js
  • merge.js

base/mappings.js

module.exports = require('../v1.23/mappings');

v1.23/mappings.js

const MAPPINGS = {
  metadata: {
    TRACE_ID: 'traceId',
...

v1.23/index.js

const { merge } = require('../merge');
const base = require('../base/mappings').MAPPINGS;
const { MAPPINGS } = require('./mappings');

module.exports = merge(base, MAPPINGS);

v1.41/index.js

const { merge } = require('../merge');
const base = require('../base/mappings').MAPPINGS;
const { MAPPINGS } = require('./mappings');

module.exports = merge(base, MAPPINGS);

v1.41/mappings.js

const MAPPINGS = {
  http: {
    REQUEST_METHOD: 'http.request.method',
    RESPONSE_STATUS: 'http.response.status_code',
...

The concept of overrides === merge.

Comment thread packages/core/src/otlp/common/constants.js Outdated
Comment thread packages/core/src/otlp/traces/transformers/index.js
Comment thread packages/core/src/otlp/traces/converter.js
for (let i = 0; i < mapping.instana.length; i++) {
values.push(spanData?.[mapping.instana[i]]);
}
value = mapping.transform ? mapping.transform(spanData, values) : combineFields(values);

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.

Is that right?

combineFields(values)

combineFields takes 2 arguments.

Comment thread packages/core/src/otlp/traces/mappers/spanName.js Outdated
Comment thread packages/core/src/otlp/traces/mappers/helper.js Outdated
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