[Playground] OTLP-Mapper - instana to otlp span mapper#2534
[Playground] OTLP-Mapper - instana to otlp span mapper#2534abhilash-sivan wants to merge 75 commits into
Conversation
4490ab0 to
f1c0d6f
Compare
53e1fcc to
d261bc5
Compare
| 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
There was a problem hiding this comment.
Should we do this here or just after the current BE transformation,
https://github.com/instana/nodejs/pull/2534/changes?utm_source=chatgpt.com#diff-462ace70d7ac6eb4cd6f82756059c88629bfad1463fde0498d89106d7ccc8104L193
Right now we’re applying the transformation after collecting all spans. IMO it would be cleaner to do it before calling transmitSpans, so the transmit layer only deals with already-transformed spans.
TBD
There was a problem hiding this comment.
Yeah, I agree. This would be a more cleaner way
// Transform internal span data format into external (backend) readable format.
span = applySpanTransformation(span);
Just after this transformation, we can call the Otel transformation.
There was a problem hiding this comment.
One thing we have to consider is that currently all the spans intended for transmission — i.e., the array of spans — are converted together. If we do it in the above-mentioned area, we will have to process the spans individually.
There was a problem hiding this comment.
Note: TBD — Transform each span to OTLP format immediately in addSpan and store them in OTLP format in the buffer if batching is enabled. This would require changes to the batching logic.
There was a problem hiding this comment.
How do you want to organize the agent ports etc?
OTLP mode is on -> port will change.
There is something missing.
There was a problem hiding this comment.
Also:
How can we skip the agent announcement cycle when connecting to an otel collector later?
Did you draw that path as well to confirm the architecture?
There was a problem hiding this comment.
No, I haven’t worked much on the architecture yet. I can work on the dynamic port connections part, and I’ll also think through the agent announcement cycle and how we can skip it when connecting to an OTel collector
This needs to be communicated in the next WG. Traces & Metrics mapping is required. |
08a2757 to
e827e9c
Compare
e827e9c to
d6c01a6
Compare
| convertSpanKind, | ||
| SpanKind | ||
| } = require('./id-converters'); | ||
| const { MAPPINGS } = require('../mappers'); |
There was a problem hiding this comment.
I'd suggest to load the mappings once before the steps start and provide the mappings via dependency injection to the generic modules.
const mappings = getMappings()
// steps
// meta(mappings)
// etc|
|
||
| // Database spans | ||
| if ( | ||
| ['pg', 'mysql', 'mssql', 'mongo', 'redis', 'couchbase', 'elasticsearch', 'dynamodb', 'db2', 'memcached'].includes( |
There was a problem hiding this comment.
This is not needed.
If you know the type e.g. pg (instana).
You know the otlp target mapping and you know its in db group.
| @@ -0,0 +1,145 @@ | |||
| /* | |||
There was a problem hiding this comment.
This is the future design in my mind now
└── converters/
└── otlp/
├── index.js ← Entry point (exports transform())
├── converter.js ← Core conversion logic
├── constants.js ← Metric types, aggregation types
├── util.js ← Helper functions
├── transformers/
│ ├── index.js
│ ├── resourceAttributes.js ← Service name, SDK info, host, PID
│ └── metricData.js ← Metric value transformation
└── mappers/
└── metricAttributes.js
Share your thoughts 💭
Summary
Introduces the Instana-to-OTLP converter playground.
4318/v1/traces).Not Included
TODO
e2e Testing @abhilash-sivan
results note: https://ibm.box.com/s/0v5wli0pgvrlg8jqpkhi59mb52o28u75
Special cases
Validation
Before merging, verify:
4318/v1/traces).Future Enhancements
/v1/logsendpoint.Refrences
https://opentelemetry.io/blog/2023/http-conventions-declared-stable/