Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinmichaelchen/go-new-relic-gin-zerolog
Setting up Log Forwarding with New Relic + Gin (HTTP Server) + Zerolog Logger
https://github.com/kevinmichaelchen/go-new-relic-gin-zerolog
gin gin-gonic golang new-relic newrelic zerolog
Last synced: 1 day ago
JSON representation
Setting up Log Forwarding with New Relic + Gin (HTTP Server) + Zerolog Logger
- Host: GitHub
- URL: https://github.com/kevinmichaelchen/go-new-relic-gin-zerolog
- Owner: kevinmichaelchen
- Created: 2022-10-24T16:50:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-26T21:21:12.000Z (about 2 years ago)
- Last Synced: 2023-11-07T02:07:44.254Z (about 1 year ago)
- Topics: gin, gin-gonic, golang, new-relic, newrelic, zerolog
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-new-relic-gin-zerolog
[![Lines Of Code](https://tokei.rs/b1/github/kevinmichaelchen/go-new-relic-gin-zerolog?category=code)](https://github.com/kevinmichaelchen/go-new-relic-gin-zerolog)
This demo uses
* [New Relic](https://newrelic.com/), an o11y platform
* [gin](https://github.com/gin-gonic/gin), an HTTP web framework
* [zerolog](https://github.com/rs/zerolog), a structured loggerFor this demo, I signed up for a free plan of New Relic.
## Getting started
### Start server
Start the server using your New Relic browser license key.
```shell
env \
ENV=local \
SERVICE_NAME=foobar \
NEW_RELIC_KEY=YOUR-KEY \
go run main.go
```### Hit endpoint
```shell
curl localhost:8081/health
```### Check New Relic UI
Visit [New Relic One](https://one.newrelic.com) and navigate to `APM & services`,
and search for your _Trace group_. When you drill down into a trace, you should
be able to see all the logs belonging to that trace. This is known as _logs in context_.