Git Product home page Git Product logo

apm-tutorial-java-host's Introduction

apm-tutorial-java

Tutorial for Java application used by for agent setup in popular configurations

The notes application and calendar application are both REST APIs. The notes application has POST, GET, PUT and DELETE operations for creating, getting, updating and deleting notes. Additionally, the notes application POST /notes method has an additional parameters, add_date, that can be set to 'y' in order to make a call to the calendar application for a random date. This can be used to show distributed tracing across applications.

These are sample Java applications made to run in various deployment scenarios with two different services, a notes application and calendar application, in order to provide sample distributed tracing. The application is used in a tutorial showcasing how to enable APM tracing for an application. The different ways to deploy these applications are:

  • locally on host machine (with Datadog Agent also running on host)
  • within Docker containers (with Datadog Agent also in a container)
  • within Docker containers (with Datadog Agent running on host)
  • Google Kubernetes Engine (GKE)
  • Amazon AWS Elastic Kubernetes Service (AWS EKS)
  • Amazon AWS Elastic Container Service (AWS ECS)

The sample application is a very simple pair of rest APIs, as seen below. All commands below are for host and/or Docker container deployment situations. For Kubernetes deployments, the URL will be that of the Kubernetes notes or calendar service.

REST APIs

Calendar Application

GET /calendar

Returns a random date in 2022.

Request

curl 'http://localhost:9090/calendar'

Response

{"status":"success","date":"3/22/2022"}

Notes Application

GET /notes/

Request

curl 'http://localhost:8080/notes'

Response

[{ "id": 0, "description": "Hello, this is a note." }]

POST /notes

Request - without optional add_date parameter

curl -X POST 'http://localhost:8080/notes?desc=ImANote'

Response

{ "id": 1, "description": "ImANote" }

Request - with optional add_date parameter

Makes a request to calendar service on port 9090.

curl -X POST 'http://localhost:8080/notes?desc=ImANoteWithDate&add_date=y'

Response

{ "id": 2, "description": "HiImANoteWithDate. Message Date: 09/21/2022" }

GET /notes/:id

Request

curl 'http://localhost:8080/notes/1'

Response

{ "id": 1, "description": "ImANote" }

PUT /notes/:id

Request

curl -X PUT 'http://localhost:8080/notes/1?desc=UpdatedNote'

Response

{ "id": 1, "description": "UpdatedNote" }

DELETE /notes/:id

Request

curl -X DELETE 'http://localhost:8080/notes/1'

Response

{ "message": "note with id 4 deleted." }

apm-tutorial-java-host's People

Contributors

zarirhamza avatar jonbodner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.