aws-observability / observability-best-practices

Observability best practices on AWS
https://aws-observability.github.io/observability-best-practices/
MIT No Attribution
224 stars 69 forks source link

The lambda function failed #120

Open gaussye opened 7 months ago

gaussye commented 7 months ago

I follow the guide https://docs.aws.amazon.com/prometheus/latest/userguide/integrating-cw-firehose.html to setup the solution with CDK. All resources can created successfully. When I create a Metric Stream for the firehose created by CDK.

I got the following error message when calling the lambda from firehose.

2024/03/11 07:09:34 { "errorMessage": "invalid character 'Þ' looking for beginning of value", "errorType": "SyntaxError", "stackTrace": [ { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/errors.go", "line": 39, "label": "lambdaPanicResponse" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/invoke_loop.go", "line": 116, "label": "callBytesHandlerFunc.func1" }, { "path": "runtime/panic.go", "line": 884, "label": "gopanic" }, { "path": "lambda/main.go", "line": 84, "label": "HandleRequest" }, { "path": "reflect/value.go", "line": 586, "label": "Value.call" }, { "path": "reflect/value.go", "line": 370, "label": "Value.Call" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/handler.go", "line": 293, "label": "reflectHandler.func2" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/invoke_loop.go", "line": 119, "label": "callBytesHandlerFunc" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/invoke_loop.go", "line": 75, "label": "handleInvoke" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/invoke_loop.go", "line": 39, "label": "startRuntimeAPILoop" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/entry.go", "line": 106, "label": "start" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/entry.go", "line": 69, "label": "StartWithOptions" }, { "path": "github.com/aws/aws-lambda-go@v1.37.0/lambda/entry.go", "line": 45, "label": "Start" }, { "path": "lambda/main.go", "line": 119, "label": "main" }, { "path": "runtime/proc.go", "line": 250, "label": "main" }, { "path": "runtime/asm_amd64.s", "line": 1598, "label": "goexit" } ] }

gauravkohli commented 4 months ago

hey @gaussye

Can you check if the output format from CW metrics stream is JSON and not Open Telemetry as that might explain this issue?