{"id":17325052,"url":"https://github.com/orandin/sentrus","last_synced_at":"2025-08-01T04:31:09.613Z","repository":{"id":57657783,"uuid":"427099853","full_name":"orandin/sentrus","owner":"orandin","description":"Sentry hook for sirupsen/logrus ","archived":false,"fork":false,"pushed_at":"2022-04-05T19:50:16.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T14:12:19.835Z","etag":null,"topics":["logrus","logrus-hook","sentry-integration"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orandin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-11T18:15:54.000Z","updated_at":"2024-03-28T04:24:41.000Z","dependencies_parsed_at":"2022-09-14T07:51:35.545Z","dependency_job_id":null,"html_url":"https://github.com/orandin/sentrus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orandin%2Fsentrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orandin%2Fsentrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orandin%2Fsentrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orandin%2Fsentrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orandin","download_url":"https://codeload.github.com/orandin/sentrus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228328725,"owners_count":17902970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logrus","logrus-hook","sentry-integration"],"created_at":"2024-10-15T14:12:19.729Z","updated_at":"2024-12-05T15:40:53.102Z","avatar_url":"https://github.com/orandin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentrus\n\n`Sentrus` provides a [Sentry](https://sentry.io) hook for the logrus package, using the latest Sentry SDK (`sentry-go`).\nExtensible, it can be integrated with a variety of popular frameworks and packages in the Go ecosystem.\n\n## Usage\n\n```go\nimport(\n    \"github.com/getsentry/sentry-go\"\n    \"github.com/sirupsen/logrus\"\n    \"github.com/orandin/sentrus\"\n)\n\n// Sentry init\nif err := sentry.Init(sentry.ClientOptions{Dsn: \"YOUR_DSN\"}); err != nil {\n    logger.WithError(err).Fatal(\"Cannot initiate Sentry\")\n}\ndefer sentry.Flush(2 * time.Second)\n\n// Add Sentrus hook\nloggrus.AddHook(sentrus.NewHook(\n    []logrus.Level{logrus.WarnLevel, logrus.ErrorLevel},\n\n    // Optional: add tags to add in each Sentry event\n    sentrus.WithTags(map[string]string{\"foo\": \"bar\"}),\n\n    // Optional: set custom CaptureLog function\n    sentrus.WithCustomCaptureLog(sentrus.DefaultCaptureLog),\n))\n\nlogrus.Info(\"foo\") // Not sent to Sentry\nlogrus.Warn(\"bar\") // Sent to Sentry\n\n// With an error\nerr := fmt.Errorf(\"awesome error\")\n\nlogrus.WithError(err).Info(\"foo with an error\") // Not sent to Sentry\nlogrus.WithError(err).Warn(\"bar with an error\") // Sent to Sentry\n```\n\n### Integration with a framework\n\nLike `Sentry`, `Sentrus` can be integrated with a variety of popular frameworks and packages in the Go ecosystem. For more detailed \ninformation, checkout the guides:\n\n- [net/http](http/README.md)\n- [fasthttp](fasthttp/README.md)\n- [gin](gin/README.md)\n\n#### An integration with a framework or package is missing?\n\n`Sentrus` is **extensible**. You can develop custom `CaptureLog` functions to format and push the Sentry events. Don't \nhesitate to look the code of already existing integrations and feel free to contribute.\n\n### Stack traces improvement\n\nBy default, `Sentrus` and `Logrus` will be considered by Sentry SDK as part of your application in stack traces. The\nconsequence is to have stack traces less readable from Sentry UI. \n\nAt this time, `sentry-go` doesn't [make isInAppFrame customizable by clients](https://github.com/getsentry/sentry-go/issues/136). \nSo, a Sentry integration (`sentrus.IsNotInAppFrameIntegration`) has been created as a workaround, and it is activated \nautomatically when the hook is initialized. Each event will be modified to no longer consider `Sentrus` and `Logrus` as\npart of your application.\n\n## License\n\nLicensed under [MIT License](https://opensource.org/licenses/MIT), see [`LICENSE`](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forandin%2Fsentrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forandin%2Fsentrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forandin%2Fsentrus/lists"}