# Span#setLabel(String, Number) doesn't work

**URL:** <https://discuss.elastic.co/t/span-setlabel-string-number-doesnt-work/263283>\
**Category:** APM\
**Tags:** java\
**Created:** [February 4, 2021, 6:33pm UTC](https://discuss.elastic.co/t/span-setlabel-string-number-doesnt-work/263283 "2021-02-04T18:33:10Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [February 5, 2021, 3:39pm UTC](https://discuss.elastic.co/t/span-setlabel-string-number-doesnt-work/263283/7 "2021-02-05T15:39:08Z")

</div>

No, there is no way to change that through Java code currently.

With 0.02 it means that you will get traces for 2% of your requests, which can be low depending on your usual transaction rate. With your local setup you should use 1.0 instead and check again.

We already had [discussions about this in the past](https://discuss.elastic.co/t/control-sample-rate-or-recorded-flag-per-request/177145), and one of the issues is that it's hard to do that with distributed tracing, as we need to keep the sampled traces consistent across all services.

---

_[View the full topic](https://discuss.elastic.co/t/span-setlabel-string-number-doesnt-work/263283)._
