Configure Additional APM Browser Agent Injection Settings

Once the APM Browser Agent feature is enabled, it's possible to customize the default settings and add additional ones depending on your requirements.

The below environment variables can be added or changed depending on your requirements.

Any changes made to the configuration will require a restart of the corresponding Windows Services or IIS.

As configuration, below environment variables can be added or changed. Any changes made to the configuration will require a restart of corresponding Windows Services or IIS.

Environment variable Description Default value Sample value
OTEL_BA_DEBUG Specifies if debug log level is enabled. Set it to "true" to enable debug log level. false  
OTEL_BA_UPLOAD_ENDPOINT Specifies the endpoint of APM service that the browser agent will upload data to. If this environment variable is not specified, the upload endpoint is taken from OTEL_EXPORTER_OTLP_ENDPOINT without suffix "/20200101/opentelemetry". https://aaaac6h5n3jn6aaaaaaaaaacqe.apm-agt.us-phoenix-1.oci.oraclecloud.com
OTEL_BA_SERVICE_NAME Specifies the service name of the browser agent. If this environment variable is not specified, the service name is taken from OTEL_SERVICE_NAME.  
OTEL_BA_WEB_APPLICATION Specifies the web application name. The web server name on IIS or the assembly name .  
OTEL_INJECT_LOCATION_TAG Specifies where in the HTML the browser agent is injected. <head </script
OTEL_INJECT_BEFORE Specifies whether to inject before or after the specified OTEL_INJECT_LOCATION_TAG. false  
OTEL_INJECT_MODE Specifies how the browser agent is injected.
The following values can be specified:
  • InjectIfTagExists: If the specified OTEL_INJECT_LOCATION_TAG is present, inject the browser agent before it. Otherwise do nothing.
  • AppendIfNoTag: If the specified OTEL_INJECT_LOCATION_TAG is not present, append the browser agent to the end. This is the default value.
  • AppendOnly: Always append the browser agent to the end of the HTML page.
AppendIfNoTag  
OTEL_BA_DISABLE_URLS Specifies the regex that matches the URLs that should be disabled from browser agent injection. "" (empty), means no URL will be disabled. .*WaimaiUiMvc\/Home\/Cart.*|.*waimaiwasm\/cart.*
OTEL_BA_TEMPLATE Specifies the browser agent template that will be injected.

The values surrounded by @@ are replaced before the injection occurs, and they are values acquired by the APM Dotnet agent.

This template can be adjusted to account for browser agent-side configurations mentioned in the other sections of this documentation, such as the
window.apmrum.rewriteRules
. For information, see Hide Personally Identifiable Information.
<script type="application/javascript">window.apmrum = (window.apmrum || {});
window.apmrum.serviceName='@@SERVICE_NAME@@';
window.apmrum.webApplication='@@WEB_APPLICATION@@';
window.apmrum.ociDataUploadEndpoint='@@UPLOAD_ENDPOINT@@';
window.apmrum.OracleAPMPublicDataKey='@@PUBLIC_KEY@@';
window.apmrum.username='@@USER_NAME@@';
window.apmrum.traceSupportingEndpoints = [ { hostPattern: '.*', headers: ['W3C']},];
</script>
<script type="application/javascript"  crossorigin="anonymous"
src="@@UPLOAD_ENDPOINT@@/static/jslib/apmrum.min.js"></script>