moskito-javaagent

Defines various standards for all Anotheria Maven Projects

License

License

Categories

Categories

Net Other General Purpose Libraries
GroupId

GroupId

net.anotheria
ArtifactId

ArtifactId

moskito-javaagent
Last Version

Last Version

2.10.0
Release Date

Release Date

Type

Type

jar
Description

Description

moskito-javaagent
Defines various standards for all Anotheria Maven Projects
Project Organization

Project Organization

anotheria.net
Source Code Management

Source Code Management

https://github.com/anotheria/moskito-javaagent

Download moskito-javaagent

How to add to project

<!-- https://jarcasting.com/artifacts/net.anotheria/moskito-javaagent/ -->
<dependency>
    <groupId>net.anotheria</groupId>
    <artifactId>moskito-javaagent</artifactId>
    <version>2.10.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.anotheria/moskito-javaagent/
implementation 'net.anotheria:moskito-javaagent:2.10.0'
// https://jarcasting.com/artifacts/net.anotheria/moskito-javaagent/
implementation ("net.anotheria:moskito-javaagent:2.10.0")
'net.anotheria:moskito-javaagent:jar:2.10.0'
<dependency org="net.anotheria" name="moskito-javaagent" rev="2.10.0">
  <artifact name="moskito-javaagent" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.anotheria', module='moskito-javaagent', version='2.10.0')
)
libraryDependencies += "net.anotheria" % "moskito-javaagent" % "2.10.0"
[net.anotheria/moskito-javaagent "2.10.0"]

Dependencies

provided (2)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.1.0
com.github.spotbugs : spotbugs jar 4.1.1

test (2)

Group / Artifact Type Version
org.ow2.asm : asm-all jar 4.1
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

moskito-javaagent

Basic usage description.

1) Build and enable.

a) Get moskito-javaagent-1.0.0-SNAPSHOT.jar artifact from {javaagent-home}/target - directory and put it to some location

b) Get {javaagent-home}/target/configuration directory to same location ( provides all required configurations and will be used as bootPath for agent)

2) Add moskito javaagent to your app, as java-agent, and provide applications packages to be monitored.

as example:

	export JAVA_OPTS=" $JAVA_OPTS -javaagent:/[full_path]/moskito-javaagent/target/moskito-javaagent-1.0.0-SNAPSHOT.jar"
	export JAVA_OPTS=" $JAVA_OPTS export JAVA_OPTS="$JAVA_OPTS -DapplicationPackages=com.test,com.anothertest"

By default following classes are monitored: *DAO*, *Repository*, *Service*, *Manager*, *Controller*.

3) Now you can run your application, jump to step 6 and check what is going on.

4) Configuring moskito-javaagent-config.json.

This configuration allows to pre-select working mode (PROFILING / LOG_ONLY) — in log only mode all class/methods will be simply dumped into info - log in PROFILING mode - core moskito functionality will take a part.

a) Add monitoring sections @monitoringClassConfig ( Patterns defines classes which will be weaver ( wrapped into monitoring aspect ))!

        {
           "patterns": ["com.test.*"],
           "subsystem": "default",
           "category": "foo-bar"
        }

b) Extend default monitoring classes @monitoringDefaultClassConfig ( Patterns defines classes which will be weaver by default ( wrapped into monitoring aspect ))!

        {
           "patterns": [".*Service.*"],
           "subsystem": "default",
           "category": "service"
        }

c) In case you want to connect from MoSKito Inspect - select port - 9451 - default and enable it using config properties:

           "startMoskitoBackend": true,
           "moskitoBackendPort": 9451

or system property:

	export JAVA_OPTS=" $JAVA_OPTS -DmoskitoAgentPort=9451"

5) Logging configuration changes.

[moskito-aspect-config.json] allow to provide other logger names. By default loggers will be - MoskitoDefault ( see logback.xml), Moskito1m, Moskito1h - etc….

NOTE : "attachDefaultStatLoggers": true - enables logback logging for defaults stats "defaultMoskitoLoggerName": "", - defines default logger name ( “MoskitoDefault” - by global default ) "@loggers": [], - allow to create intervalName - logger name mapping like :

        {
           "@intervalLogger": {
             "defaultMoskitoLoggerName": "",
             "@loggers": [
                {
                    "intervalName" : "1s",
                    "loggerName" : "MoskitoOneSecondIntervalLogger"
                }],
             "attachDefaultStatLoggers": true
           }
        }

In app data - defaults for logging specified in logback.xml. In case If you want to rename some moskito loggers.

6) Connection from inspect moskito application with UI.

  • Run MoSKito inspect application.
  • Navigate to producer section.
  • Provide host (localhost for local connections), port (default 9451 or those which was configured in section 4.c ("moskitoBackendPort").
  • Connect - and find your producers.

Enjoy…

net.anotheria

anotheria

anotheria solution gmbh

Versions

Version
2.10.0
2.9.0
2.8.8
2.8.7