All Integrations
LanguagesMaven artifact

Scala Integration

Instrument Scala applications with a single Maven artifact and Java agent. Akka actor tracing, Play Framework request spans, Slick query visibility, and deep JVM metrics — zero code changes required.

Setup

How It Works

01

Add the Maven Artifact

Add the tigerops-scala artifact to your build.sbt or pom.xml. The library bundles the OpenTelemetry Java SDK, OTLP exporters, and Akka and Play instrumentation agents. SBT: libraryDependencies += "net.tigerops" %% "tigerops-scala" % "0.1.+".

02

Attach the Java Agent

Download the tigerops-agent.jar and pass -javaagent:/path/to/tigerops-agent.jar to your JVM startup flags. For sbt run, set javaOptions += "-javaagent:..." in your build.sbt. The agent auto-instruments Akka, Play, and JDBC without code changes.

03

Configure Environment Variables

Set TIGEROPS_API_KEY, TIGEROPS_SERVICE_NAME, and TIGEROPS_ENVIRONMENT. These can be supplied via system properties (-Dtigerops.api.key=...) or as OS environment variables. Typesafe Config (application.conf) integration is also supported.

04

Spans, JVM Metrics & Actor Tracing

TigerOps begins capturing Play HTTP request spans, Akka actor message traces, JDBC query spans, JVM heap usage, GC pause durations, thread pool saturation, and Scala Future execution times within seconds of startup.

Capabilities

What You Get Out of the Box

Akka Actor System Tracing

TigerOps traces message dispatch and processing across Akka actors. Each tell and ask produces a linked span with actor path, mailbox size, processing time, and any unhandled exception detail. Works with Akka Typed and Classic.

Play Framework HTTP Spans

Every Play HTTP request creates a root span with route pattern, controller class, action method, HTTP status, and response time. Action composition and filter chain timing are captured as ordered child spans.

Scala Future & Execution Context Metrics

TigerOps measures Scala Future scheduling latency and execution time per ExecutionContext. Thread pool queue depth, active thread count, and task rejection rates are emitted as continuous metrics.

JDBC & Slick Query Spans

Database queries executed via JDBC or Slick are auto-instrumented. Each span includes normalized SQL, database type, execution time, and row count. Slick compiled query cache hit rates are also reported.

JVM Heap & GC Telemetry

Continuous JVM metrics include heap used/committed per generation, GC pause durations by collector (G1, ZGC, Shenandoah), JIT compilation time, class loading counts, and native memory usage via NMT.

Akka HTTP & Streams

Akka HTTP server and client requests are traced with full header propagation. Akka Streams graph stage throughput, backpressure events, and materialization time are captured as metrics alongside the request spans.

Configuration

Install & Initialize

One Maven artifact and one JVM flag. Full Scala and Akka observability.

build.sbt + application.conf
// build.sbt — add the dependency
libraryDependencies += "net.tigerops" %% "tigerops-scala" % "0.1.+"

// Download the Java agent
// curl -Lo tigerops-agent.jar https://releases.tigerops.net/agent/latest/tigerops-agent.jar

// Attach the agent at JVM startup
javaOptions ++= Seq(
  "-javaagent:/path/to/tigerops-agent.jar",
  "-Dtigerops.api.key=your-api-key",
  "-Dtigerops.service.name=my-scala-app",
  "-Dtigerops.environment=production"
)

// application.conf (Typesafe Config)
tigerops {
  api-key = ${?TIGEROPS_API_KEY}
  service-name = "my-scala-app"
  environment = "production"
  akka {
    trace-ask-timeout = true
    trace-mailbox-size = true
  }
  slow-query-threshold-ms = 100
}

// Custom spans with the Scala API
import net.tigerops.TigerOps

class OrderService {
  def processOrder(orderId: String): Future[Order] = {
    TigerOps.span("order.process") { span =>
      span.setAttribute("order.id", orderId)
      for {
        order  <- orderRepo.findById(orderId)
        _      <- TigerOps.spanF("order.validate")(validateOrder(order))
        result <- TigerOps.spanF("order.persist")(persistOrder(order))
      } yield result
    }
  }
}
FAQ

Common Questions

Which Scala and Akka versions are supported?

Scala 2.13 and Scala 3.x are fully supported. Akka 2.6 and 2.7 (Apache Pekko fork included) are instrumented. Play Framework 2.8 and 2.9 are supported. The Java agent requires JVM 11 or higher.

Does the Java agent instrument all Scala standard library operations?

The agent focuses on I/O boundaries: HTTP, JDBC, messaging, and external calls. Pure CPU-bound Scala computations are not individually traced to avoid overhead. You can add custom spans using the TigerOps.span() API for critical business logic.

How does TigerOps handle Akka cluster and remote messages?

Trace context is propagated across Akka remote and cluster message sends using serialized W3C TraceContext headers embedded in the message envelope. Remote actor paths appear in span attributes for cross-node trace correlation.

Can I use TigerOps in a ZIO or Cats Effect application?

Yes. The Java agent instruments JDBC and HTTP at the bytecode level regardless of effect system. For ZIO-native tracing with fiber-aware context propagation, use the tigerops-zio module which wraps the OpenTelemetry ZIO SDK.

What is the overhead of the Java agent on a high-throughput Akka system?

Benchmarks show less than 2% throughput reduction and under 1ms added latency at p99 for typical Akka message rates. The agent uses async OTLP export to avoid blocking the actor dispatcher. Sampling rate is configurable down to 1%.

Get Started

Full Scala Observability in One Maven Artifact

Akka actor traces, Play Framework spans, JVM metrics, and Slick query visibility — no code changes required.