Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

A hello-world app in NodeJS. Instrumented by Jaeger-Client, and deployed to AWS lambda using Serverless Framework.

License

Notifications You must be signed in to change notification settings

Originate/OpenTraceHelloWorld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTraceHelloWorld

A hello-world app in NodeJS. Instrumented by Jaeger-Client, and deployed to AWS Lambda using Serverless framework.

Problem Statement: Need documentation and example hello-world app to instrument with Tracing.

Acceptance Criteria:

  • Need a hello-world app repo that can be deployed with serverless framework to aws Lambda to help be a tutorial for instrumenting with opentracing ideally using typescript, but node is ok as well.
  • Ensure the jaeger-client sends data to a running jaeger-docker instance via udp (in amgen case the endpoint will be provided, for your case you may need to run the docker image of jaeger)
  • Serverless framework should assume VPC , not public facing, so you may need to adjust serverless.yml and ensure it’s setup right so that the hello-world lambda endpoint is private and the jaeger reporter config sends traces to private ip also

Dev Step

Setup on MacBook

Prerequisites

Dependencies

In project directory:

  • jaeger-client: npm install --save jaeger-client

Run

a) Run Jaeger backend as an all-in-one Docker image named jaeger:

$ docker run -d --name jaeger \
  -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
  -p 5775:5775/udp \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 14268:14268 \
  -p 9411:9411 \
  jaegertracing/all-in-one:1.6

Browse Jaeger UI via http://localhost:16686 to ensure the jaeger image is running successfuly:

jaeger-ui

Jaeger backend serves Jaeger UI for visualizing traces. Without it being set up, traces created in b) won't be visualizable, let alone further assessment and improvement of the app made easier via the visualization. Read more to understand docker-jaeger instance.

To reset the jaeger image, stop the Docker image then remove it via Docker stop jaeger; Docker rm jaeger in commandline.

b) Run the hello-world app with Node: $ node hello.js Genova

hello-output

When the app is running, traces are created and set over to Jaeger UI, serverd by the jaeger Docker image created above. To view the traces, please refer to the View Traces section for details.

NOTE:

  • Genova is customizable to any value.
  • a) and b) MUST be run in the above order, to send the latest traces to Jaeger UI.

View Traces

In Jaeger UI, select hello-genova in Jaeger UI/Find Traces/Services then hit Find Traces to see the hello-genova trace:

jaeger-ui

Click the hello-genova trace to see span details:

jaeger-ui

About

A hello-world app in NodeJS. Instrumented by Jaeger-Client, and deployed to AWS lambda using Serverless Framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published