rollbar / rollbar-go

Go client for Rollbar
https://docs.rollbar.com/docs/go
MIT License
105 stars 23 forks source link

Any example for adding rollbar to serverless ? #58

Closed Hareramrai closed 5 years ago

Hareramrai commented 5 years ago

I am using below serverless framework with golang.

https://serverless.com

https://github.com/yunspace/serverless-golang

Does any know how to add global error handling with rollbar & this framework?

waltjones commented 5 years ago

Hi @Hareramrai There isn't currently a middleware for serverless. You can add to your handler, whether using serverless or any Lambda handler, by importing and setting your token.

import "github.com/rollbar/rollbar-go"
rollbar.SetToken("YOUR_TOKEN")

And Rollbar is ready to use.