[Feature] Instrument AWS Lambda using ocelot java agent #1217
Replies: 3 comments
-
Hi @gamefundas as far as I know, you can put the agent JAR into your application bundle, so it is available in the Lambda environment, then you can attach it using the I think that the problem is that we asynchronously do the instrumentation, so the instrumentation would kick in when the lambda may be already finished. The agent itself does not provide some "api-mode" but you can use e.g. OpenCensus which is internally used by the agent to collect and send metrics/traces to the backends: See: |
Beta Was this translation helpful? Give feedback.
-
The trouble is AWS Lambda doesnt provide a means for hosting a separate agent jar and using the javaagent java opts, hence I was looking to see if there is any way the agent can be started from within the application jar as part of the handler function. My lambda is not very short lived, it runs usually for a minute so I think the async initialization may not be an issue and I can include OpenCensus for API but bundling the agent is the primary issue. It would be easier if Ocelot has an embedded mode to initialize from a java application itself and be used as a simple Metrics reporter with basic backend configuration. |
Beta Was this translation helpful? Give feedback.
-
I learnt something about AWS Lambda Layers that provides the ability to package external dependencies to the main lambda functions. Seems like New Relic uses the same concept for its Serverless Lambda agents. Looks promising, will figure out a little more on this. |
Beta Was this translation helpful? Give feedback.
-
Have been searching a lot on this but I couldn't find a way to configure a java agent for AWS lambda. Anyone know of ways to attach the ocelot agent from within the application after startup?
Also not quite sure if the tools.jar is available in the classpath of Lambda Openjdk. Think the agent requires this to be able to instrument the app.
If not I am looking for options to see if ocelot can simply be used in API mode to manually push metrics/traces in to configured backends.
Please let me know if anyone has explored Ocelot for Lambda serverless and have found better ways to integrate.
Beta Was this translation helpful? Give feedback.
All reactions