Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Natchez to Otel4s #3

Merged
merged 23 commits into from
Dec 5, 2023
Merged

Migrate from Natchez to Otel4s #3

merged 23 commits into from
Dec 5, 2023

Conversation

rossabaker
Copy link
Member

This is a resumption of davenverse/natchez-http4s-otel#73 in the new home for the otel4s port.

Copy link
Contributor

@NthPortal NthPortal left a comment

Choose a reason for hiding this comment

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

it looks... correct? admittedly I mostly did replacements of natchez stuff with otel4s, and tried to touch the actual implementation as little as possible otherwise. also, as one of the authors, I feel weird approving this, but at the same time... who else? 🤷‍♀️

build.sbt Outdated Show resolved Hide resolved
Comment on lines +8 to +16
implicit val headersTMU: TextMapUpdater[Headers] =
(carrier: Headers, key: String, value: String) => carrier.put(Header.Raw(CIString(key), value))
implicit val headersTMG: TextMapGetter[Headers] =
new TextMapGetter[Headers] {
def get(carrier: Headers, key: String): Option[String] =
carrier.get(CIString(key)).map(_.head.value)
def keys(carrier: Headers): Iterable[String] =
carrier.headers.view.map(_.name).distinct.map(_.toString).toSeq
}
Copy link
Contributor

Choose a reason for hiding this comment

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

these should ideally be in http4s itself, but that may not happen for quite a bit as otel4s isn't nearly as stable as http4s yet. should be perhaps have a couple modules, like http4s-otel4s-core and http4s-otel4s-middleware, and these could live in a core module until they make it into http4s proper?

examples/src/main/scala/example/Common.scala Outdated Show resolved Hide resolved
rossabaker and others added 2 commits November 30, 2023 12:38
Co-authored-by: Marissa | April <7505383+NthPortal@users.noreply.github.com>
@rossabaker
Copy link
Member Author

Hmm, there are still compile errors.

@NthPortal
Copy link
Contributor

I forgot that things got moved around a bunch before the release. lemme merge main to fix the conflicts and then fix the imports

@NthPortal NthPortal merged commit a4de852 into main Dec 5, 2023
10 checks passed
@NthPortal NthPortal deleted the otel4s branch December 5, 2023 18:34
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.

3 participants