-
Notifications
You must be signed in to change notification settings - Fork 17
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
AWS: investigate 2 seconds delay before response is returned #150
Comments
it's probably a http request that is not traced. non of the functions in AWS show http traces, when helix-fetch is the /cc @ranrib |
Hi @tripodsan - is this using http2 or 1? Are you using webpack or any other method to bundle the functions? |
I think in this case we try to use http/2. but if the server supports it, i don't know
yes. we are using webpack. but no obfuscation / minification. |
The protocol is negotiated via ALPN, i.e. we don't 'try' http/2. The negotiated protocol is most certainly http/2. |
I've tried to re-create the following scenario:
And it works for me (I've verified that it's indeed HTTP/2). Do you have any idea or insight what is this different than your code? |
Hi @ranrib, |
@stefan-guggisberg when you set |
@tripodsan yes here's the full output (I also enabled
|
The above output was generated by running this code with require('dotenv').config();
const epsagon = require('epsagon');
const { fetch, reset } = require('@adobe/helix-fetch');
const { EPSAGON_TOKEN } = process.env;
epsagon.init({
token: EPSAGON_TOKEN,
appName: 'helix-fetch Test',
metadataOnly: false,
});
async function test() {
const resp = await fetch('https://httpbin.org/get');
console.log(resp.ok);
}
const testFunction = epsagon.nodeWrapper(test);
testFunction()
.catch(console.error)
.finally(reset); |
Hi @ranrib, care to comment? |
Hi @stefan-guggisberg ! Sorry for the late reply. Please add as an init parameter the following: You should be able to see the trace afterwards |
Thanks @ranrib, that worked. I can see the traces now in epsagon. It would be nice if the http protocol version would be visible in the trace. Now that we've confirmed that traces of http/2 requests generally work we still have to figure out why not a single http/2 request (there are tons!) is captured in our production env (aws lambda)... |
should update our epsagon instrumentation to always disable batches? |
@tripodsan yes - since you're running on ephemeral envs, batching is less relevant. so please set it for all. |
I just check and we already set it. |
@ranrib I did some more testing with a simpler function: https://github.com/adobe/helix-version-picker I did the same as yesterday, i.e. deployed the function manually, but this time I didn't see the request. then I deliberately disabled HTTP2, redeployed and then I see the http request to github in the trace: I also created a completely new function, but still no request: btw, here's how to invoke the function
but then, for the next invocation, there is a request: but for one later, no: could it be that epsagon doesn't catch requests on http2 keep alive connections? then I did a test by creating a new fetch context for every invocation.... but same result. no requests recorded. then I created a version with but the cloudwatch logs don't mention it. so, I have no clue so far, what could be the reason. I also updated to node 14, but with the same result. and then with enabled debug, also no capture: btw, I noticed those INFO in the debug output:
might this be a problem? |
could be:
The text was updated successfully, but these errors were encountered: