Skip to content

Simulates various application anomalies like slowdowns, failures, increased resource consumption or crashes

License

Notifications You must be signed in to change notification settings

Dynatrace/anomaly-simulation-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Anomaly Simulation Service

Purpose of this service is to simulate specific anomaly situations, such as:

  • Slowdowns
  • Failures
  • Increase in resource consumption
  • Process crashes
  • Calls to one or more other services

Therefore, this generic service can be used to build all kinds of variable demo situations with either flat or deep call trees.

The service listenes on following HTTP resource pathes:

  • GET '/' normal page return
  • POST '/config' service receives anomaly config as a HTTP POST message with a JSON config payload that is defined below.

Thanks to Wolfgang Beer for the initial implementation of this service.

Usage

Start service by specifying a listening port: ./service.exe 8090 Start the service multiple times and let the services call each other ./service.exe 8090 ./service.exe 8091

Dynamically reconfigure the service

Push a http POST request to /config on your started service.

Config JSON body

Count always represents the number of service requests that suffer from that anomaly, e.g.: a count of 5 means the next 5 service requests are affected. A crash anomaly kills the service process with the given exit code. The resource anomaly allocates a matrix of 100x100 elements multiplied by the given severity. Callees let you specify the callees this service calls with each service request. Specifying callees allows you to build dynamic multi-level service call trees. In case the attribute 'Balanced' is set to 'true', the callees are equally iterated with each request.

{
  "ErrorConfig": {
    "ResponseCode": 500,
    "Count": 5
  },
  "SlowdownConfig": {
    "SlowdownMillis": 500,
    "Count": 1
  },
  "CrashConfig": {
    "Code": 3
  },
  "ResourceConfig": {
    "Severity": 5,
    "Count": 2
  },
  "Callees": [
    {
      "Adr": "http://www.example.com",
      "Count": 10
    },
    {
      "Adr": "http://www.orf.at",
      "Count": 3
    },
    {
      "Adr": "http://localhost:8090",
      "Count": 3
    }
  ],
  "Balanced": true
}

Example topology

The example1/start.sh shell script copies the anomaly simulation service into 6 individual services. Starts those 6 services on the same machine on 6 different ports and configures them to call them each other in the topology shown by Dynatrace below:

Balanced example

The balancer/start.sh shell script copies the anomaly simulation service into 6 individual services. Starts those 6 services on the same machine on 6 different ports and configures them to form a balancer and worker pool topology, as it is shown by Dynatrace below:

About

Simulates various application anomalies like slowdowns, failures, increased resource consumption or crashes

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages