client_java
client_java copied to clipboard
Add Exemplar.toString
Useful for example, in test assertions, see https://github.com/open-telemetry/opentelemetry-java/pull/3353/files#diff-10589ce2b6c8942193e382b96c566ac748a995454f2d7527b2bb7e762cd520f1R422
@fstab
/cc @jseureth
Thanks for the PR. It would be useful to produce the same format as TextFormat.writeOpenMetrics100(), so that the toString() representation doesn't differ from the OpenMetrics format. What do you think?
Thanks @fstab - I took a look in but it seems quite difficult since TextFormat has some fairly complicated private methods such as omWriteTimestamp. Not to mention that TextFormat is not in simpleclient. So it's an interesting idea but I think unless we were to move at least some TextFormat logic into simpleclient it doesn't seem practical, it's essentially a circular dependency. I suppose conceptually speaking, simpleclient is protocol-agnostic, so expecting toString to follow a protocol is probably not practical.