opentelemetry-js
opentelemetry-js copied to clipboard
feature request(express): option to ignore `express.static` files
Discussed in https://github.com/open-telemetry/opentelemetry-js/discussions/2798
Originally posted by thpoiani February 19, 2022
🙇 Thank you for this project and support.
I have a question: How to ignore static files using http and express instrumentation?
app.use(express.static('public'))
```</div>
This user asked this in a discussion initially, but it is really a feature request.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This could be solved 2 different ways:
- a general way to ignore requests in the http instrumentation (maybe this is already possible I can't remember
- a specific feature in the express instrumentation
I don't think this is stale
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This is not stale.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
You should be able to add a configuration to ignore path starting with /public :
new HttpInstrumentation({
ignoreIncomingRequestHook: request => {
return request.url.startWith("/public")
},
})