TracesMetricsApp LogsCustom LogsProfiling

This guide walks you through setting up Application Performance Monitoring (APM) on a Scala application. These instructions can also be found on the Installation page in your Middleware Account. View demo code here.

Prerequisites

Scala version 2.11.6 or above. Check your Scala version with the following command:

Shell
  scala -version

Install

Step 1: Download Jar File

Download the most recent Middleware Java Agent jar file.

Step 2: Update Your build.sbt File

Java
lazy val root = (project in file("."))
.settings(
  ...
  (run / javaOptions) ++= Seq(
    "-javaagent:middleware-javaagent-{VERSION}.jar",
    "-Dotel.service.name={SCALA-APP-NAME}"
  )
  ...
)

Step 3: Run Your App

Run the following command in your terminal to start your application

Shell
MW_API_KEY=<YOUR_API_KEY> sbt run

Continuous Profiling

Continuous profiling captures real-time performance insights from your application to enable rapid identification of resource allocation, bottlenecks, and more. Navigate to the Continuous Profiling section to learn more about using Continuous Profiling with the Ruby APM.

Need assistance or want to learn more about Middleware? Contact us at support[at]middleware.io.