Skip to content

Commit

Permalink
pass missing parameter to aws logs handler for kinesis (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
ge0Aja authored May 30, 2024
1 parent 86a24c2 commit 61f1670
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions aws/logs_monitoring/steps/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def parse(event, context, cache_layer):
case AwsEventType.SNS:
events = sns_handler(event, metadata)
case AwsEventType.KINESIS:
events = kinesis_awslogs_handler(event, context, metadata)
events = kinesis_awslogs_handler(event, context, metadata, cache_layer)
case _:
events = ["Parsing: Unsupported event type"]
except Exception as e:
Expand Down Expand Up @@ -154,12 +154,13 @@ def sns_handler(event, metadata):


# Handle CloudWatch logs from Kinesis
def kinesis_awslogs_handler(event, context, metadata):
def kinesis_awslogs_handler(event, context, metadata, cache_layer):
def reformat_record(record):
return {"awslogs": {"data": record["kinesis"]["data"]}}

return itertools.chain.from_iterable(
awslogs_handler(reformat_record(r), context, metadata) for r in event["Records"]
awslogs_handler(reformat_record(r), context, metadata, cache_layer)
for r in event["Records"]
)


Expand Down
1 change: 0 additions & 1 deletion oci/dd-metrics-function.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,3 @@ def handler(ctx: context.InvokeContext, data: io.BytesIO = None) -> response.Res
response_data=json.dumps({"result": result}),
headers={"Content-Type": "application/json"},
)

0 comments on commit 61f1670

Please sign in to comment.