Sure!
I'm experiencing "an issue" with CORS preflight requests from our frontend to the backend API. The browser sends an OPTIONS request before the actual API call.
For reasons I have not yet determined, we are seeing a very high volume of these OPTIONS requests, as I described in the previous thread.
My concern is about the 'OPTIONS unknown route' trace. I don't understand why these calls appear in APM and what the source of the problem might be (if it is, in fact, a problem).
A direct consequence is that these requests are triggering false positive high-throughput alerts in our monitoring system.
I'm trying to replicate and solve this on a legacy application running on an older JVM. Below is the full configuration I'm using for the Elastic APM Java agent.
-Delastic.apm.service_name=api
-Delastic.apm.server_urls=https://apm.local
-Delastic.apm.secret_token=nonononono
-Delastic.apm.environment=production
-Delastic.apm.application_packages=com.myself
-Delastic.apm.include_process_args=false
-Delastic.apm.start_async=true
-Delastic.apm.delay_agent_premain_ms=240000
-Delastic.apm.capture_headers=true
-Delastic.apm.use_path_as_transaction_name=false
-Delastic.apm.transaction_ignore_urls=/metrics,/prometheus,*/metrics,*/health,*/health/*,*/prometheus,*/prometheus/*,*/actuator,*/actuator/*,*/alive,*/alive/*,.*/OPTIONS.*,.*_method=OPTIONS.*,.*\?.*OPTIONS.*
-Delastic.apm.use_jaxrs_path_as_transaction_name=true
-Delastic.apm.circuit_breaker_enabled=true
-Delastic.apm.max_queue_size=128
-Delastic.apm.api_request_time=10s
-Delastic.apm.server_timeout=5s
-Delastic.apm.classes_excluded_from_instrumentation=org.jboss.*,org.wildfly.*,io.undertow.*,com.fasterxml.jackson.*,org.hibernate.validator.*,javax.validation.*
-Delastic.apm.disable_instrumentations=reactor,spring-webflux,spring-webclient,springwebclient
-Delastic.apm.span_compression_enabled=true
-Delastic.apm.enable_type_pool_cache=true
-Delastic.apm.central_config=false
-Delastic.apm.log_level=ERROR
-Delastic.apm.span_stack_trace_min_duration=5000ms
-Delastic.apm.stack_trace_limit=25
-Delastic.apm.transaction_max_spans=300
-Delastic.apm.transaction_sample_rate=1.0
-Delastic.apm.span_min_duration=100ms
-Delastic.apm.exit_span_min_duration=100ms
-Delastic.apm.trace_methods_duration_threshold=150ms
-Delastic.apm.use_elastic_traceparent_header=false
-Delastic.apm.disable_outgoing_tracecontext_headers=true
This is the browser call:
What is causing the traces to appear as 'OPTIONS unknown route'? Is there a way to fix this? For example, is there a specific setting in the agent configuration that can prevent these traces from being captured?