Skip to content

sentry-demos/sentrydsn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sentrydsn

Written to derive DSN keys from requests forwarded from an on premise Sentry (8.13).

implementation

import sentrydsn "github.com/sentry-demos/sentrydsn"

//some request handler

func myFunc(r *http.Request){
   
	dsn, err := sentrydsn.FromRequest(r)

	if err != nil {

		//handle err

	} 

    //check dsn length/ other logic

    myDSN := dsn.URL

    if len(myDSN) == 0{
        //handle
    }

    //return myDSN

}

run tests

go test --v

Limitations:

  1. Currently requests sent to the legacy /api/store/ as opposed to /api/{projectID}/store/ will return a DSN struct with URL as empty ""
  2. Module will currently not handle forwarded requests to the sentry API: /api/0/
  3. Module does not rewrite auth headers.