opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

feature request(express): option to ignore `express.static` files

Open dyladan opened this issue 3 years ago • 4 comments
trafficstars

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.

dyladan avatar Mar 03 '22 15:03 dyladan

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.

github-actions[bot] avatar May 09 '22 06:05 github-actions[bot]

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

dyladan avatar May 10 '22 20:05 dyladan

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.

github-actions[bot] avatar Jul 11 '22 06:07 github-actions[bot]

This is not stale.

dyladan avatar Jul 12 '22 18:07 dyladan

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.

github-actions[bot] avatar Sep 26 '22 06:09 github-actions[bot]

You should be able to add a configuration to ignore path starting with /public :

new HttpInstrumentation({
   ignoreIncomingRequestHook: request => {
        return request.url.startWith("/public")
   },
})

vmarchaud avatar Sep 26 '22 14:09 vmarchaud