# Can we enable APM sampling for few boxes

**URL:** <https://discuss.elastic.co/t/can-we-enable-apm-sampling-for-few-boxes/244293>\
**Category:** APM\
**Tags:** java\
**Created:** [August 9, 2020, 8:56am UTC](https://discuss.elastic.co/t/can-we-enable-apm-sampling-for-few-boxes/244293 "2020-08-09T08:56:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manohar\_deepu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manohar_deepu/32/72797_2.png) [@manohar\_deepu](https://discuss.elastic.co/u/manohar_deepu)\
**Post date:** [August 9, 2020, 8:56am UTC](https://discuss.elastic.co/t/can-we-enable-apm-sampling-for-few-boxes/244293/1 "2020-08-09T08:56:10Z")

</div>

Hi,

I have a requirement where I need to enable APM sampling only in some of the boxes of my prod env and rest should be at 0 sampling. As I understand sampling percentage gets pushed to all the APM agents.

Is there a way to achieve my requirement?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [August 10, 2020, 1:05am UTC](https://discuss.elastic.co/t/can-we-enable-apm-sampling-for-few-boxes/244293/2 "2020-08-10T01:05:33Z")

</div>

When it comes to configuring agents through Kibana, you have two controls: service name and environment. As you stated they're all in your prod environment, you can only do this if they're different services (have a different service name).

To create service-specific configurations, visit the [Agent Configuration](https://www.elastic.co/guide/en/kibana/current/agent-configuration.html) page in the APM app, click "Create Configuration" and select the service name and environment you want to configure. Repeat to configure different sampling rates for different services/environments.

If you need greater control than this, then you can always configure the agents manually: [https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-transaction-sample-rate](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-transaction-sample-rate)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 30, 2020, 9:05pm UTC](https://discuss.elastic.co/t/can-we-enable-apm-sampling-for-few-boxes/244293/3 "2020-08-30T21:05:37Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
