{"id":36417989,"url":"https://github.com/periskop-dev/periskop-scala","last_synced_at":"2026-01-14T03:03:17.604Z","repository":{"id":46445220,"uuid":"226355917","full_name":"periskop-dev/periskop-scala","owner":"periskop-dev","description":"Scala low level client for Periskop","archived":false,"fork":false,"pushed_at":"2022-01-24T15:04:02.000Z","size":87,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":55,"default_branch":"master","last_synced_at":"2023-07-04T09:26:35.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/periskop-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-06T15:18:29.000Z","updated_at":"2022-02-04T10:27:18.000Z","dependencies_parsed_at":"2022-09-26T18:00:48.903Z","dependency_job_id":null,"html_url":"https://github.com/periskop-dev/periskop-scala","commit_stats":null,"previous_names":["soundcloud/periskop-scala"],"tags_count":4,"template":null,"template_full_name":null,"purl":"pkg:github/periskop-dev/periskop-scala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/periskop-dev%2Fperiskop-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/periskop-dev%2Fperiskop-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/periskop-dev%2Fperiskop-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/periskop-dev%2Fperiskop-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/periskop-dev","download_url":"https://codeload.github.com/periskop-dev/periskop-scala/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/periskop-dev%2Fperiskop-scala/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-11T17:00:37.966Z","updated_at":"2026-01-14T03:03:17.597Z","avatar_url":"https://github.com/periskop-dev.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Periskop Scala Client\n\n[![Build Status](https://api.cirrus-ci.com/github/periskop-dev/periskop-scala.svg)](https://cirrus-ci.com/github/periskop-dev/periskop-scala)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.periskopdev/periskop-scala_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.periskopdev/periskop-scala_2.12)\n\n[Periskop](https://github.com/periskop-dev/periskop) requires collecting and aggregating exceptions on the client side,\nas well as exposing them via an HTTP endpoint using a well defined format.\n\nThis library provides low level collection and rendering capabilities. Higher level libraries can be built be\nfor better integration with specific libraries and frameworks.\n\n## Usage\n\nAdd `periskop-scala` to your SBT dependencies:\n\n```scala\nlibraryDependencies += \"io.github.periskop-dev\" %% \"periskop-scala\" % \"\u003cversion\u003e\"\n````\n\nCreate an exception collector instance:\n\n```scala\nval exceptionCollector = new ExceptionCollector\n```\n\nCollect some exceptions:\n\n```scala\n// An Exception Without Context\nexceptionCollector.add(new RuntimeException(\"ups!\"))\n\n// A Message Without Context\nexceptionCollector.addMessage(\"key\", \"some message\")\n\n// An Exception With Context\nexceptionCollector.addWithContext(\n  ExceptionWithContext(\n    throwable = new RuntimeException(\"another ups!\"),\n    severity = Severity.Warning,\n    httpContext = Some(HttpContext(\n      requestMethod = \"GET\",\n      requestUrl = \"http://example.com/path?foo=bar\",\n      requestHeaders = Map(\"Accept\" -\u003e \"text/plain\"),\n      requestBody = Some(\"body\")\n    )))\n)\n\n// A Message With Context\nexceptionCollector.addWithContext(\n  ExceptionMessage(\n    aggregationKey = \"key2\",\n    message = \"some other message\",\n    severity = Severity.Info,\n    httpContext = Some(HttpContext(\n      requestMethod = \"GET\",\n      requestUrl = \"http://example.com/path?foo=bar\",\n      requestHeaders = Map(\"Accept\" -\u003e \"text/plain\"),\n      requestBody = Some(\"body\")\n    )))\n)\n```\n\nExport the exceptions to a format understandable by Periskop:\n\n```scala\nval exporter = new ExceptionExporter(exceptionCollector)\nexporter.export\n```\n\nThe exported exceptions need to be exposed via an HTTP endpoint in order for Periskop to be able to scrape them.\nSee [Periskop Documentation](https://github.com/periskop-dev/periskop) for more information on how to configure a\nPeriskop server.\n\n### Using push gateway\n\nYou can also use [pushgateway](https://github.com/periskop-dev/periskop-pushgateway) in case you want to push your metrics \ninstead of using pull method. Use only in case you really need it (e.g a batch job) as it could degrade the performance\nof your application. In the following example, we assume that we deployed an instance of periskop-pushgateway \non `http://localhost:6767`:\n\n```scala\nval exporter = new ExceptionExporter(exceptionCollector)\nexceptionCollector.add(new RuntimeException(\"ups!\"))\nexporter.pushToGateway(\"http://localhost:6767\")\n```\n\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperiskop-dev%2Fperiskop-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperiskop-dev%2Fperiskop-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperiskop-dev%2Fperiskop-scala/lists"}