Skip to content

cseverino789/overops-event-generator

 
 

Repository files navigation

OverOps Event Generator

This project is a simple Spring Boot application that generates a variety of OverOps event types useful for testing OverOps installations and highlighting features. This application is similar in purpose the JavaJam error generating jar which is often referenced in OverOps docs and samples, but expands upon its usefulness. This application includes the following features:

  • easy to understand events which correlate to all supported OverOps event types including:
    • Caught and Uncaught Exceptions
    • Logged ERROR and WARN statements
    • Swallowed Exceptions
    • Custom Events via OverOps SDK
    • HTTP Errors
    • Timers
  • logging statements at various levels to highlight log view capabilities
  • application name and deployment name specified in MANIFEST.MF

Building & Running

Execute the following commands clean and package the jar:

./mvnw clean package -DskipTests

To start and monitor this application with OverOps you can execute the following commands. Full documentation on installing and configuring OverOps can be found here.

java -agentlib:TakipiAgent -jar target/overops-event-generator-*.jar

or

nohup java -agentlib:TakipiAgent -jar target/overops-event-generator-*.jar &

Additional Command Line Arguments

Argument Description Value Type Default Value Example
oo.events Executes the number events specified and then terminates the application Integer -1 (run forever) --oo.events=100
server.port Specify http port to use Integer 8080 --server.port=1234

DB Console

You can view the H2 web console at /console for example http://localhost:8080/console. Use the following connection properties:

Field Value
Driver Class org.h2.Driver
JDBC URL jdbc:h2:mem:overops
User Name sa
Password

Timer Configuration

This application includes a class called SlowService which contains a method called longRunningMethod. This method will always take 5 seconds to execute. You can easily add this method to the OverOps Timer's dialog with a threshold below 5 seconds to test the Timer capability.

Running with Docker

Included is a Dockerfile which can be used to build and run the event generator with overops agent.

Building the Image

$ docker build . -t overops-event-generator:latest

# Optional: Use a specific agent version
$ docker build . -t overops-event-generator:latest --build-arg AGENT_VERSION=X.Y.Z

Running the Image

The Overops Agent can be configured with Environment variables as described in the Agent Docs: https://doc.overops.com/docs/agent-properties

Required is the TAKIPI_COLLECTOR_HOST variable which should be the hostname or IP of the collector

$ docker run  --env TAKIPI_COLLECTOR_HOST=<HOSTNAME>  -ti overops-event-generator:latest

Pivotal Cloud Foundry (PCF) Example

Deploying to PCF is a trivial exercise with OverOps. The OverOps agent is available as part of the PCF Java Buildpack under our original name Takipi. More details can be found here.

To deploy this error generator on PCF you can execute the following commands from the root of this project. It is assumed you have the PCF CLI installed and an active OverOps SaaS account.

# clean and package the error generator
mvn clean package

# register "takipi" service using CUPS
cf cups takipi -p '{ "secret_key": "<YOUR_KEY>" }'

# push the generator to PCF
cf push overops-event-generator -p target/overops-event-generator-2.1.3.jar

# bind the "takipi" service to the generator
cf bind-service overops-event-generator takipi

# re-stage the generator and enjoy
cf restage overops-event-generator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 85.4%
  • Python 9.8%
  • Dockerfile 3.0%
  • HTML 1.8%