I am working on a costum java otel agent. In it, I am adding some costum values to a Span like so
public void onStart(Context parentContext, ReadWriteSpan readWriteSpan) {
double logCPUDemand = RESOURCE_DEMAND_DATA_COLLECTOR.getCurrentThreadCpuTime());
readWriteSpan.setAttribute(Constants.SPAN_ATTRIBUTE_START_CPU_TIME, logCPUDemand);
}
This works fine for the Span, but I would like to convert some (for example the logCPUDemand value) in my Otel-collector from a Span attribute to a metric.
There is already a costum connector that converts Request, Error and Duration values from Spans into metrics
I am looking for a way to translate the values (i know their names) in the otel collector.
I am open for other approaches as well.
Apperently you can write your own processor, but that is not what im looking for.