Skip to content


Repository files navigation

Sematext App Agent

Build Status

This repository contains the source code for Sematext App Agent. Sematext App Agent can be used to collect application metrics from multiple data sources. The data sources and the metrics to be collected can be defined in Metrics Configuration YAML files. There are number of built-in integrations available for various applications in sematext-agent-integrations repo.

Data Sources

The supported data sources are:

  • JMX
  • SQL

Sematext App Agent uses Influx Line Protocol to ship the metrics. The metrics collected by the agent can be shipped to any Influx Line Protocol compatible endpoints like InfluxDB. In the future, we will add support for other output formats like HTTP, Graphite, etc.


The Agent supports a number of built-in functions to process the collected metrics before sending them to output. You can also plug-in custom functions.

The How-to Guide describes how to configure the App Agent in some specific cases.

Getting Started


To build Sematext App Agent you need:

  1. Linux based Operating System
  2. Java 1.6 - 1.8
  3. Maven
  4. Thrift compiler v0.12.0
    • Steps to install Thrift in Debian based systems
        sudo apt-get install automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config
        tar xfz thrift-0.18.1.tar.gz
        cd thrift-0.18.1 && ./configure --enable-libs=no  && sudo make install
  5. fpm package manager

After cloning the repo, executing will build the packages for multiple Linux distributions.


Docker image building for Sematext App Agent is triggered by Maven target:

$ sudo mvn clean install dockerfile:build


when building the image, if software-properties-common package fails, could be because the Docker installation is snap instead of apt version. To install the apt version, follow this to install the correct one.

If Docker daemon is listening on TCP socket, you can set DOCKER_HOST environment variable and start the build with regular user:

DOCKER_HOST=tcp:// mvn clean install dockerfile:build

Once the image is built, launching a new container with Sematext App Agent can be achieved with the following command:

sudo docker run -i -t --name solr-app-agent -e MONITORING_TOKEN=<monitoring-token> -e AGENT_TYPE=standalone -e APP_TYPE=solr -e JMX_PARAMS=-Dspm.remote.jmx.url= spm-client:version

Set up

The packages can be installed using OS specific package manager like dpkg, yum, etc. Once installed a new App can be set up by running setup-spm command. For example, to set up monitoring for a JVM application in standalone mode, add

to startup arguments of Java process you wish to monitor. Then you can set up new App by running the following command:

sudo bash /opt/spm/bin/setup-spm  \
    --monitoring-token <monitoring-token>   \
    --app-type jvm  \
    --agent-type standalone \
    --jmx-params '-Dspm.remote.jmx.url=localhost:3000'

<monitoring-token> - Monitoring Token should point to Sematext App Token if you are sending metrics to Sematext. App is an entity to group similar/related metrics. e.g. All Elasticsearch metrics can be grouped under Elasticsearch App. Each App has a unique token. For other Influx endpoints you can specify a hexadecimal value with format xxxxxxxx--xxxx-xxxx-xxxx-xxxxxxxxxxxx e.g. d0add28a-0a0f-46b2-9e1e-4928db5200e7.

Visit Sematext Documentation for more info on how to set up and configure the agent to ship metrics.

By default, the agent sends the collected metrics to Sematext. You can configure a different Influx compatible destination by changing the following properties in /opt/spm/properties/ file:

  • server_base_url - Base URL of the destination server. e.g.
  • metrics_endpoint - Path to send the metrics. This will be appended with server_base_url to form the complete URL. Default value is /write?db=metrics. You can update this property to send metrics to different endpoint or to specify username/password for InfluxDB. e.g. /write?db=mydb&u=user&p=pass


We welcome bug fixes or feature enhancements to Sematext App Agent. When done working on and testing, just submit a pull request to have Sematext review and merge your changes.

To add support for a new integration refer to Adding a New Agent Integration.

To modify built-in integrations refer to Modifying Built-in Integrations.