# Trying to ingore OPTIONS http method

**URL:** <https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758>\
**Category:** APM\
**Tags:** java\
**Created:** [August 5, 2025, 12:14pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758 "2025-08-05T12:14:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![miguel.longo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel.longo/32/119522_2.png) [@miguel.longo](https://discuss.elastic.co/u/miguel.longo)\
**Post date:** [August 5, 2025, 12:14pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758/1 "2025-08-05T12:14:18Z")

</div>

**Kibana version** : 8.6.2

**Elasticsearch version** : 8.6.2

**APM Server version** : 8.6.2

**APM Agent language and version** : Java Agent v1.52.1

Hello Folks.

I'd like to know, if it's possible in java agent arguments, remove the preflight OPTIONS calls to API. I mean, the browser preflight OPTIONS call.

Some application has many 'OPTIONS unknown route' calls in you trace and this calls mask the APM values. I tried to use de transaction\_ignore\_urls with regex, only to test, but as I thought, it didn't work.

My question is: is it possible to ignore OPTIONS methods with a config in the Java agent? Do I need to change the APM query to ignore them?

The goal here is to ignore them in the Java agent to avoid code changes.

 ![options-call-1](https://us1.discourse-cdn.com/elastic/original/3X/4/3/431626a4779488b6ae63fa7a9e12c4b706469777.png)

 ![optsion-call-2](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a042533cb7117f1f69c15b535a8d8871c8229377.png)

Regards.

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [August 5, 2025, 3:52pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758/2 "2025-08-05T15:52:32Z")

</div>

It's not clear to me where these transactions are coming from, could you explain the scenario here?

---

<div class="post-metadata">

**Author:** ![miguel.longo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel.longo/32/119522_2.png) [@miguel.longo](https://discuss.elastic.co/u/miguel.longo)\
**Post date:** [August 5, 2025, 7:56pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758/3 "2025-08-05T19:56:24Z")

</div>

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.

```auto
    -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:

 ![options-call-3](https://us1.discourse-cdn.com/elastic/original/3X/1/6/16aa225c7c8bedf8ee2e1debd7c4c96c80257af0.png)

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?

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [August 6, 2025, 1:04pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758/4 "2025-08-06T13:04:08Z")

</div>

what do you get when you set use\_path\_as\_transaction\_name=true

---

<div class="post-metadata">

**Author:** ![miguel.longo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel.longo/32/119522_2.png) [@miguel.longo](https://discuss.elastic.co/u/miguel.longo)\
**Post date:** [August 7, 2025, 6:47pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758/5 "2025-08-07T18:47:51Z")

</div>

Hello Jack, Sorry for the delay.

I'll test this argument and get back to you with the results as soon as possible.

---

<div class="post-metadata">

**Author:** ![miguel.longo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel.longo/32/119522_2.png) [@miguel.longo](https://discuss.elastic.co/u/miguel.longo)\
**Post date:** [September 15, 2025, 1:29pm UTC](https://discuss.elastic.co/t/trying-to-ingore-options-http-method/380758/6 "2025-09-15T13:29:18Z")

</div>

Hello Jack, sorry for the delay.

I ran into some issues that kept me from doing the test earlier. Everything is working fine now.

Thanks again for your help.

Have a nice week.
