Closed trajano closed 1 year ago
Hi @trajano, this is probably something that can be added and I think someone previously made a start to it. Do you need it to filter by the request method as well, e.g. HEAD
as this might be a more complicated pattern to match?
I just made it so it's more flexible and ideally simpler for you to code because you're just filtering on the request line which you already have. But no I don't think I would need the method filter at the moment.
if (this.ignoredHosts) {
const host = extractHost(url);
if (host && this.ignoredHosts.has(host)) {
return;
}
}
I just found that block. I guess this would change to something like
if (this.ignoredPatterns) {
const toMatch = `${method} ${url}`
if (this.ignoredPatterns.find((p) => p.matches(toMatch))) {
return;
}
}
I've just added a PR which should cover this. Let me know what you think of it.
Another option I was thinking was to pass a callback function which gives you control of what to ignore.
Feature Request I want to filter out the
/ping
calls from the server done byNetInfo
but they're in the same host as my main server that I am trying to monitor.If we say the request has the following text
It would simplify us by having rules that look like
Additional context