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.
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 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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.