elastic / apm-agent-nodejs

https://www.elastic.co/guide/en/apm/agent/nodejs/current/index.html
BSD 2-Clause "Simplified" License
585 stars 225 forks source link

Support aws EventBridge instrumentation #4166

Open calindurnea opened 4 months ago

calindurnea commented 4 months ago

Is your feature request related to a problem? Please describe. I would like to have a module that enables instrumentation of AWS lambdas that use EventBridge as a trigger.

Describe the solution you'd like When a lambda gets triggered by an EventBridge event I would like instrumentation to be tracked similarly to how the AWS SQS functions.

Describe alternatives you've considered I have attempted to use the lambda layers and then start custom transactions to continue the tracing. When doing this I have encountered issues with the custom traces not being sent to elasticsearch, I could only see the default trace that the layer generate on a new lambda invocation, but without any other context (for example the traceparent)

I would be open to giving it a shot at implementing this myself. I am open to any feedback or guidelines.

trentm commented 4 months ago

Hi @calindurnea, I (we, Elastic) won't have the time to implement this myself. I should be able to give you some support/review if you attempt to implement this yourself.

Some notes to get you started:

I haven't used EventBridge myself, so my help might be limited. I'm not sure if there will be a good or easy story for distributed tracing, i.e. for passing around trace-id, span-id, and flags (typically done with the traceparent header in HTTP). This APM agent doesn't do anything with AWS X-Ray.

calindurnea commented 4 months ago

Hello @trentm, Thank you for the reply! I will attempt to implement this and see how it goes. I appreciate the information, and I will reach out if anything.