{"id":19600318,"url":"https://github.com/kamon-io/kamon-http4s","last_synced_at":"2025-10-13T04:33:01.448Z","repository":{"id":47635767,"uuid":"107596410","full_name":"kamon-io/kamon-http4s","owner":"kamon-io","description":"Kamon Integration for http4s","archived":false,"fork":false,"pushed_at":"2024-06-05T13:20:01.000Z","size":389,"stargazers_count":53,"open_issues_count":11,"forks_count":29,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-25T13:34:14.759Z","etag":null,"topics":["instrumentation","kamon","metrics","tracing"],"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/kamon-io.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-19T20:40:51.000Z","updated_at":"2024-09-11T16:27:07.000Z","dependencies_parsed_at":"2025-04-27T16:42:43.193Z","dependency_job_id":null,"html_url":"https://github.com/kamon-io/kamon-http4s","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/kamon-io/kamon-http4s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamon-io%2Fkamon-http4s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamon-io%2Fkamon-http4s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamon-io%2Fkamon-http4s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamon-io%2Fkamon-http4s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamon-io","download_url":"https://codeload.github.com/kamon-io/kamon-http4s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamon-io%2Fkamon-http4s/sbom","scorecard":{"id":548968,"data":{"date":"2025-08-11","repo":{"name":"github.com/kamon-io/kamon-http4s","commit":"1bc5f413c413413262e1ffe0b9551770ff23962e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":4,"reason":"Found 6/14 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T10:16:37.828Z","repository_id":47635767,"created_at":"2025-08-20T10:16:37.828Z","updated_at":"2025-08-20T10:16:37.828Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013685,"owners_count":26085390,"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":"2025-10-13T02:00:06.723Z","response_time":61,"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":["instrumentation","kamon","metrics","tracing"],"created_at":"2024-11-11T09:14:25.048Z","updated_at":"2025-10-13T04:33:01.433Z","avatar_url":"https://github.com/kamon-io.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kamon http4s \u003cimg align=\"right\" src=\"https://rawgit.com/kamon-io/Kamon/master/kamon-logo.svg\" height=\"150px\" style=\"padding-left: 20px\"/\u003e\n[![Discord](https://img.shields.io/discord/866301994074243132?label=Join%20the%20Comunity%20on%20Discord)](https://discord.gg/5JuYsDJ7au)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.kamon/kamon-http4s-0.23_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.kamon/kamon-http4s_2.12)\n\n\n### Getting Started\n\nThe `kamon-http4s-\u003cversion\u003e` module brings traces and metrics to your [http4s][4] based applications.\n\nIt is currently available for Scala 2.12, 2.13, and 3.x, depending on the http4s version. The current\nversion supports Kamon 2.6.1 and is published for http4s 0.22, 0.23, and 1.0.\n\n| kamon | kamon-http4s  | status | jdk  | scala | http4s\n|:-----:|:------:|:------:|:----:|--------------:|-------\n| 2.6.x |  2.6.1 | stable | 8+ | 2.12, 2.13 | 0.22.x\n| 2.6.x |  2.6.1 | stable | 8+ | 2.12, 2.13, 3.x | 0.23.x\n| 2.6.x |  2.6.1 | stable | 8+ | 2.13, 3.x | 1.0.M31+\n\nTo get started with sbt, simply add the following to your `build.sbt` file, for instance for http4s 0.23:\n\n```scala\nlibraryDependencies += \"io.kamon\" %% \"kamon-http4s-0.23\" % \"2.6.1\"\n```\n\nThe releases and dependencies for the legacy module `kamon-http4s` (without http4s version) are shown below.\n\n| kamon-http4s  | status | jdk  | scala | http4s            \n|:------:|:------:|:----:|--------------:|-------\n|  1.0.8-1.0.10 | stable | 8+ | 2.11, 2.12 | 0.18.x\n|  1.0.13 | stable | 8+ | 2.11, 2.12 | 0.20.x\n|  2.0.0 | stable | 8+ | 2.11, 2.12 | 0.20.x\n|  2.0.1 | stable | 8+ | 2.12, 2.13 | 0.21.x\n\n\n## Metrics and Tracing for http4s in 2 steps\n\n### The Server\n\n```scala\ndef serve[F[_]](implicit Effect: Effect[F], EC: ExecutionContext) : Stream[F, StreamApp.ExitCode] =\n    for {\n      _ \u003c- Stream.eval(Sync[F].delay(println(\"Starting Google Service with Client\")))\n      client \u003c- Http1Client.stream[F]()\n      service = GoogleService.service[F](middleware.client.KamonSupport(client)) (1)\n      exitCode \u003c- BlazeBuilder[F]\n        .bindHttp(Config.server.port, Config.server.interface)\n        .mountService(middleware.server.KamonSupport(service)) (2)\n        .serve\n    } yield exitCode\n```\n\n* __(1)__: The Kamon [Middleware][5] for the `Client` side.\n* __(2)__: The Kamon [Middleware][6] for the `Server` side.\n\n### The Service\n\n```scala\nobject GoogleService {\n  def service[F[_]: Effect](c: Client[F]): HttpService[F] = {\n    val dsl = new Http4sDsl[F]{}\n    import dsl._\n\n    HttpService[F] {\n      case GET -\u003e Root / \"call-google\" =\u003e\n        Ok(c.expect[String](\"https://www.google.com.ar\"))\n    }\n  }\n}\n```\n\n### Step 1: Add the Kamon Libraries\n```scala\nlibraryDependencies ++= Seq(\n  \"io.kamon\" %% \"kamon-core\" % \"2.6.1\",\n  \"io.kamon\" %% \"kamon-http4s-0.23\" % \"2.6.1\",\n  \"io.kamon\" %% \"kamon-prometheus\" % \"2.6.1\",\n  \"io.kamon\" %% \"kamon-zipkin\" % \"2.6.1\",\n  \"io.kamon\" %% \"kamon-jaeger\" % \"2.6.1\"\n)\n```\n\n### Step 2: Start Reporting your Data\n\nSince version 2.0, Kamon reporters are started automatically through their default configuration.\nNow you can simply `sbt run` the application and after a few seconds you will get the Prometheus metrics\nexposed on \u003chttp://localhost:9095/\u003e and message traces sent to Zipkin! The default configuration publishes the Prometheus\nendpoint on port 9095 and assumes that you have a Zipkin instance running locally on port 9411 but you can change these\nvalues under the `kamon.prometheus` and `kamon.zipkin` configuration keys, respectively.\n\n\n#### Metrics\n\nAll you need to do is [configure a scrape configuration in Prometheus][3]. The following snippet is a minimal\nexample that should work with the minimal server from the previous section.\n\n```yaml\nA minimal Prometheus configuration snippet\n------------------------------------------------------------------------------\nscrape_configs:\n  - job_name: 'kamon-prometheus'\n    static_configs:\n      - targets: ['localhost:9095']\n------------------------------------------------------------------------------\n```\n\nOnce you configure this target in Prometheus you are ready to run some queries like this:\n\n\u003cimg class=\"img-fluid\" src=\"/doc/img/http4smetrics.png\"\u003e\n\nThose are the `Server Metrics` metrics that we are gathering by default:\n\n* __active-requests__: The the number active requests.\n* __http-responses__: Response time by status code.\n* __abnormal-termination__: The number of abnormal requests termination.\n* __service-errors__: The number of service errors.\n* __headers-times__: The number of abnormal requests termination.\n* __http-request__: Request time by status code.\n\nNow you can go ahead, make your custom metrics and create your own dashboards!\n\n#### Traces\n\nAssuming that you have a Zipkin instance running locally with the default ports, you can go to \u003chttp://localhost:9411\u003e\nand start investigating traces for this application. Once you find a trace you are interested in you will see something\nlike this:\n\n\u003cimg class=\"img-fluid\" src=\"/doc/img/traces.png\"\u003e\n\nClicking on a span will bring up a details view where you can see all tags for the selected span:\n\n\u003cimg class=\"img-fluid\" src=\"/doc/img/detail.png\"\u003e\n\n\n### Enjoy!\n\nThat's it, you are now collecting metrics and tracing information from a [http4s][4] application.\n\n### Useful links:\n\n[Example of how to correctly configure the execution context][7] by @cmcmteixeira\n\n[1]: https://github.com/sbt/sbt-javaagent\n[2]: https://github.com/kamon-io/kamon-agent\n[3]: http://prometheus.io/docs/operating/configuration/#scrape-configurations-scrape_config\n[4]: http://http4s.org\n[5]: https://github.com/kamon-io/kamon-http4s/blob/master/src/main/scala/kamon/http4s/middleware/client/KamonSupport.scala\n[6]: https://github.com/kamon-io/kamon-http4s/blob/master/src/main/scala/kamon/http4s/middleware/server/KamonSupport.scala\n[7]: https://github.com/cmcmteixeira/http4s-traceid\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamon-io%2Fkamon-http4s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamon-io%2Fkamon-http4s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamon-io%2Fkamon-http4s/lists"}