beego_gorelic | NewRelic middleware for beego framework | Runtime Evironment library
kandi X-RAY | beego_gorelic Summary
kandi X-RAY | beego_gorelic Summary
beego_gorelic is NewRelic middleware for beego framework.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- InitNewrelicAgent initializes a new agent
- ReportMetricsToNewrelic reports metrics to the agent
- InitNewRelicTimer initializes a new relic timer
beego_gorelic Key Features
beego_gorelic Examples and Code Snippets
Community Discussions
Trending Discussions on beego_gorelic
QUESTION
I'm in the process of creating a web application in Go using Beego (https://beego.me).
I have a requirement to capture application monitoring and metering metrics in Newrelic and to be able to view all transactions in Newrelic.
I have followed this documentation and am using Beego GoRelic to initialise the Newrelic agent in my code.
Here is my router.go class -
...ANSWER
Answered 2020-Jan-09 at 17:44Im answering my own question as I believe Ive found a way and it might help someone else too - apparently it was just a matter of looking harder for existing plugins. I found that this plugin : https://github.com/sergeylanzman/newrelic_beego does exactly what I needed.
If we observe the code, it the author has created 3 methods -
- StartTransaction
- NameTransaction
- EndTransaction
and is inserting these as filters in the Beego environment. Under the hood the author has used the official Newrelic Go Agent (https://github.com/newrelic/go-agent) and is using Transactions to report APM data.
Here is the sample code from the plugin which registers the 3 filters -
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install beego_gorelic
Run "go get github.com/yvasiyarov/beego_gorelic"
Open routers/router.go file and:
Add "github.com/yvasiyarov/beego_gorelic" to import statement
Add beego_gorelic.InitNewrelicAgent() call to your init() function
Add NewrelicLicense key to conf/app.conf
Optionally add NewrelicVerbose=true if you wanna to see metrics, reported by NewRelic Agent
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page