{"id":13626422,"url":"https://github.com/mikaelvesavuori/serverless-observability-example","last_synced_at":"2025-10-29T08:31:27.530Z","repository":{"id":45674611,"uuid":"513969642","full_name":"mikaelvesavuori/serverless-observability-example","owner":"mikaelvesavuori","description":"Presents a complete project to demonstrate a 'broken' observable serverless application.","archived":false,"fork":false,"pushed_at":"2023-05-17T06:10:32.000Z","size":703,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T23:51:24.648Z","etag":null,"topics":["aws","datadog","demo","example","honeycomb","honeycombio","observability","serverless"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikaelvesavuori.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-14T16:19:05.000Z","updated_at":"2024-10-15T00:52:30.000Z","dependencies_parsed_at":"2024-01-14T09:00:27.301Z","dependency_job_id":null,"html_url":"https://github.com/mikaelvesavuori/serverless-observability-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fserverless-observability-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fserverless-observability-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fserverless-observability-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fserverless-observability-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikaelvesavuori","download_url":"https://codeload.github.com/mikaelvesavuori/serverless-observability-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236735017,"owners_count":19196363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","datadog","demo","example","honeycomb","honeycombio","observability","serverless"],"created_at":"2024-08-01T21:02:17.975Z","updated_at":"2025-10-29T08:31:21.960Z","avatar_url":"https://github.com/mikaelvesavuori.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Serverless Observability example: AWS + Honeycomb or Datadog\n\n**This repo presents a complete project to demonstrate a \"broken\" observable serverless application.**\n\nThis project is built using Typescript and runs on API Gateway and Lambda. It is composed of two separate backend services (\"internal\") and one mock server on Mockachino (\"external\") that serves a subset of the content.\n\nAdditionally, there is a set of AWS CloudWatch alerts included to demonstrate such usage.\n\n## Diagram\n\nThe below diagram gives an indicative sense of the overall flow.\n\n![Serverless Observability example diagram](./diagram/diagram.png)\n\n## Prerequisites\n\nIt is assumed that:\n\n- You have a recent [Node.js](https://nodejs.org/en/) version installed (ideally version 18 or later)\n- You have an [AWS](https://aws.amazon.com/account/sign-up) account\n- You have sufficient privileges to deploy infrastructure such as Lambda, API Gateway and S3 to AWS\n- You are logged into AWS through your environment\n\n## Deployment\n\n_Version 2.0 introduced support for Datadog in addition to the existing Honeycomb support. It won't quite be as a rich an experience as using Honeycomb but it will definitely be servicable._\n\nThe instructions below relate broadly to either tool. When it comes to getting API keys and such, please refer to [Datadog's own instructions](https://docs.datadoghq.com/account_management/api-app-keys/).\n\nMake sure to check the respective `serverless.yml` files for the services and remove anything you don't want to use.\n\n### 1. Get a free Honeycomb account and API key\n\nGo to [Honeycomb](https://www.honeycomb.io) and get a free, generous account.\n\nCreate an API key for a new environment. **Note the environment name and key for later**.\n\nFor more information, refer to [https://docs.honeycomb.io/getting-data-in/api-keys/](https://docs.honeycomb.io/getting-data-in/api-keys/).\n\n### 2. Set up `GreetingPhrase`\n\nOpen up `code/GreetingPhrase` and follow the instructions there on how to put up a new Mockachino endpoint with the JSON contents in the folder.\n\n**Save the endpoint URL for the third step**.\n\n### 3. Deploy `User` service\n\nGo to `code/User` and update the following values in `serverless.yml` with those you got from Honeycomb:\n\n- `LIBHONEY_DATASET`: Name of your dataset\n- `LIBHONEY_API_KEY`: The actual API key\n\nNext, run `npm install` (or `yarn install`) and deploy with `npm run deploy` (or `yarn run deploy`).\n\n**Save the endpoint URL for the third step**.\n\n### 4. Deploy `Greet` service\n\nGo to `code/User` and update the following values in `serverless.yml` with those you got from Honeycomb:\n\n- `LIBHONEY_DATASET`: Name of your dataset\n- `LIBHONEY_API_KEY`: The actual API key\n\nAlso edit the following fields to the values you've saved from before:\n\n- `GREETING_PHRASES_SERVICE_URL` to the Mockachino endpoint URL\n- `GET_USER_NAME_SERVICE_URL` to the `User` service endpoint URL on AWS\n- Set `custom.aws.awsAccountNumber` to your AWS account number\n- Optionally: Set `custom.aws.eventBusName` to the event bus name you have changed it (default: `observabilitydemo`)\n\nInstall the dependencies with `npm install` or `yarn install`, then deploy the service with `npm run deploy` (or `yarn run deploy`).\n\n### 5. Run a bit of test traffic to create logs and traces\n\nYou can either do a crude manual call like `curl -X POST -d '{\"id\":1}' https://RANDOM.execute-api.REGION.amazonaws.com/greet` or use [k6](https://k6.io/).\n\nTo use `k6` you will first need to install it. Go to the `load` folder and run `npm run install:k6` which will use [homebrew](https://brew.sh) to install `k6`.\n\nThen, you will need to modify the load testing script (`test.js`), ensuring the endpoint is updated to your own `greet` endpoint. Now you should be able to run it with `npm test`. Feel free to modify the settings as you please.\n\n### 6. Check and observe!\n\nHoneycomb will get logs streamed continuously from AWS. You should be able to see logs both in AWS CloudWatch as well as in Honeycomb now.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Fserverless-observability-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikaelvesavuori%2Fserverless-observability-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Fserverless-observability-example/lists"}