Skip to content

Commit

Permalink
Doc configuration of LogsApiUrl in README and Options struct for http…
Browse files Browse the repository at this point in the history
… middleware
  • Loading branch information
TheTeaCat committed Oct 6, 2023
1 parent dc1c868 commit d8f270f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ if err != nil {

You will then have a `func(next http.Handler) http.Handler`, `firetailMiddleware`, which you can use to wrap a `http.Handler` just the same as with the middleware from [`net/http/middleware`](https://pkg.go.dev/go.ntrrg.dev/ntgo/net/http/middleware). This should also be suitable for [Chi](https://go-chi.io/#/pages/middleware).

See the [Go reference for the Options struct](https://pkg.go.dev/github.com/FireTail-io/[email protected]/middlewares/http#Options) for documentation regarding the available options. For example, if you are using `us.firetail.app` you will need to set the `LogsApiUrl` to `https://api.logging.us-east-2.prod.firetail.app/logs/bulk`.



## Tests
Expand Down
2 changes: 2 additions & 0 deletions middlewares/http/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Options struct {

// LogsApiUrl is the URL of the Firetail logging API endpoint to which logs will be sent by the default batch callback. This value
// should typically be loaded in from an environment variable. If unset, the default value is the Firetail SaaS' bulk logs endpoint
// in the default region (firetail.app). If another region is being used, this option will need to be configured appropriately. For
// example, for us.firetail.app LogsApiUrl should normally be https://api.logging.us-east-2.prod.firetail.app/logs/bulk
LogsApiUrl string

// LogBatchCallback is an optional callback which is provided with a batch of Firetail log entries ready to be sent to Firetail. The
Expand Down

0 comments on commit d8f270f

Please sign in to comment.