[ElasticAPM] Alternative to "enabled_environments" with ruby apm agent

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text :slight_smile:

TIP 1: select at least one tag that further categorizes your topic. For example server for APM Server related questions, java for questions regarding the Elastic APM Java agent, or ui for questions about the APM App within Kibana.

TIP 2: Check out the troubleshooting guide first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

Kibana version: 7.12.0

Elasticsearch version: 7.12.0

APM Server version: 7.12.0

APM Agent language and version: ruby (rails) / 4.0.0

Browser version: Chrome (windows 10) 90.0.4430.85 (Build oficial) (64 bits)

Original install method (e.g. download page, yum, deb, from source, etc.) and version: Elastic Cloud (deployed in azure)

Fresh install or upgraded from other version?: Fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

no

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Good afternoon. I would like to know if you can tell me which alternative I should use to modify in my "config/elastic_apm.yml" file the line "enabled_environments". My goal is to have the apm agent send tracking information in the local development environment, but I saw that "enabled_environments" was marked as deprecated in version 2.0.0 of the ruby apm agent. If you could kindly let me know, I would appreciate it, or if you could provide me with a url where I can check future alternatives to deprecated features, it would be a great help. Thank you very much

Steps to reproduce:
1.
2.
3.

Errors in browser console (if relevant): no

Provide logs and/or server output (if relevant): no

Hi there! The agent supports Erb in the config file, so in config/elastic_apm.yml you can do something like:

disable_send: <%= !Rails.env.production? %>

This will let the agent do everything that it does up until the point of actually sending things to APM Server.

ok, thank you !

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