{"id":16385162,"url":"https://github.com/jsynowiec/good-sentry","last_synced_at":"2025-06-13T07:04:31.422Z","repository":{"id":57117224,"uuid":"73378080","full_name":"jsynowiec/good-sentry","owner":"jsynowiec","description":"Sentry broadcasting for good process monitor","archived":false,"fork":false,"pushed_at":"2020-07-16T07:21:50.000Z","size":728,"stargazers_count":15,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T08:27:38.002Z","etag":null,"topics":["good","hapi","hapi-good","hapi-raven","hapi-sentry","hapijs","logging","raven","sentry","sentry-client"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jsynowiec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["jsynowiec"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-11-10T12:01:07.000Z","updated_at":"2023-11-03T17:12:37.000Z","dependencies_parsed_at":"2022-08-23T04:40:31.221Z","dependency_job_id":null,"html_url":"https://github.com/jsynowiec/good-sentry","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/jsynowiec/good-sentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsynowiec%2Fgood-sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsynowiec%2Fgood-sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsynowiec%2Fgood-sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsynowiec%2Fgood-sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsynowiec","download_url":"https://codeload.github.com/jsynowiec/good-sentry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsynowiec%2Fgood-sentry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259599318,"owners_count":22882351,"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":["good","hapi","hapi-good","hapi-raven","hapi-sentry","hapijs","logging","raven","sentry","sentry-client"],"created_at":"2024-10-11T04:13:53.782Z","updated_at":"2025-06-13T07:04:31.358Z","avatar_url":"https://github.com/jsynowiec.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jsynowiec"],"categories":[],"sub_categories":[],"readme":"# good-sentry\n\n[Sentry](https://sentry.io) broadcasting for [good](https://github.com/hapijs/good) process monitor.\n\n`good-sentry` is a write stream used to send [hapi](https://github.com/hapijs/hapi) server events to a Sentry server. \n\n[![Current Version](https://img.shields.io/npm/v/good-sentry.svg)](https://www.npmjs.com/package/good-sentry)\n[![Build Status](https://travis-ci.org/jsynowiec/good-sentry.svg?branch=master)](https://travis-ci.org/jsynowiec/good-sentry)\n[![License][badge-license]][license]\n\n## Usage\n### `new GoodSentry ([options])`\n\nCreates a new GoodSentry object with the following arguments:\n\n- `[options]` - optional configuration object with the following keys\n  - `[dsn]` - Sentry project's Data Source Name. Defaults to `null` but expects `SENTRY_DSN` environment variable to be set.\n  - `[config]` - optional configuration object with the following keys\n    - `[name]` - The name of the logger used by Sentry. Defaults to hostname. Optionally set the name using `SENTRY_NAME` environment variable.\n    - `[logger]` - The name of the Sentry client. Defaults to ''.\n    - `[release]` - The version/release of your application. Defaults to ''. Optionally set the release using `SENTRY_RELEASE` environment variable.\n    - `[environment]` - The environment name of your application. Defaults to ''. Optionally set the environment using `SENTRY_ENVIRONMENT` environment variable.\n  - `[captureUncaught]` - Enable global error handling. Defaults to `false`.\n\n### Tags\n\nBecause [Hapi tags](https://hapijs.com/tutorials/logging) are an array of strings and Sentry expects tags to be a k/v map, `good-sentry` sets all tags associated with an event to `tag: true` pairs. Those are nicely displayed in the tags section of Sentry web interface:\n\n![Tags in Sentry](assets/sentry-issue-tags.png)\n\n### Example Usage\n\n```javascript\nconst Hapi = require('hapi');\nconst version = require('package.json').version;\nconst server = new Hapi.Server();\nserver.connection();\n\nconst options = {\n  reporters: {\n    mySentryReporter: [{\n      module: 'good-squeeze',\n      name: 'Squeeze',\n      args: [{ log: '*' }],\n    }, {\n      module: 'good-sentry',\n      args: [ {\n        dsn: 'https://\u003ckey\u003e:\u003csecret\u003e@sentry.io/\u003cproject\u003e',\n        config: {\n          name: 'myAwesomeHapiServer',\n          logger: 'mySentryReporter',\n          release: version,\n          environment: process.env.NODE_ENV,\n        },\n        captureUncaught: true,\n      }],\n    }],\n  },\n};\n\nserver.register({\n    register: require('good'),\n    options,\n}, (err) =\u003e {\n  server.start(() =\u003e {\n    server.log([], 'Sample debug event.');\n    server.log(['debug'], 'Sample tagged debug event.');\n    server.log(['info'], 'Sample info event.');\n    server.log(['warning', 'server'], 'Sample warning event with tags.');\n    server.log(['error', 'first-tag', 'second-tag'], 'Sample error event with tags.');\n    \n    // Throw an error after 5 seconds\n    setTimeout(() =\u003e {\n      throw new Error('An uncaught error');\n    }, 5000);\n  });\n});\n```\n\nThis example sets up the reporter named mySentryReporter to listen for server events and send them to a Sentry project with additional settings.\n\n## License\nReleased under the [MIT license][license].\n\n[license]: https://raw.githubusercontent.com/jsynowiec/good-sentry/master/LICENSE\n[badge-license]: https://img.shields.io/github/license/jsynowiec/good-sentry.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsynowiec%2Fgood-sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsynowiec%2Fgood-sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsynowiec%2Fgood-sentry/lists"}