The Prometheus scraper supports native histograms with custom buckets, see https://prometheus.io/docs/specs/native_histograms/#custom-values.
This should work with client_java, but we haven't tried it.
We should try it, and also create a test to make sure we don't break it in the future.