{"id":35672370,"url":"https://github.com/bborbe/sentry","last_synced_at":"2026-01-05T19:04:03.886Z","repository":{"id":233431674,"uuid":"787036343","full_name":"bborbe/sentry","owner":"bborbe","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-09T10:33:02.000Z","size":5821,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T12:36:07.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bborbe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-15T19:10:58.000Z","updated_at":"2025-12-09T10:33:06.000Z","dependencies_parsed_at":"2024-04-16T06:38:42.256Z","dependency_job_id":"fd1adfb3-1fb0-425e-9df5-fb32138e0fb0","html_url":"https://github.com/bborbe/sentry","commit_stats":null,"previous_names":["bborbe/sentry"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/bborbe/sentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Fsentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Fsentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Fsentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Fsentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bborbe","download_url":"https://codeload.github.com/bborbe/sentry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bborbe%2Fsentry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28218058,"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","status":"online","status_checked_at":"2026-01-05T02:00:06.358Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-01-05T19:02:14.353Z","updated_at":"2026-01-05T19:03:59.693Z","avatar_url":"https://github.com/bborbe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentry\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/bborbe/sentry.svg)](https://pkg.go.dev/github.com/bborbe/sentry)\n[![CI](https://github.com/bborbe/sentry/actions/workflows/ci.yml/badge.svg)](https://github.com/bborbe/sentry/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bborbe/sentry)](https://goreportcard.com/report/github.com/bborbe/sentry)\n\nA Go library that provides an enhanced wrapper around the [Sentry Go SDK](https://github.com/getsentry/sentry-go) with additional functionality for error exclusion, automatic tag enrichment, and context data extraction.\n\n## Features\n\n- **Automatic Tag Enrichment**: Extracts data from context and errors to add as Sentry tags\n- **Error Filtering**: Configurable error exclusion to prevent noise\n- **Context Integration**: Uses `github.com/bborbe/errors` for context data extraction\n- **Proxy Support**: HTTP transport wrapper for proxy configurations\n- **Type-Safe Interface**: Clean interface abstraction with mock generation support\n\n## Installation\n\n```bash\ngo get github.com/bborbe/sentry\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"time\"\n\n    \"github.com/bborbe/errors\"\n    \"github.com/bborbe/sentry\"\n    \"github.com/getsentry/sentry-go\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    // Create client with options\n    client, err := sentry.NewClient(ctx, sentry.ClientOptions{\n        Dsn: \"your-sentry-dsn-here\",\n        Tags: map[string]string{\n            \"service\": \"my-app\",\n            \"version\": \"1.0.0\",\n        },\n    })\n    if err != nil {\n        panic(err)\n    }\n    defer func() {\n        client.Flush(2 * time.Second)\n        client.Close()\n    }()\n\n    // Add context data\n    ctx = errors.AddToContext(ctx, \"user_id\", \"12345\")\n    \n    // Create error with data\n    err = errors.AddDataToError(\n        errors.New(\"something went wrong\"),\n        map[string]string{\"operation\": \"user_login\"},\n    )\n\n    // Capture exception with automatic tag enrichment\n    client.CaptureException(err, \u0026sentry.EventHint{\n        Context: ctx,\n        Data: map[string]interface{}{\n            \"request_id\": \"req-abc123\",\n            \"retries\": 3,\n        },\n    }, sentry.NewScope())\n}\n```\n\n## Core Components\n\n### Client Interface\n\nThe main interface provides these methods:\n\n```go\ntype Client interface {\n    CaptureMessage(message string, hint *sentry.EventHint, scope sentry.EventModifier) *sentry.EventID\n    CaptureException(exception error, hint *sentry.EventHint, scope sentry.EventModifier) *sentry.EventID\n    Flush(timeout time.Duration) bool\n    io.Closer\n}\n```\n\n### Error Exclusion\n\nFilter out specific errors to reduce noise:\n\n```go\nexcludeFunc := func(err error) bool {\n    return errors.Is(err, context.Canceled)\n}\n\nclient, err := sentry.NewClient(ctx, clientOptions, excludeFunc)\n```\n\n### Automatic Tag Enrichment\n\nThe client automatically extracts and adds tags from:\n- Context data (using `github.com/bborbe/errors`)\n- Error data (attached to errors)\n- Hint data (passed in EventHint)\n\n## API Documentation\n\nFor detailed API documentation, visit [pkg.go.dev/github.com/bborbe/sentry](https://pkg.go.dev/github.com/bborbe/sentry).\n\n## Dependencies\n\nThis library integrates closely with:\n- **github.com/bborbe/errors**: Enhanced context and error data extraction\n- **github.com/getsentry/sentry-go**: Official Sentry Go SDK (v0.36.0+)\n\nThe integration with `bborbe/errors` enables automatic extraction of context data and error metadata as Sentry tags.\n\n## Development\n\n### Running Tests\n```bash\nmake test\n```\n\n### Code Generation (Mocks)\n```bash\nmake generate\n```\n\n### Full Pre-commit Workflow\n```bash\nmake precommit  # Format, generate, test, and lint\n```\n\n## License\n\nThis project is licensed under the BSD-style license. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbborbe%2Fsentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbborbe%2Fsentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbborbe%2Fsentry/lists"}