Skip to content

Use TracerProvider and MeterProvider instead of Tracer and Meter - #1352

Open
iRevive wants to merge 2 commits into
typelevel:mainfrom
iRevive:topic/otel4s-improvements
Open

Use TracerProvider and MeterProvider instead of Tracer and Meter#1352
iRevive wants to merge 2 commits into
typelevel:mainfrom
iRevive:topic/otel4s-improvements

Conversation

@iRevive

@iRevive iRevive commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Motivation

OpenTelemetry recommends libraries to own their instrumentation scopes.
A few benefits:

  1. Full control of the namespace - the traces & metrics will belong to the org.typelevel.skunk - which simplifies the filtering
  2. Every release will be reflected in the instrumentation scope version - much easier to spot regressions and filter traces/metrics if needed

https://opentelemetry.io/docs/concepts/instrumentation-scope/

For libraries and frameworks: use the library’s fully qualified name and version as the scope. If you are writing an instrumentation library for a library that has no built-in OpenTelemetry support, use the name and version of the instrumentation library itself.

@iRevive

iRevive commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Second step: introduce a proper Telemetry abstraction, where we can unify all telemetry ops: internal/db/pool traces, metrics, and so on.

* single-session pool.
* @see pooledF
*/
@deprecated("Use Session.Builder[F].singleExplicitTracer instead", "1.0.0-M11")

@iRevive iRevive Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep it, we need to change the signature to:

def singleF[F[_]: Temporal: Network: Console](
  ...
): Telemetry[F] => Resource[F, Session[F]]

Comment thread build.sbt
Comment on lines +24 to +30
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Run(
commands = List("/home/linuxbrew/.linuxbrew/bin/brew update"),
name = Some("Update brew"),
cond = Some("startsWith(matrix.os, 'ubuntu')")
)
) ++ nativeBrewInstallWorkflowSteps.value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'm starting to think the update step is not necessary, since other branches somehow work 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant