aws-samples / aws-samples/serverless-patterns

New pattern submission - lambda-cloudwatch-otlp-metrics-sam

Aperta
#3,299 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.8k
Fork
1.1k
Merge medio
7g 14h
PR unite (30g)
6

Descrizione

**Pattern name:** lambda-cloudwatch-otlp-metrics-sam

**Pull request:** https://github.com/aws-samples/serverless-patterns/pull/3298

**Description:**

Send custom Lambda metrics to Amazon CloudWatch over OTLP. The function records a counter and a histogram using only the OpenTelemetry metrics API, and the AWS Distro for OpenTelemetry Lambda layer runs a collector that signs each request with SigV4 and forwards it to the CloudWatch OTLP endpoint. The function makes no PutMetricData calls and writes no embedded metric format logs, and the only permission it needs is cloudwatch:PutMetricData.

Compared with embedded metric format there is no per series charge, and the endpoint accepts up to 150 labels per metric against the 30 dimensions allowed by PutMetricData, so high cardinality metrics are much cheaper and richer.

**Services used:** AWS Lambda, Amazon CloudWatch (OTLP metrics endpoint), AWS Distro for OpenTelemetry Lambda layer.

**Language:** Python 3.13
**Framework:** AWS SAM
**Level:** 300

Tested end to end in a live account: deployed, invoked, confirmed the collector exported without errors, and queried the CloudWatch PromQL endpoint to verify the data points arrived with the expected value and labels. The stack was then deleted.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Esamina innanzitutto la pull request collegata #3298 e il relativo pattern lambda-cloudwatch-otlp-metrics-sam. Controlla la Lambda Python 3.13, la configurazione AWS SAM, le autorizzazioni e la AWS Distro for OpenTelemetry Lambda layer, quindi verifica il deployment end-to-end documentato e i risultati di CloudWatch PromQL. Il lavoro è completato quando il pattern è completo, distribuibile e le metriche esportate arrivano con i valori e le labels previste.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, python
Ambito
cloud, observability-sre
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.