Skip to content

Sonario

Overview

Sonario is a monitoring tool. Click here to read more about Sonario.

If you want to try Onteon with Sonario, go to download page, fill the form and submit it. After this, you will be redirected to page with download links. Then download the docker compose file with Sonario monitoring tool. Then go to directory with docker compose file and execute docker-compose up. After this, execute docker-compose run --rm onteoncli, this should run container with preinstalled OnteonCLI and demo applications.

If you don't want to use Docker container with preinstalled OnteonCLI, you can download some example applications:

System metrics

Go to http://localhost:8100/kibana/app/kibana#/dashboards?_g=() to see dashboards with information about nodes systems.

Application with java tracer

Demo application

If you don't want to create any application, you can use Demo Cookbook App.

root@b03c5edec880:/opt/onteon# onteoncli application-registry upload onteon_files/applications/with-sonario/onteon-demo-app-cookbook-native.tar.gz 
Starting upload session...
Sending part no 0...
Sending part no 1...
Sending part no 2...
Sending part no 3...
Sending part no 4...
Sending part no 5...
Sending part no 6...
Sending part no 7...
Sending part no 8...
Sending part no 9...
Finishing upload session...
uploaded: true
41824f8403182c21 2021-10-25T07:25:04.431Z 2021-10-25T07:33:20.567Z 172.27.0.5 8030        null   available
5ab4625539f0429aa2c73412 2021-10-25T07:25:04.431Z 2021-10-25T07:33:20.595Z 172.27.0.4 8030        null   available

root@b03c5edec880:/opt/onteon# ^Cte
root@b03c5edec880:/opt/onteon# onteoncli application list
id                       createdAt                updatedAt                name                            version type     processType
61765db523a4ed4397763f85 2021-10-25T07:33:09.435Z 2021-10-25T07:33:09.435Z onteon-demo-app-cookbook-native 1.1.0   standard native

root@b03c5edec880:/opt/onteon# onteoncli application-instance create 61765db523a4ed4397763f85 0bed4b3841824f8403182c21                         
id:                 b4e33a7d4152c459b67abdc7
createdAt:          2021-10-25T07:33:55.346Z
applicationName:    onteon-demo-app-cookbook-native
applicationVersion: 1.1.0
applicationId:      61765db523a4ed4397763f85
nodeId:             0bed4b3841824f8403182c21
status:             created

root@b03c5edec880:/opt/onteon# onteoncli application-instance start b4e33a7d4152c459b67abdc7

Create application

In this topic, you can see how to create simple Java application with Sonario Java Tracer. Sonario Java Tracer will send the information about application to the Sonario Server. Then, you will be able to see the information in Sonario UI.

First, create basic directory structure. It should look like this:

├── bin
└── conf
    └── conf.yml

Now you need to download a few files. First, you need Java application. If you don't want to create your own app, you can use Spring Boot example. Just follow these steps:

  • clone https://github.com/spring-guides/gs-spring-boot.git
  • go to gs-spring-boot/complete/
  • execute mvn clean package
  • copy target/target/spring-boot-complete-0.0.1-SNAPSHOT.jar file to bin directory.

Next you need to download Sonario Java Tracer and copy it to bin directory. You can download Sonario Java Tracer here.

Your directory should look like this:

├── bin
│   ├── app.jar
│   └── sonario-java-tracer.jar
└── conf
    └── conf.yml

Now you need to write configuration to conf/conf.yml file. You can read more about configuration in this tutorial and this documentation.

Example conf/conf.yml file.

app:
  name: 'java-app'
  version: '1.0.0'
  appType: 'standard'
  procType: 'native'
  processProvider:
    name: 'JVMOsProcessProviderImpl'
    version: '1.0.0'
    executable:
      start:
        path: '${ont_app_path}/bin'
        startJvmCommand: 'java -jar -Dserver.port=${ont_port_1} -Dsonario.service_name=TestService -Dsonario.application_name=java-app -Dsonario.server_url=http://sonario-server:8100/sonario-receiver -Dsonario.application_packages=com.example.springboot -Dsonario.log_file=tracer.log -Dsonario.log_level=info -javaagent:${ont_app_path}/bin/sonario-java-tracer.jar'
        executableFileName: 'app.jar'
  placeHolder:
    name: 'PlaceHolderManagerImpl'
    version: '1.0.0'
    filesToReplace:
    variables:
  serviceRepository:
    healthCheckUrl: 'http://${address}:${ont_port_1}/'
    entities:
      - entity:
          priority: 1
          port: ${ont_port_1}
          protocol:
            type: 'HTTP'
            version: '2.0'
          isExternal: true
          isInternal: true

Let's focus on startJvmCommand property. Here you need to specify some Sonario parameters.

-Dsonario.service_name=TestService name of service.

-Dsonario.application_name=java-app name of application.

-Dsonario.server_url=http://sonario-server:8100/sonario-receiver the url to sonario receiver.

-Dsonario.application_packages=com.example.springboot Used to determine whether a stack trace frame is an 'in-app frame' or a 'library frame'.

-Dsonario.log_file=tracer.log Sonario Java Tracer log file.

-Dsonario.log_level=info Sets the logging level.

-javaagent:${ont_app_path}/bin/sonario-java-tracer.jar Path to Sonario Java Tracer.

You can read more about Sonario Java Tracer configuration here.

Now you should be ready to tar and upload application package.

$ onteoncli application-registry upload java-app.tar.gz
Starting upload session...
Sending part no 0...
Sending part no 1...
Sending part no 2...
Sending part no 3...
Sending part no 4...
Finishing upload session...
uploaded: true

$ onteoncli application list
id                       createdAt                updatedAt                name     version type     processType
616d53b140b4df2851b99a86 2021-10-18T11:00:01.349Z 2021-10-18T11:00:01.349Z java-app 1.0.0   standard native

$ onteoncli node list
id                       createdAt                updatedAt                ipAddress  nodeApiPort zoneId status
fdbc6b323ea371c53351ef48 2021-10-18T10:52:28.935Z 2021-10-18T11:00:20.629Z 172.29.0.4 8030        null   available
2a6b81d3dd1d92b529c227a4 2021-10-18T10:52:25.026Z 2021-10-18T11:00:21.193Z 172.29.0.5 8030        null   available

$ onteoncli application-instance create 616d53b140b4df2851b99a86 fdbc6b323ea371c53351ef48
id:                 2ca25b96aa813fd8f8080ab2
createdAt:          2021-10-18T11:01:11.837Z
applicationName:    java-app
applicationVersion: 1.0.0
applicationId:      616d53b140b4df2851b99a86
nodeId:             fdbc6b323ea371c53351ef48
status:             created

$ onteoncli application-instance start 2ca25b96aa813fd8f8080ab2
start instance described by input:{instanceName=java-app-1.0.0-5fe757ad3a7753b-fdbc6b323ea371c53351ef48-1_2021_10_18_11_01_11-fdbc6b323ea371c53351ef48, appName=java-app-1.0.0-5fe757ad3a7753b-fdbc6b323ea371c53351ef48}
process:java-app-1.0.0-5fe757ad3a7753b-fdbc6b323ea371c53351ef48-1_2021_10_18_11_01_11-fdbc6b323ea371c53351ef48 with pid:'1407 was correctly started
resultType: SUCCESS
message:    Command executed successfully.

$ onteoncli application-instance  list
id                       createdAt                applicationName applicationVersion applicationId            nodeId                   status
2ca25b96aa813fd8f8080ab2 2021-10-18T11:01:11.837Z java-app        1.0.0              616d53b140b4df2851b99a86 fdbc6b323ea371c53351ef48 running
086bfc8ad012e5c2f69ae0c0 2021-10-18T10:52:26.64Z  nginx-edge      1.0.0              null                     fdbc6b323ea371c53351ef48 running
b5e7403f6c914f337352e5ee 2021-10-18T10:52:25.529Z nginx-inner     1.0.0              null                     fdbc6b323ea371c53351ef48 running
aeb1f5425a18f6980b1d1768 2021-10-18T10:52:22.512Z nginx-edge      1.0.0              null                     2a6b81d3dd1d92b529c227a4 running
a2c96beedd9bd0c3dde413ff 2021-10-18T10:52:21.407Z nginx-inner     1.0.0              null                     2a6b81d3dd1d92b529c227a4 running

You can access your application at http://localhost:8020/_by_name/java-app/ or http://localhost:8020/_by_name_and_version/java-app/1.0.0/ .

APM

Go to http://localhost:8100/kibana/app/apm#/services to see monitoring of your applications.