Skip to content

CleverCloud/Go-New-Relic-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install New Relic for Go

This repository showcases how to make a Go app that runs on Clever Cloud observable using New Relic Agent.

How to

Build on Clever Cloud

This project uses gomod to build. Add the following environment variable in Clever Cloud Console to deploy this app:

CC_GO_BUILD_TOOL="gomod"

Connect to New Relic

The installation process is explained in New Relic's doc for Go or can be done by following the step by step instructions provided by the Guided Install from your New Relic account.

Both processes are the same, except the Guided install will already contain your Licence Key in the code, which is convenient.

Guided Install from New Relic dashborad

From your New Relic home's account, go to the left menu options, click on Add data >Guided Install.

guided install from New Relic dashboard

Chose APM (Application Monitoring), then select Go.

installation plan from New Relic dashboard

Follow the steps to import the agent into your Go application.

Step 4: a note

The code in main.go contains the code in a new init block. You can also add it your main function. Both options are viable.

Don't forget to run go run . to compile and deploy before pushing your code.

🚀 You don't need to complete step 7 when deploying on Clever Cloud, as the runtime will read your code and get the agent automatically.

Go versions

If your project uses a Go version that is not yet supported on Clever Cloud, specify the full version (ex: go 1.22.0 instead of go 1.22)in go.mod like in this example. It will work out of the box with the specified version regardless of server configurations.

About

A Go example app monitored by New Relic agent

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages