We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was going through the docs and guided install for Golang, and saw go get isn’t working as instructed. You need to use go mod init XXX/newrelic, before go get. We should update our docs, and guided install. FYI - https://docs.newrelic.com/docs/apm/agents/go-agent/installation/install-new-relic-go.
The text was updated successfully, but these errors were encountered:
I am unable to monitor my go project with the new relic
I am able to monitor using JAVA
I have follows the documentation steps: https://docs.newrelic.com/docs/apm/agents/go-agent/installation/install-new-relic-go/
From github.com/newrelic/go-agent, use your preferred process; for example: bash command go get github.com/newrelic/go-agent/v3/newrelic
go get github.com/newrelic/go-agent/v3/newrelic
Import the github.com/newrelic/go-agent/v3/newrelic package in your application. import github.com/newrelic/go-agent/v3/newrelic
import github.com/newrelic/go-agent/v3/newrelic
Initialize the Go agent by adding the following in the main function or in an init block:
app, err := newrelic.NewApplication( newrelic.ConfigAppName("Your Application Name"), newrelic.ConfigLicense("YOUR_NEW_RELIC_LICENSE_KEY") )
NOTE: I have follows all the trouble shooting as well.
main.go
package main import ( "fmt" "io" "net/http" "github.com/newrelic/go-agent/v3/newrelic" ) var newrelicApp *newrelic.Application func main() { app, err := newrelic.NewApplication( newrelic.ConfigAppName("MyAppMain"), newrelic.ConfigLicense("**REDACTED**"), newrelic.ConfigAppLogForwardingEnabled(true), ) if err != nil { fmt.Printf("error is " + err.Error()) } else { newrelicApp = app http.HandleFunc(newrelic.WrapHandleFunc(app, "/test", customEvent)) } } func customEvent(w http.ResponseWriter, req *http.Request) { io.WriteString(w, "recording a custom event") newrelicApp.RecordCustomEvent("MyAppMainEvent", map[string]interface{}{ "text": "Hello VP", "env": "go_local", "alertType": "error", "priority": "Critical", "source": "MyAppMain", }) }
Sorry, something went wrong.
@urvesh-educloud Your license Key associated with this account was posted here and is compromised. Please rotate it in New Relic One.
No branches or pull requests
I was going through the docs and guided install for Golang, and saw go get isn’t working as instructed. You need to use go mod init XXX/newrelic, before go get. We should update our docs, and guided install. FYI - https://docs.newrelic.com/docs/apm/agents/go-agent/installation/install-new-relic-go.
The text was updated successfully, but these errors were encountered: