The APM is working. Now I'm interested in setting up log correlation. But I'm not sure to get the trace and transaction IDs so I can include them in my logs. Thanks for the help!
Hi @wjensen-godaddy what logging library are you using? Our documentation on how to set up log correlation is here. You can inject the IDs into the logs using the apm.currentTraceIds method. Let me know if that helps or if you need more info.
@wjensen-godaddy Hi. Is your console.log(...) inside the handler function? It will need to be for there to be an active transaction. For example, here is a complete handler file of mine:
@wjensen-godaddy
Could it have to do with your usage of import ...? Is this TypeScript code that is being transpiled to JS code that uses commonjs (i.e. require) usage?
Or if this is using import (ES Modules), then there are various limitations there for the APM agent. I don't know how that would affect this case, however. Can you show a more complete example of your handler code?
I suspect esbuild might be including 'elastic-apm-node' in the bundle. I have it as a dev dependency but I forgot to mark it as external. Testing that now...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.