-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor gin middleware #224
Conversation
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I have a few minor questions/suggestions.
PTAL |
examples/gin/README.md
Outdated
@@ -2,10 +2,28 @@ | |||
|
|||
This is an example of basic Gin app with Airbrake middleware that reports route stats. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example of basic Gin app with Airbrake middleware that reports route stats. | |
This is an example of a basic Gin app with Airbrake middleware that reports performance data (route stats). |
examples/apexlog/main.go
Outdated
var ProjectId int64 = 363389 | ||
var ProjectKey string = "baa755018d5e35e07897ee0087fcce9c" | ||
var ProjectId int64 = 105138 // Insert your Project Id here | ||
var ProjectKey string = "fd04e13d806a90f96614ad8e529b2822" // Insert your Project Key here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change many digits of the project key so that it's definitely not valid. Also, change the project id to something like 999999
so that it's more obvious that the user should change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chimanjain before you merge can you replace this ProjectKey with something like you did in the other main.go file:
var ProjectId int64 = 999999 // Insert your Project Id here
var ProjectKey string = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Insert your Project Key here
examples/gin/README.md
Outdated
## How to run API | ||
## How to run Example API | ||
|
||
Copy the example in your testing(eg. ginbrake) folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a "testing (e.g. ginbrake) folder"? Does a user really need to copy it? or can they just run it from the example directory?
examples/gin/README.md
Outdated
|
||
Copy the example in your testing(eg. ginbrake) folder. | ||
|
||
Insert your project ID and project key in main.go file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insert your project ID and project key in main.go file | |
Insert your project ID and project key in the `main.go` file. You can find these values on the settings page for your project. |
examples/gin/README.md
Outdated
|
||
Insert your project ID and project key in main.go file | ||
|
||
run: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run: | |
Run the following commands to build and run this example application. |
examples/gin/README.md
Outdated
|
||
`curl "http://127.0.0.1:3000/weather/{austin/pune/santabarbara}" -H 'api-key: d4b371692d361869183d92d84caa5edb8835cf7d'` | ||
|
||
Once you call the API endpoints, check your project's performance dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you call the API endpoints, check your project's performance dashboard | |
Once you call the API endpoints, view the Airbrake errors and performance dashboards for your project. |
examples/gin/main.go
Outdated
) | ||
|
||
var ProjectId int64 = 105138 // Insert your Project Id here | ||
var ProjectKey string = "fd04e13d806a90f96614ad8e529b2822" // Insert your Project Key here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change many digits of the project key so that it's definitely not valid. Also, change the project id to something like 999999
so that it's more obvious that the user should change it.
I will change the readme file. |
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple more things I'd suggest that you change before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (looks good to me), but this is still unresolved: https://github.com/airbrake/gobrake/pull/224/files#r764111783
The sample application of apex/log will be updated in the separate merge request, I am working on removing the custom severity levels and using the levels provided by apex/log |
Ok, maybe we don't need to change it in this PR? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
eb6cd11
to
dd01461
Compare
Added a New() function which will be used as a standardised function for all the middleware instead of NewMiddleware(It will still be present so we don't break existing bindings).
Updated how we were fetching the route name.