I'm using java agent 1.42.0 and OTel API 1.32.0.
ECS, as well as the OTel schema, define metadata like destination.address, destination,port, etc. I've created a custom span to track backend calls using the unsupported UnboundId LDAP library and would like to set address and port, as well as a few other values.
My code looks like this:
Span span = GlobalOpenTelemetry.getTracer("").spanBuilder(this.getClass().getName() + "#send").setSpanKind(SpanKind.CLIENT).startSpan();
span.setAttribute(addressKey, Arrays.toString(getConnector().getConnectionInfo().getServerAddresses()));
span.setAttribute(portKey, Arrays.toString(getConnector().getConnectionInfo().getServerPorts()));
span.setAttribute(typeKey, "external");
span.setAttribute(subtypeKey, "ldap");
try {
...
} finally {
span.end();
}
The keys are static variables of type AttributeKey with strings like "destination.address" etc.
These values show up as labels like "labels.destination_address" but I would like them to not be labels and instead be more like "destination.address" that I see in the OOTB spans.
I suspect this might also have something to do with why this exit call doesn't show in my dependencies list.
thanks