chore: instana-otlp span mapper#2534
chore: instana-otlp span mapper#2534abhilash-sivan wants to merge 9 commits intochore-otlp-playgroundfrom
Conversation
4490ab0 to
f1c0d6f
Compare
53e1fcc to
d261bc5
Compare
| // console.log(JSON.stringify(otlpFormat)); | ||
|
|
||
| const payloadAsString = JSON.stringify(otlpFormat, circularReferenceRemover()); | ||
| const payloadAsString = JSON.stringify(data, circularReferenceRemover()); |
There was a problem hiding this comment.
Doing the conversion from spanBuffer
| * @param {import('../../core').InstanaBaseSpan} span | ||
| * @returns {import('../../core').InstanaBaseSpan} The transformed span. | ||
| */ | ||
| module.exports.transform = span => { |
There was a problem hiding this comment.
the same transform logic, like we already do for instana internal format to backend compatible conversion
| 'use strict'; | ||
|
|
||
| // Gespeicherte Resource-Informationen für Metrics (wenn kein "from" Feld vorhanden) | ||
| const { getOtlpAttributeMappings } = require('./backend_mappers/otlpMapper'); |
There was a problem hiding this comment.
moved the file to core
|
|
||
| const otlpKey = sectionMappings[field] || `${dataKey}.${field}`; | ||
|
|
||
| // Determine value type and format |
There was a problem hiding this comment.
This attribute addition is optional
| if (normalized.length > 32) { | ||
| return normalized.slice(-32); | ||
| } | ||
| return normalized.padStart(32, '0'); |
There was a problem hiding this comment.
prepending with 0s due to the length mismatch for traceId.
We currently use 16, but otel uses 32
| spans = []; | ||
| batchingBuckets.clear(); | ||
|
|
||
| const processedSpans = |
There was a problem hiding this comment.
This is where the conversion is happening.
This seems to be the optimal place because if we convert early, then in some places we talk Instana format and it could raise unexpected issues. So before transmission seems simple and maintanable
UI: https://instana.io/s/B2R0pfHbSpaV5jXmQNDd7w
This is just a playground where we convert Instana spans to Otel spans and send them to the Otel backend.
INSTANA_OTLP_FORMAT=true SERVICE_NAME=test-nodejs-service INSTANA_DEBUG=true node index.js