> ## Documentation Index
> Fetch the complete documentation index at: https://mw-docs.middleware.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Scala

> Scala APM - Setup & Installation Docs | Middleware

| Traces | Metrics | App Logs | Custom Logs | Profiling |
| :----: | :-----: | :------: | :---------: | :-------: |
|    ✅   |    ✅    |     ✅    |      ✅      |     ✅     |

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](https://github.com/middleware-labs/demo-apm/blob/master/java/scala-demo/README.md).

# Prerequisites

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

```bash Shell theme={null}
  scala -version
```

# Install

### Step 1: Download Jar File

Download the most recent [Middleware Java Agent jar file](https://github.com/middleware-labs/opentelemetry-java-instrumentation/releases).

### Step 2: Update Your `build.sbt` File

```java Java theme={null}
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 Shell theme={null}
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](https://docs.middleware.io/workflow/profiling#continuous-profiling) section to learn more about using Continuous Profiling with the Ruby APM.

<Note> Need assistance or want to learn more about Middleware? Contact us at support\[at]middleware.io. </Note>
