Skip to content
A scala wrapper for the opencensus-java library
Scala HTML
Branch: master
Clone or download
Pull request Compare This branch is 1 commit ahead, 14 commits behind census-ecosystem:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
akka-http-example/src/main
akka-http
core
elastic4s
http/src
http4s
project
src/site
.gitignore
.scalafmt.conf
.travis.yml
CONTRIBUTION.md
LICENSE
README.md
build.sbt
ghpages.sbt
sonatype.sbt
version.sbt

README.md

Build Status

opencensus-scala

This project is a lightweight scala wrapper for the opencensus-java library and provides instrumentation for scala based frameworks.

The API documentation can be found here.

Implementation status

Opencensus-scala supports the tracing and stats apis of opencensus.

Instrumentations

Framework Tracing Stats
Akka HTTP supported planned
Http4s supported planned
Elastic4s supported planned
Play planned planned

Quickstart

Dependencies

Add the following dependencies to your sbt project.

// If you want to use only the core module
"com.github.sebruck" %% "opencensus-scala-core" % "0.6.0" 

// Dependent on the trace exporters you want to use add one or more of the following
"io.opencensus" % "opencensus-exporter-trace-stackdriver" % "0.15.0"
"io.opencensus" % "opencensus-exporter-trace-logging"     % "0.15.0"
"io.opencensus" % "opencensus-exporter-trace-instana"     % "0.15.0"
"io.opencensus" % "opencensus-exporter-trace-zipkin"      % "0.15.0"

// If you want to use opencensus-scala inside an Akka HTTP project 
"com.github.sebruck" %% "opencensus-scala-akka-http" % "0.6.0" 

// If you want to use opencensus-scala inside a http4s project 
"com.github.sebruck" %% "opencensus-scala-http4s" % "0.6.0" 

// If you want to use opencensus-scala inside a elastic4s project 
"com.github.sebruck" %% "opencensus-scala-elastic4s" % "0.6.0" 

Configuration

opencensus-scala uses typesafe config to configure exporters, sampling rates and many more. For a full reference have a look at the default configuration.

To activate the Stackdriver trace exporter with the default sampling rate of 1/10000 add the following to your application.conf.

opencensus-scala {
  trace {
    exporters {
      stackdriver {
        enabled = true 
        project-id = "MY-GC-Project"
      }
    }
  }
}

For documentation how to use the several modules, have a look at the modules section.

Modules

Core

Utilities to use opencensus in a scala idiomatic way.

Learn more at the documentation.

Akka HTTP

Utilities to use opencensus in Akka HTTP applications.

Learn more at the documentation.

http4s

Utilities to use opencensus in http4s applications.

Learn more at the documentation.

elastic4s

Utilities to use opencensus in elastic4s applications.

Learn more at the documentation.

Contributing

Contributions are very welcome! As a starting point, have a look at the open issues.

Please also check the CONTRIBUTION.md.

You can’t perform that action at this time.