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

Added API name to request metadata #1364

Closed
wants to merge 6 commits into from
Closed

Added API name to request metadata #1364

wants to merge 6 commits into from

Conversation

delvedor
Copy link
Member

This is very useful if you need to filter logging and you don't want to use regular expressions.

Usage:

const { Client } = require('@elastic/elasticsearch')
const client = new Client({
  node: 'http://localhost:9200'
})

client.on('response', (err, { meta }) => {
  if (err) {
    logger.error(err)
  } else {
    logger.info(`Api called: ${meta.request.options.api}`) // 'elasticsearch.info'
  }
})

client.info(console.log)

@trentm
Copy link
Member

trentm commented Dec 3, 2020

I like this feature. I think it would make matching of ES API endpoints faster in the Node.js APM Agent. However, after some discussion with the APM team there was a desire to have the config for selecting ES API endpoints for request body capture be shared between languages. This "api" name isn't a common language between all the ES clients. The only common mechanism for matching ES API endpoints is the ES URL path, i.e. what the current Node.js APM Agent is already using to match.

So if the Node.js APM Agent was the only use case for this "api" name, you might want to consider not merging this for now.

@delvedor delvedor closed this Dec 9, 2020
@delvedor delvedor deleted the symbol-api-name branch December 9, 2020 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants