elastic / apm-nodejs-http-client

**Moved to elastic/apm-agent-nodejs.** A low-level Node.js HTTP client for communicating with the Elastic APM intake API
MIT License
21 stars 30 forks source link

Feature Request: Logging in the Client #132

Closed astorm closed 1 year ago

astorm commented 3 years ago

The APM Client current doesn't have access to a logger. This means we can't add logging for our customers, or move forward on our long term plans for "logging as self instrumentation".

In order to fix this we should

  1. Consider a logger for the APM client
  2. Determine how, if at all, this logger interacts with the Agent's logger
  3. Be extra considerate of perf. concerns, as the client can often be a "hot path" for high throughput applications

One the logger's in place, we should also consider places we may want to add logs. For example -- our cautions check on _encodedMetadata when we're 95% certain is should already be set.

    if (!client._encodedMetadata) {
      client._encodedMetadata = client._encode({ metadata: client._conf.metadata }, Client.encoding.METADATA)
    }
trentm commented 1 year ago

A logger was added in #143