Posts

Showing posts from June, 2022

Implementing custom telemetry using AWS CloudWatch SDK.

Image
Hello Friends, Today we will be creating custom telemetry using AWS Cloudwatch SDK. This will use Cloudwatch to store the data. To understand more about Cloudwatch metrics please visit this   LINK . Prerequisites: AWS Account . GO setup on the machine . VS code . Now that we know what we are doing let's start the implementation. Create a golang project in vs code. add the below code to  main.go  and import all the necessary libraries. Please create an IAM role to add  SECRET_KEY, ACCESS_KEY . Also, add the region to the placeholder. the below code will create a namespace in AWS Cloudwatch with the name  MyAppTelemetry  and add a custom metric with the name  CustomMetric.  this metric will spit out random values when you run the application. package main import ( "math/rand" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/cloudwatch...