io.opentracing.contrib:opentracing-finagle

OpenTracing Instrumentation for Finagle

License

License

GroupId

GroupId

io.opentracing.contrib
ArtifactId

ArtifactId

opentracing-finagle
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

io.opentracing.contrib:opentracing-finagle
OpenTracing Instrumentation for Finagle
Project URL

Project URL

https://github.com/opentracing-contrib/scala-finagle
Source Code Management

Source Code Management

http://github.com/opentracing-contrib/scala-finagle

Download opentracing-finagle

How to add to project

<!-- https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-finagle/ -->
<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-finagle</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-finagle/
implementation 'io.opentracing.contrib:opentracing-finagle:0.1.0'
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-finagle/
implementation ("io.opentracing.contrib:opentracing-finagle:0.1.0")
'io.opentracing.contrib:opentracing-finagle:jar:0.1.0'
<dependency org="io.opentracing.contrib" name="opentracing-finagle" rev="0.1.0">
  <artifact name="opentracing-finagle" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.opentracing.contrib', module='opentracing-finagle', version='0.1.0')
)
libraryDependencies += "io.opentracing.contrib" % "opentracing-finagle" % "0.1.0"
[io.opentracing.contrib/opentracing-finagle "0.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
io.opentracing : opentracing-api jar 0.32.0
com.twitter : finagle-http_2.12 jar 19.2.0

test (4)

Group / Artifact Type Version
io.opentracing : opentracing-mock jar 0.32.0
io.opentracing : opentracing-util jar 0.32.0
org.awaitility : awaitility-scala jar 3.1.6
org.scalatest : scalatest_2.12 jar 3.0.7

Project Modules

There are no modules declared in this project.

Build Status Coverage Status Released Version Apache-2.0 license

OpenTracing Finagle Instrumentation

OpenTracing instrumentation for Finagle.

Installation

build.sbt

libraryDependencies += "io.opentracing.contrib" % "opentracing-finagle" % "0.0.2"

Usage

// Instantiate tracer
val tracer: Tracer = ...

Http Server

// Apply OpenTracingHttpFilter to Finagle service to serve HTTP requests
val service = new OpenTracingHttpFilter(tracer, true) andThen new Service[http.Request, http.Response] {
    def apply(req: http.Request): Future[http.Response] =
      Future.value(
        http.Response(req.version, http.Status.Ok)
      )
  }
  
// Create server   
val server = Http.server.serve(":8080", service)
Await.ready(server)

Http Client

// Apply OpenTracingHttpFilter to Finagle client service 
val client = new OpenTracingHttpFilter(tracer, false) andThen Http.client.newService(":8080")

// Build request
val request = http.Request(http.Method.Get, "/")

// Build response
val response: Future[http.Response] = client(request)

// Wait for result
val result = Await.result(response)

License

Apache 2.0 License.

io.opentracing.contrib

3rd-Party OpenTracing API Contributions

3rd-party contributions that use OpenTracing. **The repositories in this org are *not* affiliated with the CNCF.**

Versions

Version
0.1.0
0.0.2
0.0.1