Site24x7 APM: Application Performance Monitoring Setup

Site24x7 APM: Application Performance Monitoring Setup

Infrastructure metrics tell you a server is at 95% CPU. APM tells you which request is causing it, which database query that request is waiting on, and exactly which line of code is burning the cycles. That's the gap Site24x7 APM fills.

This guide covers installing the APM agent for the major runtimes, what data you get, and how to configure it to surface actionable signals rather than noise.

How Site24x7 APM Works

Site24x7 APM uses a language-level agent that instruments your application at runtime. The agent intercepts calls to frameworks, HTTP clients, and database drivers — without requiring you to add instrumentation code. You attach the agent to your process, and it starts recording transaction traces automatically.

The agent ships trace data to Site24x7 over HTTPS on port 443 (same as the infrastructure agent). Overhead is typically 2-5% CPU and minimal memory — acceptable in production, though benchmark your specific workload if you're running tight.

APM data in Site24x7 is organized around:

  • Applications: a named application (e.g., "API Server", "Worker Service")
  • Transactions: individual request paths within the application (e.g., GET /api/users/{id})
  • Traces: individual request execution traces, sampled from all transactions

Installing the Java APM Agent

Download and Configure

# Download the agent
wget https://staticdownloads.site24x7.com/APM/Java/site24x7-apm-agent.tar.gz
tar -xzf site24x7-apm-agent.tar.gz -C /opt/

Edit /opt/site24x7-apm-agent/conf/agent.conf:

# Your Site24x7 license key (Admin > Developer > License Key)
license.key=YOUR_LICENSE_KEY

# Application name — this is what appears in the APM dashboard
app.name=MyApplication

# Environment label (production, staging, etc.)
app.env=production

Attaching to the JVM

Add the agent as a JVM argument:

java -javaagent:/opt/site24x7-apm-agent/lib/site24x7-apm-agent.jar \
     -Dsite24x7.license.key=YOUR_LICENSE_KEY \
     -Dsite24x7.app.name=MyApplication \
     -jar yourapp.jar

For Tomcat, add to CATALINA_OPTS in setenv.sh:

export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/site24x7-apm-agent/lib/site24x7-apm-agent.jar"

For Spring Boot apps deployed as systemd services, add to the ExecStart line in the unit file:

[Service]
ExecStart=/usr/bin/java \
  -javaagent:/opt/site24x7-apm-agent/lib/site24x7-apm-agent.jar \
  -Dsite24x7.app.name=MyApplication \
  -jar /opt/myapp/myapp.jar

The agent auto-detects and instruments: Spring MVC, JAX-RS, Hibernate, JDBC, Spring Data JPA, Apache HttpClient, and most common Java frameworks.

Installing the Node.js APM Agent

npm install site24x7-apm --save

Require the agent at the very start of your application entry point, before any other imports:

// Must be the first line in your main file
require('site24x7-apm').start({
  licenseKey: process.env.SITE24X7_LICENSE_KEY,
  appName: 'MyNodeApp',
  appEnv: process.env.NODE_ENV || 'production'
});

// Rest of your application imports
const express = require('express');
// ...

The agent instruments Express, Fastify, Koa, HTTP/HTTPS modules, and common Node.js database clients (pg, mysql2, mongodb, redis).

For containerized Node.js apps, pass the license key as an environment variable rather than hardcoding:

ENV SITE24X7_LICENSE_KEY=your_key_here

Installing the .NET APM Agent

The .NET agent installs as a Windows service or via a Linux installer.

Windows

Download the MSI from the Site24x7 portal. Run it with Administrator rights — the installer:

  • Installs the profiler DLL
  • Sets CORECLR_ENABLE_PROFILING and related environment variables system-wide
  • Starts the Site24x7APMInsight Windows service

Applications need to be restarted to pick up the profiler environment variables. For IIS, run iisreset after installation.

Linux (.NET Core / .NET 5+)

curl -sSL https://staticdownloads.site24x7.com/APM/dotnet/site24x7-apm-dotnet-linux.sh | sudo bash

Set environment variables for your application process:

export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
export CORECLR_PROFILER_PATH=/opt/site24x7-apm-dotnet/libsite24x7profiler.so
export SITE24X7_LICENSE_KEY=YOUR_LICENSE_KEY
export SITE24X7_APP_NAME=MyDotNetApp

Installing the PHP APM Agent

PHP APM requires installing a PHP extension:

# Install via PECL
pecl install site24x7-apm

# Or download and compile manually
wget https://staticdownloads.site24x7.com/APM/PHP/site24x7-apm.tar.gz

Add to php.ini:

extension=site24x7_apm.so
site24x7.license_key=YOUR_LICENSE_KEY
site24x7.app_name=MyPHPApp

Restart PHP-FPM (or Apache mod_php). The agent instruments Laravel, Symfony, WordPress, and standard PDO/MySQLi database calls.

What APM Data You Get

Once the agent is running and your application is receiving traffic, data appears in Monitors > APM > Applications within a few minutes.

Transaction Overview

The application overview shows:

  • Throughput: requests per minute across the application
  • Error Rate: percentage of requests that resulted in errors (4xx/5xx or exceptions)
  • Response Time: average and percentile response times
  • Apdex Score: a composite metric from 0 to 1 representing user satisfaction

Transactions are broken out individually — you can see that POST /api/orders is taking 800ms on average while GET /api/products is under 50ms. This breakdown is where you find the actual slow paths.

Distributed Tracing

For microservice architectures, Site24x7 APM supports distributed tracing via W3C Trace Context headers. When a request flows through multiple services that all have the APM agent installed, the trace stitches together the full request path across service boundaries.

You can trace a request from the edge service through the API service into the database query — the entire call graph — in a single trace view.

Database Query Monitoring

APM captures slow database queries automatically. The Database tab in the APM dashboard shows:

  • Slowest queries by average execution time
  • Most frequently called queries
  • Queries with the highest total time contribution (frequency × average time)

Each slow query shows the SQL, the calling transaction, execution count, and time statistics. No query-level instrumentation is required — the agent intercepts at the driver level.

This is where APM earns its keep for most teams: "our API is slow" becomes "this specific SQL query is doing a full table scan 200 times per minute" in the first week.

Error Tracking

The Errors tab shows all application exceptions and HTTP errors captured by the agent:

  • Exception class and message
  • Stack trace
  • Which transactions triggered the error
  • Frequency and trend over time

Unlike log-based error tracking, APM error data includes the full request context — what transaction triggered it, how long the request took before erroring, and the database queries that ran during the request.

Configuring Apdex Thresholds

Apdex (Application Performance Index) quantifies user satisfaction with a number from 0 to 1. It's calculated from a threshold you define (the "T value"):

  • Requests completing in under T seconds → satisfied (counts as 1.0)
  • Requests completing in T to 4T seconds → tolerating (counts as 0.5)
  • Requests exceeding 4T seconds → frustrated (counts as 0)

Apdex = (Satisfied + Tolerating/2) / Total requests

An Apdex of 1.0 means all users are satisfied. Below 0.7 is generally considered poor.

To set the Apdex T value for your application:

  1. Open your APM application in Site24x7
  2. Go to Settings > Apdex Configuration
  3. Set the T value — start with 500ms for most web applications. Tighter is more honest about performance; looser just makes your Apdex score look better

Set separate T values per transaction if your application has endpoints with legitimately different performance characteristics (a real-time search at 100ms vs. a bulk report export at 5 seconds).

Using Apdex for Alerting

Configure alerts on Apdex rather than raw response time — Apdex naturally handles the weighted average across all transactions:

  1. Open the APM application > Edit Monitor
  2. Under Threshold Configuration, set:
    • Trouble: Apdex below 0.8
    • Critical: Apdex below 0.6

This fires alerts when your application's overall user experience degrades, regardless of which specific transaction is causing it.

Custom Instrumentation

The auto-instrumentation covers frameworks and drivers, but not your custom business logic. To trace specific methods:

Java:

import com.site24x7.apm.api.Tracer;

public void processOrder(Order order) {
    Tracer.startTrace("processOrder");
    try {
        // your logic
    } finally {
        Tracer.endTrace();
    }
}

Node.js:

const apm = require('site24x7-apm');

async function processOrder(order) {
    const span = apm.startSpan('processOrder');
    try {
        // your logic
    } finally {
        span.end();
    }
}

Custom spans appear in the transaction trace alongside the auto-captured framework spans, giving you visibility into the parts of your code the agent can't instrument automatically.

Correlating APM with Infrastructure Metrics

Site24x7's unified platform pays off here: if your Apdex drops at 14:30 and your server CPU spiked to 95% at 14:28, the correlation is visible on the same timeline without switching tools.

In the APM dashboard, click Correlate to open a split view showing the application performance metrics alongside the infrastructure metrics for the server running that application. This is the fastest path from "something is slow" to "the database server ran out of memory at 14:27".

Production Overhead Considerations

Before enabling APM in production:

  1. Sampling: Site24x7 APM samples traces by default (not every request generates a full trace — usually 10-20%). This keeps overhead manageable. Adjust sampling rate under APM Settings.
  2. Transaction naming: Auto-naming works for REST APIs with stable URL patterns. For APIs with high-cardinality URL parameters (e.g., /users/12345), configure URL grouping rules so transactions aren't fragmented into thousands of unique names.
  3. Sensitive data: The agent captures request parameters in traces. Configure data masking rules (under APM Settings > Data Masking) to exclude fields containing passwords, tokens, or PII before enabling in production.

Read more

Start now free