1+ # Java Tracer
2+
13[ ![ CircleCI] ( https://dl.circleci.com/status-badge/img/gh/lumigo-io/java-tracer/tree/master.svg?style=svg )] ( https://dl.circleci.com/status-badge/redirect/gh/lumigo-io/java-tracer/tree/master )
24![ Version] ( https://img.shields.io/badge/version-1.0.38-green.svg )
35[ ![ codecov] ( https://codecov.io/gh/lumigo-io/java-tracer/branch/master/graph/badge.svg?token=D3IZ5hQwaQ )] ( https://codecov.io/gh/lumigo-io/java-tracer )
46
57Supported Runtimes: Java 8, Java 11
68
7- # Building With Lumigo
8- ## Maven
9+ ## Building With Lumigo
10+
11+ ### Maven
12+
913Include lumigo java tracer dependency, for [ Maven] ( https://maven.apache.org ) projects, use:
14+
1015``` xml
1116<repositories >
1217 <repository >
@@ -29,46 +34,53 @@ Include lumigo java tracer dependency, for [Maven](https://maven.apache.org) pro
2934 <version >1.0.38</version >
3035</dependency >
3136```
37+
3238Find the latest version here (the format of the version will be n.n.n):
3339
34- # Wrapping your Lambda
40+ ## Wrapping your Lambda
41+
3542* Wrap your lambda function by implementing a supplier which contains your code
36- ``` java
37- class MyFunction implements RequestHandler<INPUT , OUTPUT > {
38-
39- @Override
40- public OUTPUT handleRequest (INPUT event , Context context ) {
41- Supplier<OUTPUT > supplier = () - > {
42- // Your lambda code
43- // return <result of type OUTPUT>;
44- };
45- return LumigoRequestExecutor . execute(event, context, supplier);
43+
44+ ``` java
45+ class MyFunction implements RequestHandler<INPUT , OUTPUT > {
46+
47+ @Override
48+ public OUTPUT handleRequest (INPUT event , Context context ) {
49+ Supplier<OUTPUT > supplier = () - > {
50+ // Your lambda code
51+ // return <result of type OUTPUT>;
52+ };
53+ return LumigoRequestExecutor . execute(event, context, supplier);
54+ }
4655 }
47- }
48- ```
56+ ```
57+
4958* For handler return void use:
5059
51- ``` java
52- class MyFunction implements RequestHandler<INPUT , Void > {
53-
54- @Override
55- public Void handleRequest (INPUT event , Context context ) {
56- Supplier<Void > supplier = () - > {
57- // Your lambda code
58- return null ;
59- };
60- return LumigoRequestExecutor . execute(event, context, supplier);
60+ ```java
61+ class MyFunction implements RequestHandler<INPUT , Void > {
62+
63+ @Override
64+ public Void handleRequest (INPUT event , Context context ) {
65+ Supplier<Void > supplier = () - > {
66+ // Your lambda code
67+ return null ;
68+ };
69+ return LumigoRequestExecutor . execute(event, context, supplier);
70+ }
6171 }
62- }
63- ```
72+ ```
73+
74+ ### Configuration
6475
65- ## Configuration
6676There are 2 way to pass configuration properties
6777
68- ### Environment variables
69- Adding `LUMIGO_TRACER_TOKEN` environment variables
78+ #### Environment variables
79+
80+ Adding `LUMIGO_TRACER_TOKEN ` environment variables
81+
82+ #### Static code initiation
7083
71- ### Static code initiation
7284```java
7385class MyFunction implements RequestHandler<String , String > {
7486
@@ -87,7 +99,7 @@ class MyFunction implements RequestHandler<String, String> {
8799 }
88100```
89101
90- ## Java 11 Support
102+ ### Java 11 Support
103+
91104Add the environment variable ` JAVA_TOOL_OPTIONS ` to your Lambda functions and set it to
92105` -Djdk.attach.allowAttachSelf=true ` in addition to the manual code mentioned above.
93-
0 commit comments