{"id":34546693,"url":"https://github.com/fehu/opentracing-scala","last_synced_at":"2025-12-24T07:10:02.846Z","repository":{"id":40761361,"uuid":"176665397","full_name":"fehu/opentracing-scala","owner":"fehu","description":"Functional interface for opentracing and its implementation, based on cats.data.StateT.","archived":false,"fork":false,"pushed_at":"2022-07-31T18:19:03.000Z","size":345,"stargazers_count":3,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-11T14:56:23.004Z","etag":null,"topics":["cats-effect","functional-programming","opentracing","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/fehu.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}},"created_at":"2019-03-20T06:01:58.000Z","updated_at":"2022-10-15T01:26:27.000Z","dependencies_parsed_at":"2022-07-12T18:03:24.884Z","dependency_job_id":null,"html_url":"https://github.com/fehu/opentracing-scala","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/fehu/opentracing-scala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehu%2Fopentracing-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehu%2Fopentracing-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehu%2Fopentracing-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehu%2Fopentracing-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fehu","download_url":"https://codeload.github.com/fehu/opentracing-scala/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehu%2Fopentracing-scala/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27997217,"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-12-24T02:00:07.193Z","response_time":83,"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":["cats-effect","functional-programming","opentracing","scala"],"created_at":"2025-12-24T07:09:51.449Z","updated_at":"2025-12-24T07:10:02.827Z","avatar_url":"https://github.com/fehu.png","language":"Scala","readme":"# opentracing-scala\n\nFunctional interface for opentracing and its implementation, based on `cats.data.StateT`.\n\n[![opentracing-scala-core Scala version support](https://index.scala-lang.org/fehu/opentracing-scala/opentracing-scala-core/latest-by-scala-version.svg?platform=jvm)](https://index.scala-lang.org/fehu/opentracing-scala/opentracing-scala-core)\n\n# `opentracing-scala-core`\n\nRequires `cats-effect` **3**.\n\nSupports scala `2.13` and `3.1`.\n\n### `Traced[F[_]]` typeclass\n[Code](core/src/main/scala/io/github/fehu/opentracing/Traced.scala)\n\n- Lifting values and effects through `pure` and `defer`.\n- Creating new spans (`extends Traced.Interface[F]`)\n```scala\n    def apply[A](op: String, tags: Traced.Tag*)(fa: F[A]): F[A]\n    def spanResource(op: String, tags: Traced.Tag*): Resource[F, ActiveSpan]\n\n    def withParent(span: ActiveSpan | SpanContext): Interface[F]\n    def withoutParent: Interface[F]\n```\n- Accessing `currentSpan` through `Traced.SpanInterface[F]`\n```scala\n    def context: F[Option[SpanContext]]\n\n    def setOperation(op: String): F[Unit]\n    def setTag(tag: Traced.Tag): F[Unit]\n    def setTags(tags: Traced.Tag*): F[Unit]\n\n    def log(fields: (String, Any)*): F[Unit]\n    def log(event: String): F[Unit]\n\n    def setBaggageItem(key: String, value: String): F[Unit]\n    def getBaggageItem(key: String): F[Option[String]]\n```\n- Setting current span\n```scala\n  def forceCurrentSpan(active: Traced.ActiveSpan): F[Traced.SpanInterface[F]]\n  /** Sets `active` span if no other is set. */\n  def recoverCurrentSpan(active: Traced.ActiveSpan): F[Traced.SpanInterface[F]]\n```\n- Transferring span context\n```scala\n  def injectContext(context: SpanContext): Traced.Interface[F]\n  def injectContextFrom(carrier: Propagation#Carrier): Traced.Interface[F]\n  def extractContext[C \u003c: Propagation#Carrier](carrier: C): F[Option[C]]\n```\n\n### `Traced2[T[_[_], _], F[_]]` typeclass\n`extends Traced[T[F, _]]`\n\nDefines tracing over transformer `T[F, _]`, allowing to run and lift `T[F, _] \u003c~\u003e F`\n```scala\n  def currentRunParams: T[F, Traced.RunParams]\n  def run[A](traced: T[F, A], params: Traced.RunParams): F[A]\n\n  def lift[A](ua: F[A]): T[F, A]\n  def mapK[G[_]](f: F ~\u003e G): T[F, _] ~\u003e T[G, _]\n```\n\n**Running** the transformer requires\n- currently active span\n- setup\n  - tracer\n  - `beforeStart`, `justAfterStart`, `beforeStop` hooks (`Traced.Hooks`)\n  - error logger\n\nDefault setups can be obtained at `Traced.Setup.default(_: Tracer)` or\n- `Jaeger` (in `opentracing-scala-jaeger`) module\n- `NoOp` (in `opentracing-scala-noop`) module\n\n### Propagation\nSupport for\n- `BinaryPropagation`\n- `TextMapPropagation`\n\n### Syntax\n`import io.github.fehu.opentracing.syntax._`\n\n_TODO_\n\n## `TracedT[F[_], A]`\nTraced transformer implementation with underlying `cats.data.StateT`.\n\nProvides instances of most `cats.effect` typeclasses and a `Dispatcher` for `TracedT[IO, A]`.\n\n# `opentracing-scala-*`\nOther modules:\n- `opentracing-scala-akka` - `TracingActor` and `ask(actor, message).trace(...)` syntax.\n- `opentracing-scala-fs2` - Syntax extensions for fs2 at `io.github.fehu.opentracing.syntax.FS2`.\n- `opentracing-scala-jaeger` - Setup helper for `io.jaegertracing`.\n- `opentracing-scala-noop` - No-op setup.\n\n\n# `opentracing-scalac-implicits-jaeger` (Scala 2 only)\n\n**Compiler plugin** that traces _implicit searches_ performed by scalac\nand reports them to local jaegertracing backend.\n\n\n#### Usage\n- Put to your `build.sbt`\n    ```sbtshell\n    addCompilerPlugin(\"io.github.fehu\" %% \"opentracing-scalac-implicits-jaeger\" % \"0.1.4\"  cross CrossVersion.full)\n    ```\n- Run, for example, [all-in-one](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one) jaeger backend with docker\n- Compile your project\n- See the traces at http://localhost:16686\n\n# `TracingPlugin` (Scala 3)\n\n**Compiler plugin** that traces _implicit searches_ performed by scalac\nand reports them to local jaegertracing backend.\n\n\n#### Usage\n- Put to your `build.sbt`\n    ```sbtshell\n    addCompilerPlugin(\"io.github.fehu\" %% \"scala3-compiler-tracing-jaeger\" % \"0.1.0\")\n    ```\n- Since this is a [research plugin](https://docs.scala-lang.org/scala3/reference/changed-features/compiler-plugins.html),\n  you would need to use `NIGHTLY` scala compiler.\n  You can find the version at [maven](https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/).\n\nNote: it doesn't work with `graalvm` java.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffehu%2Fopentracing-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffehu%2Fopentracing-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffehu%2Fopentracing-scala/lists"}