Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msa7/crystal-rollbar
Crystal client for Rollbar https://rollbar.com
https://github.com/msa7/crystal-rollbar
Last synced: 2 months ago
JSON representation
Crystal client for Rollbar https://rollbar.com
- Host: GitHub
- URL: https://github.com/msa7/crystal-rollbar
- Owner: msa7
- License: mit
- Created: 2020-02-24T15:10:54.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T12:18:27.000Z (about 1 year ago)
- Last Synced: 2023-10-04T20:59:27.073Z (about 1 year ago)
- Language: Crystal
- Size: 6.84 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crystal-rollbar
An unofficial Crystal-language client and integration layer for the [Rollbar](https://rollbar.com) error reporting API.
Based on [Rollbar-gem](https://github.com/rollbar/rollbar-gem) and [raven.cr](https://github.com/Sija/raven.cr)
Features:
- [x] report to Rollbar
- [ ] report about parent exception
- [ ] Kemal integration. Sumbit URL, HTTP variable based on Kemal environment
- [ ] Write example of async error reporting (fiber, sidekiq)## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
crystal-rollbar:
github: msa7/crystal-rollbar
```2. Run `shards install`
## Usage
```crystal
require "crystal-rollbar"Rollbar.access_token = "rollbar_access_token"
Rollbar.environment = "staging"
Rollbar.framework = "Kemal"
Rollbar.code_version = "0.1"Rollbar.debug("Debug #{Time.utc}", user_id = "777")
begin
raise "Error #{Time.utc}"
rescue e
Rollbar.error(e, user_id = "555")
end
```With Kemal
```crystal
require "crystal-rollbar/kemal"Kemal.config.add_handler(Rollbar::Kemal::ExceptionHandler.new)
Kemal.run
```With Sidekiq
```crystal
require "crystal-rollbar/sidekiq"
cli = Sidekiq::CLI.newserver = cli.configure do |config|
config.error_handlers << Rollbar::Sidekiq::ExceptionHandler.new
endcli.run(server)
```## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Sergey Makridenkov](https://github.com/your-github-user) - creator and maintainer