Code Monkey home page Code Monkey logo

go-copilot-observability's Introduction

Go Copilot Observability

This repo contains a simple instrumented go service along with infra to deploy it to AWS ECS and AWS App Runner using Copilot.

Requirements

Deploy

  1. Clone this repo.
  2. Deploy this service using Copilot!
copilot init --app copilot-playground --name movies-lbws --type "Load Balanced Web Service" --deploy

Generate and View Traces

Now that you have the movies service deployed, let's generate some traces! After deploying your service, copilot gives you a URL to access your service. Copy that URL, and replace $MOVIES_SERVICE_BASE_URL with it in the commands below.

First, let's insert a movie into our database:

curl -X POST '$MOVIES_SERVICE_BASE_URL/movies/api/movie' -d '{"title": "Parasite", "year": 2019}'

In the response JSON, there should be an id field. Replace the below MOVIE_ID with that, and let's query the movie we just inserted:

curl -X GET '$MOVIES_SERVICE_BASE_URL/movies/api/movie?id=$MOVIE_ID'

Sweet! Now we should have some traces to view in the AWS Console. After logging in, go to CloudWatch and click on the Service Map in the sidebar, under X-Ray traces. It should look something like this: Service Map

Now switch to the Traces tab in the sidebar, and you should be able to see your requests. If you open one up, you can see more details about that specific request like this: Trace Details

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.