Skip to content

Commit f8a10e9

Browse files
Results from /fix:all
1 parent a858b7b commit f8a10e9

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

content/en/blog/2025/observing-lambdas/index.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ linkTitle: Observing Lambdas
55
date: 2025-01-24
66
cSpell:ignore: Dominik
77
---
8+
89
Getting telemetry data out of modern applications is very straightforward (or at
910
least it should be). You set up a collector which either receives data from your
1011
application or asks it to provide an up-to-date state of various counters. This
@@ -17,13 +18,13 @@ AWS Lambda.
1718
In this execution model, functions are called directly, and the environment is
1819
frozen afterward. You’re only billed for actual execution time and no longer
1920
need a server to wait for incoming requests. This is also where the term
20-
serverless comes from. Keeping the function alive until metrics can be
21-
collected isn’t really an option and even if you were willing to pay for that,
22-
different invocations will have a completely separate context and not
23-
necessarily know about all the other executions happening simultaneously. You
24-
might now be saying: "I'll just push all the data at the end of my execution, no
25-
issues here!", but that doesn’t solve the issue. You’ll still have to pay for
26-
the time it takes to send the data and with many invocations, this adds up.
21+
serverless comes from. Keeping the function alive until metrics can be collected
22+
isn’t really an option and even if you were willing to pay for that, different
23+
invocations will have a completely separate context and not necessarily know
24+
about all the other executions happening simultaneously. You might now be
25+
saying: "I'll just push all the data at the end of my execution, no issues
26+
here!", but that doesn’t solve the issue. You’ll still have to pay for the time
27+
it takes to send the data and with many invocations, this adds up.
2728

2829
But there is another way! Lambda extension layers allow you to run any process
2930
alongside your code, sharing the execution runtime and providing additional
@@ -37,10 +38,12 @@ of the Lambda lifecycle and ensures your telemetry gets to the storage layer.
3738
When your function is called for the first time, the extension layer starts an
3839
instance of the OpenTelemetry Collector. The Collector build is a stripped down
3940
version, providing only components necessary in the context of Lambda. It
40-
registers with the Lambda [Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html)
41-
and [Telemetry API](https://docs.aws.amazon.com/lambda/latest/dg/telemetry-api.html). By doing
42-
this, it receives notifications whenever your function is executed, emits a
43-
logline, or the execution context is about to be shut down.
41+
registers with the Lambda
42+
[Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html)
43+
and
44+
[Telemetry API](https://docs.aws.amazon.com/lambda/latest/dg/telemetry-api.html).
45+
By doing this, it receives notifications whenever your function is executed,
46+
emits a logline, or the execution context is about to be shut down.
4447

4548
### This is where the magic happens
4649

@@ -54,11 +57,10 @@ its thing.
5457

5558
{{< figure src="diagram-execution-timing.svg" caption="Diagram showcasing how execution timing differs with and without a Collector">}}
5659

57-
5860
## How can I use it?
5961

60-
As of November 2024, the opentelemetry-lambda project publishes [releases of the
61-
Collector extension layer](https://github.com/open-telemetry/opentelemetry-lambda/releases/tag/layer-collector%2F0.12.0).
62+
As of November 2024, the opentelemetry-lambda project publishes
63+
[releases of the Collector extension layer](https://github.com/open-telemetry/opentelemetry-lambda/releases/tag/layer-collector%2F0.12.0).
6264
It can be configured through a configuration file hosted either in an S3 bucket
6365
or on an arbitrary HTTP server. It is also possible to bundle the configuration
6466
file with your Lambda code. In both cases, you have tradeoffs to consider.
@@ -67,8 +69,8 @@ request needs to be made, while bundling the configuration increases the
6769
management overhead when trying to control the configuration for multiple
6870
Lambdas.
6971

70-
The simplest way to get started is with an embedded configuration. For this,
71-
add a file called `collector.yaml` to your function. This is a regular Collector
72+
The simplest way to get started is with an embedded configuration. For this, add
73+
a file called `collector.yaml` to your function. This is a regular Collector
7274
configuration file. To take advantage of the Lambda specific extensions, they
7375
need to be configured. As an example, the following configuration receives
7476
traces and logs from the Telemetry API and sends them to another endpoint:

static/refcache.json

+20
Original file line numberDiff line numberDiff line change
@@ -2423,10 +2423,18 @@
24232423
"StatusCode": 206,
24242424
"LastSeen": "2024-07-10T17:01:44.550734457Z"
24252425
},
2426+
"https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html": {
2427+
"StatusCode": 206,
2428+
"LastSeen": "2025-01-24T22:43:02.419614644Z"
2429+
},
24262430
"https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html": {
24272431
"StatusCode": 206,
24282432
"LastSeen": "2024-01-30T16:14:28.171642-05:00"
24292433
},
2434+
"https://docs.aws.amazon.com/lambda/latest/dg/telemetry-api.html": {
2435+
"StatusCode": 206,
2436+
"LastSeen": "2025-01-24T22:43:04.492478898Z"
2437+
},
24302438
"https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html": {
24312439
"StatusCode": 206,
24322440
"LastSeen": "2024-08-02T13:14:36.601347-04:00"
@@ -10179,10 +10187,18 @@
1017910187
"StatusCode": 206,
1018010188
"LastSeen": "2025-01-13T11:43:25.504793-05:00"
1018110189
},
10190+
"https://github.com/open-telemetry/opentelemetry-lambda/blob/main/collector/README.md": {
10191+
"StatusCode": 206,
10192+
"LastSeen": "2025-01-24T22:43:01.001644641Z"
10193+
},
1018210194
"https://github.com/open-telemetry/opentelemetry-lambda/releases": {
1018310195
"StatusCode": 200,
1018410196
"LastSeen": "2024-08-09T10:44:10.275849-04:00"
1018510197
},
10198+
"https://github.com/open-telemetry/opentelemetry-lambda/releases/tag/layer-collector%2F0.12.0": {
10199+
"StatusCode": 206,
10200+
"LastSeen": "2025-01-24T22:43:07.062401954Z"
10201+
},
1018610202
"https://github.com/open-telemetry/opentelemetry-operator": {
1018710203
"StatusCode": 206,
1018810204
"LastSeen": "2025-01-07T10:31:41.081498-05:00"
@@ -13963,6 +13979,10 @@
1396313979
"StatusCode": 200,
1396413980
"LastSeen": "2024-08-09T10:45:45.030209-04:00"
1396513981
},
13982+
"https://github.com/theSuess": {
13983+
"StatusCode": 206,
13984+
"LastSeen": "2025-01-24T22:42:58.33209764Z"
13985+
},
1396613986
"https://github.com/thegeekyasian/go-chi-otel": {
1396713987
"StatusCode": 200,
1396813988
"LastSeen": "2024-02-20T05:41:18.324089503Z"

0 commit comments

Comments
 (0)