All Projects → arenadotio → sentry-ocaml

arenadotio / sentry-ocaml

Licence: Unlicense license
A work-in-progress OCaml client for Sentry

Programming Languages

ocaml
1615 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to sentry-ocaml

Bricks
A standard library for microservices.
Stars: ✭ 142 (+446.15%)
Mutual labels:  sentry
Wp Sentry
A (unofficial) WordPress plugin reporting PHP and JavaScript errors to Sentry.
Stars: ✭ 174 (+569.23%)
Mutual labels:  sentry
react-native-template
An opinionated template to bootstrap your next React Native app with all the time-wasting packages you need to have.
Stars: ✭ 132 (+407.69%)
Mutual labels:  sentry
Raven Weapp
Sentry SDK for WeApp
Stars: ✭ 142 (+446.15%)
Mutual labels:  sentry
Django Guid
Inject an ID into every log message from a Django request. ASGI compatible, integrates with Sentry, and works with Celery
Stars: ✭ 166 (+538.46%)
Mutual labels:  sentry
Terraform Provider Sentry
Terraform provider for Sentry
Stars: ✭ 183 (+603.85%)
Mutual labels:  sentry
Raven Python
Raven is the legacy Python client for Sentry (getsentry.com) — replaced by sentry-python
Stars: ✭ 1,677 (+6350%)
Mutual labels:  sentry
pedax
Reversi Board with edax, which is the strongest reversi engine.
Stars: ✭ 18 (-30.77%)
Mutual labels:  sentry
Sentry Telegram
Plugin for Sentry which allows sending notification via Telegram messenger.
Stars: ✭ 168 (+546.15%)
Mutual labels:  sentry
sentry-wxwork
Plugin for Sentry which allows sending notification and SSO Login via WeChat Work.
Stars: ✭ 30 (+15.38%)
Mutual labels:  sentry
Serverless Sentry Plugin
This plugin adds automatic forwarding of errors and exceptions to Sentry (https://sentry.io) and Serverless (https://serverless.com)
Stars: ✭ 146 (+461.54%)
Mutual labels:  sentry
Cfworker
A collection of packages optimized for Cloudflare Workers and service workers.
Stars: ✭ 152 (+484.62%)
Mutual labels:  sentry
Sentry Docker
my approach for dockerizing Sentry
Stars: ✭ 195 (+650%)
Mutual labels:  sentry
Hwamei
企业微信webhook,企业微信群机器人webhook,支持Github、Gitlab、Sentry等Webhook
Stars: ✭ 142 (+446.15%)
Mutual labels:  sentry
serilog-sinks-sentry
A Sentry sink for Serilog
Stars: ✭ 34 (+30.77%)
Mutual labels:  sentry
Graphql Middleware Sentry
🗃 A GraphQL Middleware plugin for Sentry.
Stars: ✭ 141 (+442.31%)
Mutual labels:  sentry
Slashtrace
Awesome error handler. Demo: https://slashtrace.com/demo.php
Stars: ✭ 182 (+600%)
Mutual labels:  sentry
FastAPI-template
Feature rich robust FastAPI template.
Stars: ✭ 660 (+2438.46%)
Mutual labels:  sentry
good-sentry
Sentry broadcasting for good process monitor
Stars: ✭ 15 (-42.31%)
Mutual labels:  sentry
Blog
若川的博客—学习源码整体架构系列8篇,前端面试高频源码,微信搜索「若川视野」关注我,长期交流学习~
Stars: ✭ 234 (+800%)
Mutual labels:  sentry

CircleCI Coverage Status GitHub release License: Unlicense Documentation

Sentry (OCaml) - WORK IN PROGRESS

This is an unofficial work-in-progress Sentry library for OCaml.

This currently requires the Async scheduler to be running or data will not be uploaded

Missing features:

  • Only supports Async (pull requests to factor out Lwt/Unix are welcome!)
  • Global unhandled exception handler isn't implemented yet.
  • Probably other things

Example

See the example program.

In general, you should use this like:

let () =
  let spec = Command.Spec.(...) in
  Command.async_spec ~summary:"..." spec @@ fun args () ->
  (* Using [SENTRY_DSN] from the environment *)
  Sentry.with_exn_handler @@ fun () ->
  (* your normal code here *)

To release the warning above: The Async schedule must be running.

This will execute your code as usual, and if it throws an exception, it will be uploaded to Sentry:

Exception in Sentry

Then the exception will be re-thrown so your program will exit and print the backtrace to stderr as usual (if you want to continue after errors, wrap Sentry.with_exn_handler in another error handler or use Sentry.with_exn_handler_ignore).

Note that Sentry.with_error_and_exn_handler exists (which handles both exceptions and Or_error.t), but using exceptions exclusively is recommended because they have backtraces (and wrapping exceptions in Error.t loses whatever backtrace did exist in most cases).

Tags

We upload some data by default. From environment variables, we get:

  • SENTRY_ENVIRONMENT -> environment
  • SENTRY_RELEASE -> release

From Sys or Unix:

  • Sys.argv -> argv
  • Sys.backend_type -> backend_type
  • Sys.executable_name -> executable_name
  • Sys.gethostname -> server_name
  • Sys.os_type -> os_type

You can override any of these with Sentry.merge_extra, Sentry.set_environment, and Sentry.set_release.

You can also upload custom tags using either Sentry.merge_tags or by passing ~tags to a capture function. Tags will be merged for the current async job, so you only need to pass additional tags:

Sentry.merge_tags [ "app_name", "http_server" ];
Sentry.with_exn_handler @@ fun () ->
...
Sentry.merge_tags [ "method", "GET", "path", "/example" ];
...
(* This will upload with default tags + app_name, method, path, and user_id *)
Sentry.capture_message ~tags:[ "user_id", user_id ] "invalid login"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].