-
Notifications
You must be signed in to change notification settings - Fork 726
Improve observability #834
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
Conversation
It seems to be in pretty good shape from APM perspective. With the Thanks for the notice. :) |
I'm thinking if it is worth to add a Eg: const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200'
})
client.on('request', (err, { meta }) => {
console.log(meta.request.context) // { id: 0, winter: 'is coming' }
meta.request.context.star = 'wars'
})
client.on('response', (err, { meta }) => {
console.log(meta.request.context) // { id: 0, winter: 'is coming', star: 'wars' }
})
client.info({}, { context: { winter: 'is coming' } }, console.log) |
Yes, if you don't do anything, |
I've done some more changes which should improve the observability:
In code: const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200',
name: 'cluster-abc'
})
client.on('request', (err, { meta }) => {
const { name, context, request } = meta
console.log(name, context, request.id)
})
client.info({}, { context: { winter: 'is coming' }, id: 'custom-id' }, console.log) |
👍 this is great. |
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.
LGTM - just minor nitpicks to the docs. This gives me a lot of ideas for Kibana!
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
Jenkins retest this please |
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
Co-Authored-By: delvedor <delvedor@users.noreply.github.com>
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.
A couple lingering questions, but LGTM
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.
LGTM, thanks!
Jenkins retest this please |
* API generation * Added correlation id support * Updated docs * Updated test * Updated code generation * API generation * Updated code generation * Added support for client name and custom context object * Updated docs * Updated test * Fix docs * Updated docs * Added id support also for sniffing * Updated test * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Apply suggestions * Update docs/configuration.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/configuration.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Apply suggestions * Updated README.md * Fixed test * Addressed suggestions
* API generation * Added correlation id support * Updated docs * Updated test * Updated code generation * API generation * Updated code generation * Added support for client name and custom context object * Updated docs * Updated test * Fix docs * Updated docs * Added id support also for sniffing * Updated test * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Apply suggestions * Update docs/configuration.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/configuration.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Apply suggestions * Updated README.md * Fixed test * Addressed suggestions
* API generation * Added correlation id support * Updated docs * Updated test * Updated code generation * API generation * Updated code generation * Added support for client name and custom context object * Updated docs * Updated test * Fix docs * Updated docs * Added id support also for sniffing * Updated test * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Apply suggestions * Update docs/configuration.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/configuration.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Update docs/observability.asciidoc Co-Authored-By: delvedor <delvedor@users.noreply.github.com> * Apply suggestions * Updated README.md * Fixed test * Addressed suggestions
With this pr, we add support for the request id. With it, it will be easier correlate clients events and in the future enhance the client observability.
It can be fully customized in the configuration options (as well as in the child clients) and can be overridden with the specific request options.
@watson @Qard: can this be useful for you? What can I do to improve the client observability for Elastic APM?
Example:
/cc @tylersmalley @epixa @spalger