{"id":20683173,"url":"https://github.com/chimehq/meterreporter","last_synced_at":"2025-04-22T12:23:36.931Z","repository":{"id":42466423,"uuid":"467538997","full_name":"ChimeHQ/MeterReporter","owner":"ChimeHQ","description":"Lightweight MetricKit-based diagnostics reporting","archived":false,"fork":false,"pushed_at":"2024-07-05T17:18:38.000Z","size":51,"stargazers_count":33,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-10T10:04:49.001Z","etag":null,"topics":["crash-reporting","diagnostics","ios","macos","tvos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChimeHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["mattmassicotte"]}},"created_at":"2022-03-08T14:11:01.000Z","updated_at":"2024-07-05T17:18:41.000Z","dependencies_parsed_at":"2024-07-05T18:55:34.906Z","dependency_job_id":null,"html_url":"https://github.com/ChimeHQ/MeterReporter","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.04347826086956519,"last_synced_commit":"9d82ab88218291c267477a8b53d74a05e81403bb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeHQ%2FMeterReporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeHQ%2FMeterReporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeHQ%2FMeterReporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChimeHQ%2FMeterReporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChimeHQ","download_url":"https://codeload.github.com/ChimeHQ/MeterReporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224974662,"owners_count":17401108,"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":["crash-reporting","diagnostics","ios","macos","tvos"],"created_at":"2024-11-16T22:15:39.482Z","updated_at":"2024-11-16T22:15:40.018Z","avatar_url":"https://github.com/ChimeHQ.png","language":"Swift","funding_links":["https://github.com/sponsors/mattmassicotte"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![Platforms][platforms badge]][platforms]\n[![Matrix][matrix badge]][matrix]\n\n\u003c/div\u003e\n\n# MeterReporter\nLightweight MetricKit-based diagnostics reporting.\n\nMeterReporter will capture MetricKit payloads and relay them to a backend. It uses [Meter](https://github.com/ChimeHQ/Meter) to process and symbolicate payloads. The resulting data is very close to the MetricKit JSON structure. But, it does add some fields to support the additional features.\n\n## Integration\n```swift\ndependencies: [\n    .package(url: \"https://github.com/ChimeHQ/MeterReporter\")\n]\n```\n\n## Usage\n\n```swift\nlet url = URL(string: \"https://my.backend.com/reports\")!\n\nvar config = MeterReporter.Configuration(endpointURL: url)\n\nconfig.hostIdentifier = Bundle.main.bundleIdentifier\n\nlet reporter = MeterReporter(configuration: config)\n\nreporter.start()\n```\n\n## Background Uploads\n\nBy default, MeterReporter uses `URLSession` background uploads for both reliability and performance. However, sometimes these can take **hours** for the OS to actually execute. This can be a pain if you are just testing things out. To make that easier, you can disable background uploads with another property of `MeterReporter.Configuration`.\n\n## NSException Capture\n\nMeterReporter can capture uncaught NSExceptions on macOS. Unfortunately, AppKit interfers with the flow of runtime exceptions. If you want to get this information about uncaught exceptions, some extra work is required.\n\nThe top-level `NSApplication` instance for your app must be a subclass of `ExceptionLoggingApplication`.\n\n```swift\nimport MeterReporter\n\nclass Application: ExceptionLoggingApplication {\n}\n```\n\nand, you must update your Info.plist to ensure that the `NSPrincipalClass` key references this class with `\u003cApp Module Name\u003e.Application`.\n\nI realize this is a huge pain. If you feel so motivated, please file feedback with Apple to ask them to make AppKit behave like UIKit in this respect.\n\nI would also strongly recommend setting the `NSApplicationCrashOnExceptions` defaults key to true. The default setting will allow your application to continue executing post-exception, virtually guaranteeing state corruption and incorrect behavior.\n\n## Submission Request\n\nThe request made to the endpoint will be an HTTP `PUT`. The request will also set some headers.\n\n- `Content-Type` will be `application/vnd.chimehq-mxdiagnostic`\n- `MeterReporter-Report-Id` will be a unique identifier\n- `MeterReporter-Platform`\n- `MeterReporter-Host-Id` if `configuration.hostIdentifier` is non-nil\n\nThe data itself is the result of Meter's `DiagnosticPayload.jsonRepresentation()`.\n\n## Suggestions or Feedback\n\nI would love to hear from you! Issues or pull requests work great. A [Matrix space][matrix] is also available for live help, but I have a strong bias towards answering in the form of documentation.\n\nI prefer collaboration, and would love to find ways to work together if you have a similar project.\n\nI prefer indentation with tabs for improved accessibility. But, I'd rather you use the system you want and make a PR than hesitate because of whitespace.\n\nBy participating in this project you agree to abide by the [Contributor Code of Conduct](CODE_OF_CONDUCT.md).\n\n[platforms]: https://swiftpackageindex.com/ChimeHQ/MeterReporter\n[platforms badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FChimeHQ%2FMeterReporter%2Fbadge%3Ftype%3Dplatforms\n[matrix]: https://matrix.to/#/%23chimehq%3Amatrix.org\n[matrix badge]: https://img.shields.io/matrix/chimehq%3Amatrix.org?label=Matrix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchimehq%2Fmeterreporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchimehq%2Fmeterreporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchimehq%2Fmeterreporter/lists"}