# Elastic.Apm.NetCoreAll how to ignore transaction of OPTIONS http method?

**URL:** <https://discuss.elastic.co/t/elastic-apm-netcoreall-how-to-ignore-transaction-of-options-http-method/337513>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [July 4, 2023, 5:55am UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-how-to-ignore-transaction-of-options-http-method/337513 "2023-07-04T05:55:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![khteh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khteh/32/147573_2.png) [@khteh](https://discuss.elastic.co/u/khteh)\
**Post date:** [July 4, 2023, 5:56am UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-how-to-ignore-transaction-of-options-http-method/337513/1 "2023-07-04T05:56:00Z")

</div>

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 🙂

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](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) 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** : 8.8.0

**Elasticsearch version** : 8.8.0

**APM Server version** : 8.8.0

**APM Agent language and version** : .Net Core 7 C# 1.22.0

**Browser version** :

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Nuget

**Fresh install or upgraded from other version?** Fresh

**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.

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

**Steps to reproduce** :  
1.  
2.  
3.

**Errors in browser console (if relevant)**:

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

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [July 14, 2023, 2:24pm UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-how-to-ignore-transaction-of-options-http-method/337513/2 "2023-07-14T14:24:40Z")

</div>

You can use the filter API: [Public API | APM .NET Agent Reference [1.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/public-api.html#filter-api)

Just return `null` from that function in case `Transaction.Context.Request.Method` is `OPTIONS`. You could also cache the id of such transactions and drop spans within the transaction similarly with a span filter.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 11, 2023, 2:25pm UTC](https://discuss.elastic.co/t/elastic-apm-netcoreall-how-to-ignore-transaction-of-options-http-method/337513/3 "2023-08-11T14:25:24Z")

</div>

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