Add honeycomb to backend

This commit is contained in:
Dave Gallant
2022-11-05 17:34:25 -04:00
parent cfbd2506d2
commit 888442db9b
8 changed files with 578 additions and 1 deletions

View File

@@ -9,6 +9,9 @@ import (
"github.com/rs/zerolog/log"
utils "github.com/davegallant/rfd-fyi/pkg/utils"
_ "github.com/honeycombio/honeycomb-opentelemetry-go"
"github.com/honeycombio/opentelemetry-go-contrib/launcher"
)
// @title RFD FYI API
@@ -29,6 +32,13 @@ import (
func main() {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
// use honeycomb distro to setup OpenTelemetry SDK
otelShutdown, err := launcher.ConfigureOpenTelemetry()
if err != nil {
log.Fatal().Msgf("error setting up OTel SDK - %e", err)
}
defer otelShutdown()
a := &App{}
httpPort := utils.GetEnv("HTTP_PORT", "8080")