Navigation Menu

Skip to content
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

Requests to APM Server are sometimes logged by the agent #732

Closed
watson opened this issue Dec 10, 2018 · 1 comment
Closed

Requests to APM Server are sometimes logged by the agent #732

watson opened this issue Dec 10, 2018 · 1 comment
Assignees
Labels

Comments

@watson
Copy link
Member

watson commented Dec 10, 2018

Normally HTTP requests to the APM Server should be ignored by the agent so that it doesn't create spans for the request to the APM Server it sends it self.

But it's seems that sometimes these requests are not ignored: https://discuss.elastic.co/t/how-to-exclude-apm-self-sent-events-capturing/160134

@watson watson added the bug label Dec 10, 2018
@watson watson self-assigned this Dec 10, 2018
@Qard
Copy link
Contributor

Qard commented Dec 11, 2018

I've actually been thinking it might be handy to have a helper function to explicitly escape the transaction continuation when we want to do internal async things. 🤔

Something like this could work:

Agent.prototype.escape = function (fn) {
  var trans = this.currentTransaction
  this.currentTransaction = null
  var result = fn()
  this.currentTransaction = trans
  return result
}

agent.escape(() => {
  // This code will exist outside the transaction
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants