Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Add better logging for first-time users #40

Open
RichVanderwal opened this issue Dec 14, 2020 · 2 comments
Open

Add better logging for first-time users #40

RichVanderwal opened this issue Dec 14, 2020 · 2 comments
Labels

Comments

@RichVanderwal
Copy link
Contributor

When a customer starts using the New Relic Telemetry SDK for Go, they'll probably want to see the harvest loop running in the debug log. Since this library is used as part of a larger system, the log lines written should identify it as coming from this library for easier and quicker troubleshooting.

  1. Add a logDebug call to the harvest cycle, perhaps in the HarvestNow function, that prints a line and the number of requests it's sending. A good place to do this might be here.
    https://github.com/newrelic/newrelic-telemetry-sdk-go/blob/master/telemetry/harvester.go#L392
    Something like this would do the job:
	h.config.logDebug(map[string]interface{}{
		"message": "OpenTelemetry SDK harvest cycle transmitting " + strconv.Itoa(len(reqs)) + "requests",
	})
  1. Come up with a good string to prefix every line of logging that this library produces to identify it as the New Relic Telemetry SDK for Go.
@jodeev
Copy link

jodeev commented Jan 14, 2021

Also somewhat related, on the exporter side: newrelic/opentelemetry-exporter-go#39

@jodeev jodeev added the p3 label Mar 11, 2021
@totomz
Copy link

totomz commented Dec 27, 2021

I'm in the same situation (just started using this library and trying to understand why the metrics are not in newrelic)

Not sure if this has been merged after this issue, but it is possible to log library events:

nrel, err := telemetry.NewHarvester(
	telemetry.ConfigAPIKey(nrKey),
	telemetry.ConfigBasicDebugLogger(os.Stdout),
	telemetry.ConfigBasicErrorLogger(os.Stdout),
)

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

No branches or pull requests

3 participants