• Stars
    star
    120
  • Rank 286,575 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT No Attribution
  • Created about 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CDK AWS Observability Accelerator

AWS Observability Accelerator for CDK

Welcome to the AWS Observability Accelerator for CDK!

The AWS Observability Accelerator for CDK is a set of opinionated modules to help you set up observability for your AWS environments with AWS Native services and AWS-managed observability services such as Amazon Managed Service for Prometheus,Amazon Managed Grafana, AWS Distro for OpenTelemetry (ADOT) and Amazon CloudWatch.

We provide curated metrics, logs, traces collection, cloudwatch dashboard, alerting rules and Grafana dashboards for your EKS infrastructure, Java/JMX, NGINX based workloads and your custom applications.

Single EKS Cluster AWS Native Observability Accelerator

AWSNative-Architecture

Single EKS Cluster Open Source Observability Accelerator

OpenSource-Architecture

Patterns

The individual patterns can be found in the lib directory. Most of the patterns are self-explanatory, for some more complex examples please use this guide and docs/patterns directory for more information.

Usage

Before proceeding, make sure AWS CLI is installed on your machine.

To use the eks-blueprints and patterns module, you must have Node.js and npm installed. You will also use make and brew to simplify build and other common actions.

Ubuntu Setup

Follow the below steps to setup and leverage cdk-aws-observability-accelerator in your Ubuntu Linux machine.

  1. Update the package list

    Update the package list to ensure you're installing the latest versions.

    sudo apt update
  2. Install make

    sudo apt install make
  3. Install Node.js and npm

    Install Node.js and npm using the NodeSource binary distributions.

    curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
    sudo apt-get install -y nodejs

    Note: The Node.js package from NodeSource includes npm

  4. Verify Node.js and npm Installation

    Check the installed version of Node.js:

    node -v

    The output should be v20.x.x.

    Check the installed version of npm:

    npm -v

    The output should be a version greater than 9.7.x.

    If your npm version is not 9.7.x or above, update npm with the following command:

    sudo npm install -g npm@latest

    Verify the installed version by running npm -v.

  5. Install brew on ubuntu by following instructions as detailed in docs.brew.sh

     /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    Add Homebrew to your PATH

    test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
    test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linux  brew/bin/brew shellenv)"
    test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile
    echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile
     
    

Post completing the above, continue from Step: Repo setup

Mac Setup:

Follow the below steps to setup and leverage cdk-aws-observability-accelerator in your local Mac laptop.

  1. Install make and node using brew
brew install make
brew install node
  1. Install npm
sudo npm install -g n
sudo n stable
  1. Make sure the following pre-requisites are met:
  • Node version is a current stable node version 18.x.
$ node -v
v20.3.1

Update (provided Node version manager is installed): n stable. May require sudo.

  • NPM version must be 8.4 or above:
$ npm -v
9.7.2

Updating npm: sudo n stable where stable can also be a specific version above 8.4. May require sudo.

Repo setup

  1. Clone the cdk-aws-observability-accelerator repository
git clone https://github.com/aws-observability/cdk-aws-observability-accelerator.git

PS: If you are contributing to this repo, please make sure to fork the repo, add your changes and create a PR against it.

  1. Once you have cloned the repo, you can open it using your favourite IDE and run the below commands to install the dependencies and build the existing patterns.
  • Install project dependencies.
make deps
  • To view patterns that are available to be deployed, execute the following:
make build
  • To list the existing CDK AWS Observability Accelerator Patterns
make list

Note: Some patterns have a hard dependency on AWS Secrets (for example GitHub access tokens). Initially you will see errors complaining about lack of the required secrets. It is normal. At the bottom, it will show the list of patterns which can be deployed, in case the pattern you are looking for is not available, it is due to the hard dependency which can be fixed by following the docs specific to those patterns.

To work with patterns use:
	$ make pattern <pattern-name> <list | deploy | synth | destroy>
Example:
	$ make pattern single-new-eks-opensource-observability deploy

Patterns:

	existing-eks-mixed-observability
	existing-eks-opensource-observability
	single-new-eks-awsnative-observability
	single-new-eks-cluster
	single-new-eks-graviton-opensource-observability
	single-new-eks-mixed-observability
	single-new-eks-opensource-observability
  • Bootstrap your CDK environment.
npx cdk bootstrap
  • You can then deploy a specific pattern with the following:
make pattern single-new-eks-opensource-observability deploy

Developer Flow

Modifications

All files are compiled to the dist folder including lib and bin directories. For iterative development (e.g. if you make a change to any of the patterns) make sure to run compile:

make compile

The compile command is optimized to build only modified files and is fast.

New Patterns

To create a new pattern, please follow these steps:

  1. Under lib create a folder for your pattern, such as <pattern-name>-pattern. If you plan to create a set of patterns that represent a particular subdomain, e.g. security or hardening, please create an issue to discuss it first. If approved, you will be able to create a folder with your subdomain name and group your pattern constructs under it.
  2. Blueprints generally don't require a specific class, however we use a convention of wrapping each pattern in a plain class like <Pattern-Name>Pattern. This class is generally placed in index.ts under your pattern folder.
  3. Once the pattern implementation is ready, you need to include it in the list of the patterns by creating a file bin/<pattern-name>.ts. The implementation of this file is very light, and it is done to allow patterns to run independently.

Example simple synchronous pattern:

import SingleNewEksOpenSourceobservabilityPattern from '../lib/single-new-eks-opensource-observability-pattern';
import { configureApp } from '../lib/common/construct-utils';

const app = configureApp();

new SingleNewEksOpenSourceobservabilityPattern(app, 'single-new-eks-opensource');
 // configureApp() will create app and configure loggers and perform other prep steps

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

More Repositories

1

aws-otel-collector

AWS Distro for OpenTelemetry Collector (see ADOT Roadmap at https://github.com/orgs/aws-observability/projects/4)
Go
523
star
2

terraform-aws-observability-accelerator

Open source project to help accelerate and ease observability setup on AWS environments
HCL
226
star
3

observability-best-practices

Observability best practices on AWS
Go
173
star
4

aws-otel-lambda

AWS Distro for OpenTelemetry - AWS Lambda
HCL
119
star
5

aws-o11y-recipes

recipes for observability solutions at AWS
Go
112
star
6

aws-rum-web

Amazon CloudWatch RUM Web Client
TypeScript
103
star
7

aws-otel-community

Welcome to the AWS Distro for OpenTelemetry project. If you're using monitoring and observability tools for AWS products and services, this is a great place to ask questions, request features and network with other community members.
Java
75
star
8

aws-otel-java-instrumentation

AWS Distro for OpenTelemetry Java Instrumentation Library
Java
63
star
9

aws-otel-helm-charts

AWS Distro for OpenTelemetry (ADOT) Helm Charts
Mustache
44
star
10

aws-otel-js

AWS Distro for OpenTelemetry JavaScript SDK
JavaScript
35
star
11

aws-otel-go

AWS Distro for OpenTelemetry Go
Go
34
star
12

aws-otel-playground

Sample Application for the AWS X-Ray SDK with support for OpenTelemetry
Java
31
star
13

aws-otel-test-framework

AWS Distro for OpenTelemetry Test Framework
Java
27
star
14

aws-sigv4-proxy-admission-controller

This project creates a mutation admission controller that injects AWS SIGv4 proxy as a sidecar.
Go
26
star
15

amazon-managed-grafana-migrator

CLI migration utility to migrate Grafana content to Amazon Managed Grafana
Go
22
star
16

aws-otel-dotnet

AWS Distro for OpenTelemetry .NET
C#
21
star
17

aws-otel-python

AWS Distro for OpenTelemetry Python
Python
20
star
18

aws-otel-php

AWS Distro for OpenTelemetry PHP
PHP
15
star
19

amp-eks-iam

Tool providing easy IAM setup on EKS for Amazon Managed Service for Prometheus (AMP) users.
Go
11
star
20

aws-observability-accelerator

AWS Observability Accelerator
11
star
21

aws-otel-ruby

AWS Distro for OpenTelemetry Ruby
Ruby
8
star
22

amp-k8s-config-examples

Configurations for Prometheus including Kubernetes (k8s) Helm charts and Operators
7
star
23

application-signals-demo

Java
6
star