New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignoreUrls
and transactionIgnoreUrls
doesn't work at all!?!
#3666
Comments
Hi @khteh, Here is an "http-ignore-urls.example.js" script showing that those two "ignore" settings are working for me: require('elastic-apm-node').start({
serviceName: 'http-ignore-urls',
usePathAsTransactionName: true, // This example doesn't use a framework with explicit routes, so use this for testing.
disableSend: true, // Turn off actually sending data, while we debug locally.
logLevel: 'debug',
// I am just testing one at a time. Shouldn't need both "ignore" options.
ignoreUrls: [/^\/health\//i, /^\/[._]+next\//i, /^\/robots.txt/],
// transactionIgnoreUrls: ['/health/*', '/.next/*', '/_next/*', '/robots.txt'],
});
const http = require('http');
const server = http.createServer(function onRequest(req, res) {
console.log('incoming request: %s %s %s', req.method, req.url, req.headers);
req.resume();
req.on('end', function () {
const resBody = 'pong';
res.writeHead(200, {
'content-type': 'text/plain',
'content-length': Buffer.byteLength(resBody),
});
res.end(resBody);
});
});
server.listen(3000); When I run that and call it with:
I see this "ignoring request to ..." message in the APM agent log output:
And when I call with some not-ignored path, e.g.
Are you able to turn on issue with the "/robots.txt" config valueI did notice a related bug in the APM agent when the incoming request has query parameters. With |
#3667 for that. However, I don't believe that is the issue you are hitting here. |
|
Hi @khteh, Did you edit some lines out of the middle of those log lines? I would have expected to see a log line with "setting transaction result" in the message, and one with "setting default transaction name" in the message, and one with "intercepted request event call to http.Server.prototype.emit for" in the message. One thing that would really help, and save us going back and forth with questions, would be: a complete debug log from application startup, until a few requests have been handled. The best thing that would help is if you could show a complete small reproduction case that I could try on my end. What versions of your dependencies (e.g. "next") are you using? How are you starting the Next.js server? Is it possible that HTTP/2 (as opposed to HTTP/1.1) is involved here? Note that we do have experimental support for instrumenting Next.js. It is described here: https://www.elastic.co/guide/en/apm/agent/nodejs/master/nextjs.html However, I don't think details in that document are related to the issue you are currently seeing. |
I don't find any of the log patterns you suggested:
What versions of your dependencies (e.g. "next") are you using?
How are you starting the Next.js server? next start? next dev? Is it possible that HTTP/2 (as opposed to HTTP/1.1) is involved here? YES. |
Describe the bug
I have the following
ignoreUrls
configured:But the
_next/*
still appears in APM Transactions in Kibana.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Environment (please complete the following information)
How are you starting the agent? (please tick one of the boxes)
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
)elastic-apm-node/start
from within the source code-r elastic-apm-node/start
Additional context
Agent config options:
Click to expand
package.json
dependencies:Click to expand
The text was updated successfully, but these errors were encountered: