use of io.opentelemetry.sdk.metrics.data.DoubleExemplarData in project opentelemetry-java by open-telemetry.
the class ExemplarMarshaler method create.
private static ExemplarMarshaler create(ExemplarData exemplar) {
KeyValueMarshaler[] attributeMarshalers = KeyValueMarshaler.createRepeated(exemplar.getFilteredAttributes());
ProtoFieldInfo valueField;
if (exemplar instanceof LongExemplarData) {
valueField = io.opentelemetry.proto.metrics.v1.internal.Exemplar.AS_INT;
} else {
assert exemplar instanceof DoubleExemplarData;
valueField = io.opentelemetry.proto.metrics.v1.internal.Exemplar.AS_DOUBLE;
}
return new ExemplarMarshaler(exemplar.getEpochNanos(), exemplar, valueField, exemplar.getSpanContext(), attributeMarshalers);
}
Aggregations