AWS Notes
5.6K subscribers
445 photos
42 videos
10 files
2.8K links
AWS Notes — Amazon Web Services Educational and Information Channel

Chat: https://xn--r1a.website/aws_notes_chat

Contacts: @apple_rom, https://www.linkedin.com/in/roman-siewko/
Download Telegram
​​CloudWatch RUM (Real-User Monitoring):

https://aws.amazon.com/blogs/aws/cloudwatch-rum/

Такой себе вариант Google Analytics от AWS для отработки ошибок и производительности на клиентской стороне, т.е. у юзеров (потому Real-User).

#CloudWatch
​​How to send repeated notifications for CloudWatch Alarms:

https://aws.amazon.com/blogs/mt/how-to-enable-amazon-cloudwatch-alarms-to-send-repeated-notifications/

1️⃣ CloudWatch alarm is triggered and goes into the ALARM state.
2️⃣ CloudWatch alarm sends the first alarm notification to the associated SNS alarm actions.
3️⃣ CloudWatch Alarms service sends an alarm state change event which triggers the EventBridge rule.
4️⃣ With a match event, the EventBridge rule invokes the Step Function target.
5️⃣ Once the Step Function starts execution, it first enters a Wait state.
6️⃣ The Step Function enters the Lambda Invocation task. The Lambda invocation task:
▫️ Checks if the alarm has the specific tag key and value (e.g., RepeatedAlarm:true). If not, the function exits
▫️ Checks the alarm’s current state by performing a DescribeAlarms API with the alarm name.
▫️ Publishes the existing alarm’s status returned from the DescribeAlarms API call to all the SNS topics subscribed on the alarm
▫️ Returns the alarm’s current state together with the original received event back to the Step Function.
7️⃣ The Choice state checks the alarm state returned by the Lambda function and directs the workflow to go back to the Wait state if the alarm state is ‘ALARM’ otherwise it ends the step function’s execution.
8️⃣ The repeated notification for an alarm within the workflow above stops when:
▫️ The alarm transitions to a non-ALARM state.
▫️ The alarm is deleted.
▫️ A specific tag is removed from the alarm.

#CloudWatch
CloudWatch Container Insights for EKS Fargate using ADOT (AWS Distro for OpenTelemetry):

https://aws.amazon.com/blogs/containers/introducing-amazon-cloudwatch-container-insights-for-amazon-eks-fargate-using-aws-distro-for-opentelemetry/

▫️ This blog presented an overview of the design of the ADOT Collector for EKS Fargate with support for CloudWatch Container Insights and demonstrated its deployment and metrics collection from workloads on an EKS Fargate cluster.
▫️ A single collector instance is able to discover all the worker nodes in an EKS cluster through the use of Kubernetes service discovery and collect metrics from them by using the Kubernetes API server as a proxy for the kubelet on worker nodes.
▫️ EKS customers will now be able to collect system metrics such as CPU, memory, disk, and network usage from workloads that are deployed to an EKS Fargate cluster and visualize them in CloudWatch dashboards, providing the same experience as CloudWatch agent.

#CloudWatch
👍2
​​Weekly Summary on AWS (February 20-26)

🔸 Amplify + The Authenticator UI Library for Flutter
🔸 AppSync + custom response headers
🔸 App Mesh + Agent for Envoy
🔸 App Runner + Java
🔸 Billing + Payment Profiles
🔸 CloudWatch Agent
Configurable Log Group Retention
NVIDIA GPU Metrics
🔸 Connect Customer Profiles + high-volume ingestion of customer data
🔸 EC2 Auto Scaling Warm Pools + hibernating and returning instances to Warm Pools on scale-in
🔸 Firewall Manager + AWS Network Firewall Centralized Deployment Model
🔸 Glue Job Run Insights
🔸 Glue DataBrew + choose single or multiple output files
🔸 Glue Schema Registry + Protobuf
🔸 Lambda + .NET 6
🔸 QuickSight’s new community hub
🔸 RDS for MariaDB + IAM authentication
🔸 Redshift + PIVOT and UNPIVOT SQL operators
🔸 S3 + additional checksum algorithms
🔸 SageMaker + 322 popular ML models
🔸 SAM CLI + TypeScript
🔸 Transfer Family + enhancements to workflows
🔹 NICE DCV version 2022.0 and Web Client SDK version 1.1.0

#AWS_week
👍3👎1
​​🆕 CloudWatch Internet Monitor:

https://aws.amazon.com/blogs/aws/cloudwatch-internet-monitor-end-to-end-visibility-into-internet-performance-for-your-applications/

Internet Monitor uses the connectivity data that we capture from our global networking footprint to calculate a baseline of performance and availability for internet traffic. This is the same data that we use at AWS to monitor our own internet uptime and availability. With Internet Monitor, you can gain awareness of problems that arise on the internet experienced by your end users in different geographic locations and networks.
● There is no need to instrument your application code. You can enable the service in the CloudWatch section of the AWS Management Console and start to use it immediately.

#CloudWatch
👍3
​​🆕 CloudWatch Cross-Account Observability:

https://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-cross-account-observability/

To enable cross-account observability, CloudWatch has introduced the concept of monitoring and source accounts:
◘ A monitoring account is a central AWS account that can view and interact with observability data shared by other accounts.
◘ A source account is an individual AWS account that shares observability data and resources with one or more monitoring accounts.

You can configure multiple monitoring accounts with the level of visibility you need. CloudWatch cross-account observability is also integrated with Organizations.

💳 Cross-account observability in CloudWatch comes with no extra cost for logs and metrics, and the first trace copy is free. 👍

#CloudWatch
🎉6👍1
Ещё 0.44 дашборды и придётся платить!

#CloudWatch #Budgets #FreeTier
😁29
6️⃣ CloudWatch Agent можно установить в виртуалку прямо из AWS Console. Но это не точно.

Коллеги, подскажите, у кого-то работает сие чудо?

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-and-configure-cloudwatch-agent-using-ec2-console.html#install-and-configure-cw-agent-procedure

Всю жизнь мечтал. Вопрос каждого первого начинающего работать с AWS — а где нагрузка по процессам и свободное место на диске? Неужели свершилось?

Кто пропустил, краткая история предыдущих серий CloudWatch Agent.

1️⃣ Ничего не было, выживали мониторили, как могли.
2️⃣ Скрипт на Perl, ура, спасибо, что не Fortran! Установка ручками через SSH.
3️⃣ Везде Docker. В деревне Гадюкино CloudWatch Agent — скрипт на Perl, установка через SSH.
4️⃣ Везде Kubernetes и Serverless, в CloudWatch Agent — скрипт на Perl, установка через CloudFormation.
5️⃣ CloudWatch Agent переписали на Go, установка через SSM.

#CloudWatch
🔥5👏31
👍1💩1
Есть база данных AWS RDS(8.0.mysql_aurora.3.08.0) + RDS Proxy.
К базе подключено N клиентов-приложений. Допустим их 10. Все подключены через прокси.

Появилась задача понять "кто из приложений кушает больше всего коннекшнов и отобразить это на графике".

Большее обсервабилити, большая детализация. Больше SRE👏
Однако штатно таких метрик не существует(ну или же я просто не нашёл).
Вариант с лямбдой и
SELECT usename, count(*) 
FROM pg_stat_activity
GROUP BY usename;

Мне показался туповатым.

Я не знаю как это делают правильные инженеры, опишу свой вариант решения, который сделал в выходные.

- создаем в базе данных 10 новых пользователей с нужными правами
- добавляем креды новых юзеров в secret manager
- добавляем аксесс этих юзеров на RDS proxy кредами из secret manager
resource "aws_db_proxy" "this" {
...
auth {
auth_scheme = "SECRETS"
iam_auth = "DISABLED"
client_password_auth_type = "MYSQL_NATIVE_PASSWORD"
secret_arn = aws_secretsmanager_secret.user1_credentials.arn
}
auth {
auth_scheme = "SECRETS"
iam_auth = "DISABLED"
client_password_auth_type = "MYSQL_NATIVE_PASSWORD"
secret_arn = aws_secretsmanager_secret.user2_credentials.arn
}
...
}


- создаем новые rds proxy endpoint для каждого из приложений/юзера
resource "aws_db_proxy_endpoint" "this" {
...
db_proxy_endpoint_name = "${var.project}-${var.environment}-user1"
target_role = "READ_WRITE"
...
}

resource "aws_db_proxy_endpoint" "this" {
...
db_proxy_endpoint_name = "${var.project}-${var.environment}-user2"
target_role = "READ_WRITE"
...
}

- переключаем каждое из приложение на свой собственный RDS proxy endpoint через переменные окружения

Отлично, теперь у нас каждый микросервис подключен к отдельному RDS proxy endpoint с отдельными кредами.
Теперь идём в AWS CloudWatch в Dashboards.
У нас есть метрики и мы их можем смело раскинуть по каждому из RDS proxy Endpoint
- ClientConnections 
- DatabaseConnections
- AvailableConnectionPercent
- ConnectionAttempts
- QueryRequests
- QueryRequestsPerSec

Смело строим графики и видим все интересующие параметры по каждому пользователю/приложению.

Итог:
На выходе у нас дашборд, который показывает массу деталей по конкретно каждому юзеру/приложению, что очень важно понять например кто больше делает нагрузки на БД.

Дополнительно:
- перед реализацией не забывайте про ограничения:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html
- всё тоже самое можно сделать создав несколько RDS proxy для каждого приложения, но и платить придётся сильно больше
- есть вы подключили в своей Grafana datasource=CloudWatch, то он пока не умеет выводить метрики дименшна по endpoint, только по отдельным RDS proxy. Пока красивые графики только в CloudWatch Dashboard.

#AWS #observability #cloudwatch
Please open Telegram to view this post
VIEW IN TELEGRAM
👍262
Логи Lambda теперь дешевле

https://aws.amazon.com/blogs/compute/aws-lambda-introduces-tiered-pricing-for-amazon-cloudwatch-logs-and-additional-logging-destinations/

Если у вас их было очень много (терабайты - но зачем?), то экономия существенная.

Возможность слать логи в S3 выглядит привлекательно, но как понимаю, это в довесок к CloudWatch, а не вместо — экономия лишь на хранении (а основной расход - ingestion).

#Lambda #CloudWatch #S3
🍾2
CloudWatch прокачался:

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceMap.html

• Auto-discovers relationships between AWS resources
• Creates interactive topology maps of your entire infrastructure
• Transforms telemetry into actionable insights
• One-click navigation to metrics, logs, and traces

Для того, чтобы видеть и пользоваться всей этой красотой прямо из коробки, требуется включить CloudWatch Application Signals.

P.S. Зачем вам теперь какая-то Grafana или Datadog, когда есть такой похорошевший CloudWatch!

#CloudWatch
😁17👍4🔥2🤯2👌2🤡1