-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Instrument CLI with APM #75521
Instrument CLI with APM #75521
Conversation
c7daa85
to
37671dc
Compare
await apm.flush(); | ||
|
||
// TODO: It appears the cb is called BEFORE the API request in flush | ||
await new Promise((resolve) => setTimeout(resolve, 1000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vigneshshanmugam, this is the issue I mentioned previously. I haven't dug into it too deeply, but it appears the callback to flush is called before the HTTP request is made. Is this something you could look into? A 1-second wait is obviously something we don't want to merge with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to reproduce?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was busy with other stuffs, Apologies for the delay. Will get back to it soon. Is it blocking the current PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, yeah we will need to resolve that before moving forward with this. We're currently working to have APM collection for local development, CI and on Cloud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, Had a quick look and it seems like since there is no active request to the APM server, the callback is getting immediately invoked as a result. I will debug more on how we can tune it to report events from every CLI run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I did try a few runs and all of the events were reported properly to the server even without the setTimeout hack as the underlying transport layer guarantees the transaction was written to the stream when trans.end()
is called and flush guarantees the stream is closed properly.
Do we need to do anything else here?
af1cc2c
to
774aee4
Compare
774aee4
to
fc6bf16
Compare
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
7fd07f3
to
88ad854
Compare
88ad854
to
45b86cd
Compare
💔 Build Failed
Failed CI StepsBuild metricsHistory
To update your PR or re-run it, just comment with: |
As we work to improve the developer experience, it's important that we track the time of bootstrap and optimizer. With this, we can also ensure that developers across operating systems and machines are receiving a similar expereince.