Lumigo Docs

JVM

Configuring the Lumigo tracer for JVM Lambda functions consists of two steps: setting up the dependency, then wrapping your code.

Overview

Configuring the Lumigo tracer for JVM Lambda functions consists of two steps: setting up the dependency, then wrapping your code.

Setting the Lumigo dependency

Add the Lumigo Java tracer dependencies to your application configuration using the following code:

<dependency>
  <groupId>io.lumigo</groupId>
  <artifactId>java-tracer</artifactId>
  <version>{version}</version>
</dependency>

<dependency>
  <groupId>io.lumigo</groupId>
  <artifactId>lumigo-agent</artifactId>
  <version>{version}</version>
</dependency>

Wrapping the code

With the package installed, simply implement a supplier with your code included, as the following example demonstrates:

class MyFunction implements RequestHandler<INPUT, OUTPUT> {
  
  static{
    LumigoConfiguration.builder().token("YOUR TOKEN HERE").build().init();
  }
  
  @Override
    public OUTPUT handleRequest(INPUT event, Context context) {
    Supplier<OUTPUT> supplier = () -> {
      //Your lambda code
      // return <result of type OUTPUT>;
    };
    
    return LumigoRequestExecutor.execute(event, context, supplier);
  }
}

You should now see events flowing through from your JVM Lambda function!

Updated 2 months ago


JVM


Configuring the Lumigo tracer for JVM Lambda functions consists of two steps: setting up the dependency, then wrapping your code.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.