Giter Site home page Giter Site logo

kamon-http4s's Introduction

Kamon.io

Sources for the Kamon website.

Development

For installing requirements, read the Jekyll Docs.

To start the local server, run:

$ bundle install
$ bundle exec jekyll serve --livereload
  • by default, local server will be listening on port 4000.
  • bundle exec restricts the Ruby environment to only use gems set in the project's Gemfile.

For updating gem versions, run:

$ bundle update

kamon-http4s's People

Contributors

angel-o avatar bplommer avatar cmcmteixeira avatar dpsoft avatar garraspin avatar hygt avatar ivantopo avatar kciesielski avatar kubukoz avatar mladens avatar ptrlaszlo avatar rlebran avatar stsatlantis avatar vaslabs avatar widar91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kamon-http4s's Issues

Kamon looses context when http4s client raises an exception

If the http4s client raises an exception - e.g. when e.g. java.util.concurrent.TimeoutException is raised after setting connection timeout:

BlazeClientBuilder[F]
      .withRequestTimeout(100.millis)

then it seems that kamon context is lost, and e.g. traceId is not propagated to MDC for logging.

If there is not any exception but a request ending with e.g. 500, then it seems to be working fine.

Question about http4s 0.18.x support

The README says this update is "soon". We are building a new app using 0.18.x and we would like to provide Prometheus metrics from the service. Can you give us any idea when this update might be available? Thanks.

Kamon 2.0 support

Hey!

Is there any ETA on when kamon 2.0 will be supported in this module?

Update kamon-core

This project still depends on kamon-core 2.2.x. Can this be updated?

And in general @ivantopo - why is this not in kamon core repository like the rest of instrumentation? Should we consider this module as not maintained anymore?

The Context Headers are not properly propagated

  • The kamon context is always overridden because we are created each time a new context

this line:

scope <- F.delay(Kamon.storeContext(Context.create(Span.ContextKey, serverSpan)))

should be replaced by:

scope <- F.delay(Kamon.storeContext(incomingContext.withKey(Span.ContextKey, serverSpan)))

Release of 2.0.3

The current documentation doesn't reflect released versions.

Is it possible to release the version 2.1.0? If not, then I can fix the documentation.

Kamon context is not available to http4s logging middleware

The kamon context is not available to the http4s logging middleware. This can be seen by configuring logback to record the trace ID. There is a minimal reproduction at https://github.com/dangerousben/http4s-kamon-demo.

2021-01-20 08:32:39,752 [ioapp-compute-1] [2906519629fe1015] INFO Main$ In service
2021-01-20 08:32:39,945 [ioapp-compute-7] [undefined] INFO o.h.server.middleware.Logger HTTP/1.1 GET / Headers(Host: localhost:8080, User-Agent: HTTPie/1.0.3, Accept-Encoding: gzip, deflate, Accept: */*, Connection: keep-alive) body=""
2021-01-20 08:32:39,954 [ioapp-compute-6] [undefined] INFO o.h.server.middleware.Logger HTTP/1.1 200 OK Headers() body=""

The first log statement, within the service, includes the trace ID, but the following two from middleware.Logger do not.

Dynamic values in paths are not replaced with placeholders

Hi and thank you for this library!
I'm in the progress of migrating an application from akka-http to http4s and I noticed a behavioral difference.
While in akka-http paths are reported to Prometheus with a {} placeholder when the segment contains dynamic values (like integers), in http4s paths are reported literally:
For example:

with http4s:

/v1/organization/30755/authors/suggested

with akka-http:

/v1/organization/{}/authors/suggested

Is this intended? Can I configure Kamon to have the same behavior? In case it's a missing feature, are you willing to merge a PR implementing the change (maybe guiding me to show what needs to be changed)

Thank you!
Lorenzo

Blaze client loses context in callback

Hi!

I'm playing with kamon-http4s again and I'm trying to wrap the blaze client with the middleware. Unfortunately, my context gets lost at the point Blaze creates a connection. I tracked it down to here:

//ClientChannelFactory.scala, blaze-core 0.14.11
  def connect(
      remoteAddress: SocketAddress,
      bufferSize: Int = bufferSize): Future[HeadStage[ByteBuffer]] = {
    val p = Promise[HeadStage[ByteBuffer]]

    try {
      val ch = AsynchronousSocketChannel.open(group.orNull)

      val onTimeout = //...

      val scheduledTimeout = scheduler.schedule(onTimeout, connectTimeout)

      val completionHandler = new CompletionHandler[Void, Null] {
        //...

        def completed(result: Void, attachment: Null): Unit = {
          channelOptions.applyToChannel(ch)
          p.trySuccess(new ByteBufferHead(ch, bufferSize = bufferSize))
          scheduledTimeout.cancel()
        }
      }

      try {
        ch.connect(remoteAddress, null: Null, completionHandler)
      } catch {
         //...
      }
    } catch { case NonFatal(t) => p.tryFailure(t) }

    p.future
  }

As far as I understand, the context should somehow be passed to the completion handler at instantiation time and restored in def completed, before completing the promise (then the further transformations on the future would also have the context, which they don't - so even though all the tracing information is in the request thanks to the middleware, the Kamon context has no span after any client call).

Can this be done somehow through the configuration of the agent, or would it require special treatment in blaze (e.g. being able to inject a method that creates the completion handler)?

Examples on README

Hello,

We're trying to get kamon-http4s to work in our project. But, the README in the repository is 1.5 year old and having trouble following the example in there.

Would like to ask if the project is still maintained and is there an example we could follow to integrate with kamon-http4s?

Following the example in the current README, we are trying to figure out:

  1. Where does Effect get imported from?
  2. How to configure a BlazeBuilder[F] with the latest versions of the module?(https://github.com/http4s/blaze#http4s-backend)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.