Skip to content

Question about the OpenTelemetry tracing layer example #848

Closed Answered by calavera
Oliboy50 asked this question in Q&A
Discussion options

You must be logged in to vote

It's not the same. When you call runtime.run().await?;, the runtime starts an event loop waiting for messages from Lambda to invoke your code. The purpose if the layer is to flush the traces after completing every invocation that the runtime receives. The runtime will call all the layers inside the event loop. The first snippet makes force_flush to be executed after every invocation.

If you put the code after calling runtime.run().await?;, the force_flush method is only invoked when Lambda destroys the sandbox to process the invocations, not after every invocation.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Oliboy50
Comment options

@borchero
Comment options

@bnusunny
Comment options

@Oliboy50
Comment options

Answer selected by Oliboy50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants