Skip to content

Lambda, opentelemetry: socket hang up

0

Hello,

I have a lambda function with "arn:aws:lambda:eu-central-1:901920570463:layer:aws-otel-nodejs-arm64-ver-1-18-1:3" layer, but when I test my lambda I get this error:

@opentelemetry/instrumentation-http outgoingRequest on request error() Error: socket hang up
    at Socket.socketCloseListener (node:_http_client:473:25)
    at Socket.emit (node:events:531:35)
    at TCP.<anonymous> (node:net:338:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
  code: 'ECONNRESET'
}

I have these env vars:

      AWS_LAMBDA_EXEC_WRAPPER     = "/opt/otel-handler"
      OPENTELEMETRY_TRACE_ENABLED = "true"
      OTEL_LOG_LEVEL              = "DEBUG"

X-Ray traces arrives correctly, but otel data are not present.

The lambda in defined in a VPC, I need otel for SQL analysis.

Full log (in debug):

2024-06-19T08:09:22.376Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	Instrumentation suppressed, returning Noop Span
2024-06-19T08:09:22.529Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	Instrumentation suppressed, returning Noop Span
2024-06-19T08:09:22.530Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	wrap lookup callback function and starts span
2024-06-19T08:09:22.530Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	Instrumentation suppressed, returning Noop Span
2024-06-19T08:09:22.530Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	@opentelemetry/instrumentation-http http instrumentation outgoingRequest
2024-06-19T08:09:22.531Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	@opentelemetry/instrumentation-http http.ClientRequest return request
2024-06-19T08:09:22.628Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	executing wrapped lookup callback function
2024-06-19T08:09:22.628Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	executing original lookup callback function
2024-06-19T08:09:32.380Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	@opentelemetry/instrumentation-http outgoingRequest on request error() Error: socket hang up
    at Socket.socketCloseListener (node:_http_client:473:25)
    at Socket.emit (node:events:531:35)
    at TCP.<anonymous> (node:net:338:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
  code: 'ECONNRESET'
}
2024-06-19T08:09:32.382Z	cfb39285-3e75-4991-b2cf-38a15ec79256	DEBUG	@opentelemetry/instrumentation-http outgoingRequest on request close()
END RequestId: cfb39285-3e75-4991-b2cf-38a15ec79256
REPORT RequestId: cfb39285-3e75-4991-b2cf-38a15ec79256	Duration: 11951.47 ms	Billed Duration: 11952 ms	Memory Size: 128 MB	Max Memory Used: 120 MB	Init Duration: 1114.71 ms	
XRAY TraceId: 1-6672922e-29f691ca4ec81dc82b3a8415	SegmentId: 33224cd706a16441	Sampled: true
asked 2 years ago641 views
1 Answer
0

Hello. I'm sorry, but this is not a solution.

The 'ECONNRESET' error typically indicates a disconnection from the other end of the connection.

If you are outputting to X-Ray, please check if the Lambda execution role has permission to use X-Ray.

https://aws.amazon.com/jp/blogs/opensource/auto-instrumenting-a-python-application-with-an-aws-distro-for-opentelemetry-lambda-layer/

Setting OTEL_LOG_LEVEL to “debug” and log the OTEL process may be a good idea.

EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.