@@ -251,25 +251,21 @@ See below an example of how to automatically flush metrics with the Middy-compat
251251
252252=== "Example CloudWatch Logs excerpt"
253253
254- ```json hl_lines="2 7 10 15 22"
254+ ```json
255255 {
256256 "successfulBooking": 1.0,
257257 "_aws": {
258- "Timestamp": 1592234975665,
259- "CloudWatchMetrics": [
260- {
261- "Namespace": "serverlessAirline",
262- "Dimensions": [
263- [
264- "service"
265- ]
266- ],
267- "Metrics": [
268- {
269- "Name": "successfulBooking",
270- "Unit": "Count"
271- }
272- ]
258+ "Timestamp": 1592234975665,
259+ "CloudWatchMetrics": [{
260+ "Namespace": "serverlessAirline",
261+ "Dimensions": [
262+ [ "service" ]
263+ ],
264+ "Metrics": [{
265+ "Name": "successfulBooking",
266+ "Unit": "Count"
267+ }]
268+ }]
273269 },
274270 "service": "orders"
275271 }
@@ -293,25 +289,21 @@ The `logMetrics` decorator of the metrics utility can be used when your Lambda h
293289
294290=== "Example CloudWatch Logs excerpt"
295291
296- ```json hl_lines="2 7 10 15 22"
292+ ```json
297293 {
298294 "successfulBooking": 1.0,
299295 "_aws": {
300- "Timestamp": 1592234975665,
301- "CloudWatchMetrics": [
302- {
303- "Namespace": "successfulBooking",
304- "Dimensions": [
305- [
306- "service"
307- ]
308- ],
309- "Metrics": [
310- {
311- "Name": "successfulBooking",
312- "Unit": "Count"
313- }
314- ]
296+ "Timestamp": 1592234975665,
297+ "CloudWatchMetrics": [{
298+ "Namespace": "successfulBooking",
299+ "Dimensions": [
300+ [ "service" ]
301+ ],
302+ "Metrics": [{
303+ "Name": "successfulBooking",
304+ "Unit": "Count"
305+ }]
306+ }]
315307 },
316308 "service": "orders"
317309 }
@@ -332,27 +324,21 @@ You can manually flush the metrics with `publishStoredMetrics` as follows:
332324
333325=== "Example CloudWatch Logs excerpt"
334326
335- ```json hl_lines="2 7 10 15 22"
327+ ```json
336328 {
337329 "successfulBooking": 1.0,
338330 "_aws": {
339- "Timestamp": 1592234975665,
340- "CloudWatchMetrics": [
341- {
342- "Namespace": "successfulBooking",
343- "Dimensions": [
344- [
345- "service"
346- ]
347- ],
348- "Metrics": [
349- {
350- "Name": "successfulBooking",
351- "Unit": "Count"
352- }
353- ]
354- }
355- ]
331+ "Timestamp": 1592234975665,
332+ "CloudWatchMetrics": [{
333+ "Namespace": "successfulBooking",
334+ "Dimensions": [
335+ [ "service" ]
336+ ],
337+ "Metrics": [{
338+ "Name": "successfulBooking",
339+ "Unit": "Count"
340+ }]
341+ }]
356342 },
357343 "service": "orders"
358344 }
@@ -410,35 +396,27 @@ You can add high-cardinality data as part of your Metrics log with the `addMetad
410396
411397=== "Example CloudWatch Logs excerpt"
412398
413- ```json hl_lines="23 "
399+ ```json hl_lines="31 "
414400 {
415401 "successfulBooking": 1.0,
416402 "_aws": {
417- "Timestamp": 1592234975665,
418- "CloudWatchMetrics": [
419- {
420- "Namespace": "serverlessAirline",
421- "Dimensions": [
422- [
423- "service"
424- ]
425- ],
426- "Metrics": [
427- {
428- "Namespace": "exampleApplication",
403+ "Timestamp": 1592234975665,
404+ "CloudWatchMetrics": [{
405+ "Namespace": "serverlessAirline",
429406 "Dimensions": [
430- [
431- "service"
432- ]
407+ [ "service" ]
433408 ],
434- "Metrics": [
435- {
436- "Name": "successfulBooking",
437- "Unit": "Count"
438- }
439- ]
440- }
441- ]
409+ "Metrics": [{
410+ "Namespace": "exampleApplication",
411+ "Dimensions": [
412+ [ "service" ]
413+ ],
414+ "Metrics": [{
415+ "Name": "successfulBooking",
416+ "Unit": "Count"
417+ }]
418+ }]
419+ }]
442420 },
443421 "service": "orders",
444422 "bookingId": "7051cd10-6283-11ec-90d6-0242ac120003"
0 commit comments