├── .bumpversion.cfg
├── .circleci
└── config.yml
├── .github
└── workflows
│ └── send-pr-details-on-close.yml
├── .gitignore
├── LICENSE
├── README.md
├── agent
├── pom.xml
└── src
│ └── main
│ └── java
│ └── io
│ └── lumigo
│ └── agent
│ └── Agent.java
├── findbugs
└── findbugs-exclude.xml
├── java-sign-keys
├── private.asc
└── public.asc
├── layers
└── LAYERS.md
├── libs
└── google-java-format-1.7-all-deps.jar
├── local-repository
└── com
│ └── sun
│ └── tools
│ └── 1.7.0.13
│ ├── _remote.repositories
│ ├── tools-1.7.0.13.jar
│ ├── tools-1.7.0.13.jar.lastUpdated
│ ├── tools-1.7.0.13.jar.sha1
│ ├── tools-1.7.0.13.pom
│ ├── tools-1.7.0.13.pom.lastUpdated
│ └── tools-1.7.0.13.pom.sha1
├── maven
└── settings.xml
├── pom.xml
├── scripts
├── bd_to_prod.sh
├── checks.sh
├── ci_deploy.sh
├── deploy.sh
└── prepare_layer_files.sh
└── src
├── main
├── java
│ └── io
│ │ └── lumigo
│ │ ├── core
│ │ ├── SpansContainer.java
│ │ ├── configuration
│ │ │ └── Configuration.java
│ │ ├── instrumentation
│ │ │ ├── LumigoInstrumentationApi.java
│ │ │ ├── agent
│ │ │ │ ├── Installer.java
│ │ │ │ └── Loader.java
│ │ │ └── impl
│ │ │ │ ├── AmazonHttpClientInstrumentation.java
│ │ │ │ ├── AmazonHttpClientV2Instrumentation.java
│ │ │ │ ├── ApacheHttpInstrumentation.java
│ │ │ │ ├── ApacheKafkaConsumerInstrumentation.java
│ │ │ │ ├── ApacheKafkaProducerInstrumentation.java
│ │ │ │ └── AwsLambdaRequestHandlerInstrumentation.java
│ │ ├── network
│ │ │ └── Reporter.java
│ │ ├── parsers
│ │ │ ├── event
│ │ │ │ ├── APIGWEvent.java
│ │ │ │ ├── APIGWEventParser.java
│ │ │ │ ├── EventParserFactory.java
│ │ │ │ ├── IEventParser.java
│ │ │ │ ├── SnsEvent.java
│ │ │ │ ├── SnsEventParser.java
│ │ │ │ ├── SqsEvent.java
│ │ │ │ └── SqsEventParser.java
│ │ │ ├── v1
│ │ │ │ ├── AwsSdkV1Parser.java
│ │ │ │ ├── AwsSdkV1ParserFactory.java
│ │ │ │ ├── DoNothingV1Parser.java
│ │ │ │ ├── DynamoDBV1Parser.java
│ │ │ │ ├── KinesisV1Parser.java
│ │ │ │ ├── SnsV1Parser.java
│ │ │ │ └── SqsV1Parser.java
│ │ │ └── v2
│ │ │ │ ├── AwsSdkV2Parser.java
│ │ │ │ ├── AwsSdkV2ParserFactory.java
│ │ │ │ ├── DoNothingV2Parser.java
│ │ │ │ ├── DynamoDBV2Parser.java
│ │ │ │ ├── KinesisV2Parser.java
│ │ │ │ ├── SnsV2Parser.java
│ │ │ │ └── SqsV2Parser.java
│ │ └── utils
│ │ │ ├── AwsSdkV2Utils.java
│ │ │ ├── AwsUtils.java
│ │ │ ├── EnvUtil.java
│ │ │ ├── JsonUtils.java
│ │ │ ├── LRUCache.java
│ │ │ ├── SecretScrubber.java
│ │ │ ├── SecretScrubbingPatternProvider.java
│ │ │ ├── StringUtils.java
│ │ │ └── Strings.java
│ │ ├── handlers
│ │ ├── LumigoConfiguration.java
│ │ ├── LumigoRequestExecutor.java
│ │ ├── LumigoRequestHandler.java
│ │ └── LumigoRequestStreamHandler.java
│ │ └── models
│ │ ├── BaseSpan.java
│ │ ├── HttpSpan.java
│ │ ├── KafkaSpan.java
│ │ ├── KafkaSpanFactory.java
│ │ ├── Reportable.java
│ │ └── Span.java
└── resources
│ └── lumigo-version.txt
└── test
└── java
├── infa
└── AwsLambdaEventGenerator.java
└── io
└── lumigo
├── core
├── SpansContainerTest.java
├── configuration
│ └── ConfigurationTest.java
├── instrumentation
│ └── impl
│ │ ├── AmazonHttpClientInstrumentationTest.java
│ │ └── ApacheHttpInstrumentationTest.java
├── network
│ └── ReporterTest.java
├── parsers
│ ├── event
│ │ └── EventParserFactoryTest.java
│ ├── v1
│ │ ├── AwsSdkV1ParserFactoryTest.java
│ │ ├── DynamoDBV1ParserTest.java
│ │ ├── KinesisV1ParserTest.java
│ │ ├── SnsV1ParserTest.java
│ │ └── SqsV1ParserTest.java
│ └── v2
│ │ ├── AwsSdkV2ParserFactoryTest.java
│ │ ├── DynamoDBV2ParserTest.java
│ │ ├── KinesisV2ParserTest.java
│ │ ├── SnsV2ParserTest.java
│ │ └── SqsV2ParserTest.java
└── utils
│ ├── AwsSdkV2UtilsTests.java
│ ├── AwsUtilsTest.java
│ ├── EnvUtilTest.java
│ ├── JsonUtilsTest.java
│ ├── LRUCacheTest.java
│ ├── SecretScrubberTest.java
│ └── StringUtilsTest.java
├── handlers
└── LumigoRequestHandlerTest.java
├── models
├── KafkaSpanFactoryTest.java
└── KafkaSpanTest.java
└── testUtils
└── JsonTestUtils.java
/.bumpversion.cfg:
--------------------------------------------------------------------------------
1 | [bumpversion]
2 | current_version = 1.0.49
3 | commit = True
4 | tag = True
5 |
6 | [bumpversion:file:README.md]
7 |
8 | [bumpversion:file:pom.xml]
9 |
10 | [bumpversion:file:agent/pom.xml]
11 |
12 | [bumpversion:file:src/main/java/io/lumigo/core/configuration/Configuration.java]
13 |
14 | [bumpversion:file:scripts/prepare_layer_files.sh]
15 |
16 | [bumpversion:file:src/main/resources/lumigo-version.txt]
17 |
--------------------------------------------------------------------------------
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2.1
2 |
3 | orbs:
4 | lumigo-orb: &lumigo_orb_version lumigo/lumigo-orb@volatile
5 |
6 | defaults: &defaults
7 | working_directory: ~/java-tracer
8 | docker:
9 | - image: lumigo/ci:latest
10 | auth:
11 | username: lumigo
12 | password: $DOCKERHUB_PASSWORD
13 |
14 | workflows:
15 | test-deploy:
16 | jobs:
17 | - lumigo-orb/print_orb_versions:
18 | lumigo_orb_version: *lumigo_orb_version
19 |
20 | - test:
21 | context:
22 | - common
23 | - java
24 | filters:
25 | branches:
26 | ignore: master
27 |
28 | - lumigo-orb/is_environment_available:
29 | context: common
30 | filters:
31 | branches:
32 | ignore: master
33 |
34 | - lumigo-orb/be-deploy:
35 | context: common
36 | save_project_folder: false
37 | requires:
38 | - lumigo-orb/is_environment_available
39 |
40 | - lumigo-orb/prep-it-resources:
41 | context: common
42 | requires:
43 | - lumigo-orb/is_environment_available
44 |
45 | - lumigo-orb/prep-k8s-and-operator:
46 | context: common
47 | requires:
48 | - lumigo-orb/is_environment_available
49 |
50 | - lumigo-orb/integration-test-parallel:
51 | context: common
52 | run_test_cleanup: false
53 | requires:
54 | - lumigo-orb/be-deploy
55 | - lumigo-orb/prep-it-resources
56 | - lumigo-orb/prep-k8s-and-operator
57 |
58 | - lumigo-orb/e2e-test:
59 | context: common
60 | requires:
61 | - lumigo-orb/be-deploy
62 | - lumigo-orb/prep-it-resources
63 | - lumigo-orb/prep-k8s-and-operator
64 |
65 | - lumigo-orb/integration-test-cleanup:
66 | name: post-test-cleanup
67 | context: common
68 | requires:
69 | - lumigo-orb/integration-test-parallel
70 | - lumigo-orb/e2e-test
71 |
72 | - lumigo-orb/workflow-completed-successfully:
73 | context: common
74 | requires:
75 | - lumigo-orb/integration-test-parallel
76 | - test
77 | - lumigo-orb/e2e-test
78 |
79 | - deploy:
80 | context:
81 | - common
82 | - java
83 | filters:
84 | branches:
85 | only: master
86 |
87 | jobs:
88 | test:
89 | <<: *defaults
90 | steps:
91 | - lumigo-orb/checkout_utils
92 | - lumigo-orb/checkout_code
93 | - run: ./scripts/checks.sh
94 | - run: ../utils/common_bash/defaults/code_cov.sh
95 |
96 | deploy:
97 | <<: *defaults
98 | steps:
99 | - lumigo-orb/checkout_utils
100 | - lumigo-orb/checkout_code
101 | - run: mvn clean install
102 | - run: ../utils/common_bash/defaults/code_cov.sh
103 | - run: cd .. && git clone git@github.com:lumigo-io/larn.git
104 | - run: ./scripts/bd_to_prod.sh
105 |
--------------------------------------------------------------------------------
/.github/workflows/send-pr-details-on-close.yml:
--------------------------------------------------------------------------------
1 | name: Send PR close event to the environment manager
2 |
3 | on:
4 | pull_request:
5 | types: [closed]
6 |
7 | jobs:
8 | send-pr-close-event-to-env-manager:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Send PR Close Event To Env Manager
12 | run: |
13 | full_repository_name="${{github.repository}}"
14 | # the repository name is everything after the slash "lumigo-io/" in the full repository name
15 | repository_name="${full_repository_name#lumigo-io/}"
16 |
17 | source_branch_name="${{github.head_ref}}"
18 |
19 | is_merged="${{github.event.pull_request.merged}}"
20 | if [ "$is_merged" = "true" ]; then
21 | event="PR_MERGED"
22 | else
23 | event="PR_CLOSED"
24 | fi
25 |
26 | request_type="POST"
27 | route="v1/github_actions_trigger"
28 |
29 | body="{"
30 | body+=" \"event\": \"${event}\""
31 | body+=" , \"repository_name\": \"${repository_name}\""
32 | body+=" , \"source_branch_name\": \"${source_branch_name}\""
33 | body+="}"
34 |
35 | params=(\
36 | -s \
37 | --header "x-api-key: ${{secrets.ENV_MANAGER_API_KEY}}" \
38 | --header "Content-Type: application/json" \
39 | --compressed \
40 | --request "$request_type" \
41 | --data "$body")
42 |
43 | # ENV_MANAGER_API_ROOT="https://XXXX.execute-api.us-west-2.amazonaws.com/prod/env-manager/v1"
44 | params+=("${{secrets.ENV_MANAGER_API_ROOT}}/${route}")
45 | curl "${params[@]}" | tr -d '\r'
46 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | share/python-wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 | MANIFEST
28 |
29 | # PyInstaller
30 | # Usually these files are written by a python script from a template
31 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
32 | *.manifest
33 | *.spec
34 |
35 | # Installer logs
36 | pip-log.txt
37 | pip-delete-this-directory.txt
38 |
39 | # Unit test / coverage reports
40 | htmlcov/
41 | .tox/
42 | .nox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | .hypothesis/
50 | .pytest_cache/
51 |
52 | # Translations
53 | *.mo
54 | *.pot
55 |
56 | # Django stuff:
57 | *.log
58 | local_settings.py
59 | db.sqlite3
60 |
61 | # Flask stuff:
62 | instance/
63 | .webassets-cache
64 |
65 | # Scrapy stuff:
66 | .scrapy
67 |
68 | # Sphinx documentation
69 | docs/_build/
70 |
71 | # PyBuilder
72 | target/
73 |
74 | # Jupyter Notebook
75 | .ipynb_checkpoints
76 |
77 | # IPython
78 | profile_default/
79 | ipython_config.py
80 |
81 | # pyenv
82 | .python-version
83 |
84 | # celery beat schedule file
85 | celerybeat-schedule
86 |
87 | # SageMath parsed files
88 | *.sage.py
89 |
90 | # Environments
91 | .env
92 | .venv
93 | env/
94 | venv/
95 | ENV/
96 | env.bak/
97 | venv.bak/
98 |
99 | # Spyder project settings
100 | .spyderproject
101 | .spyproject
102 |
103 | # Rope project settings
104 | .ropeproject
105 |
106 | # mkdocs documentation
107 | /site
108 |
109 | # mypy
110 | .mypy_cache/
111 | .dmypy.json
112 | dmypy.json
113 |
114 | # Pyre type checker
115 | .pyre/
116 |
117 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
118 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
119 |
120 | # User-specific stuff
121 | .idea/**/workspace.xml
122 | .idea/**/tasks.xml
123 | .idea/**/usage.statistics.xml
124 | .idea/**/dictionaries
125 | .idea/**/shelf
126 |
127 | # Generated files
128 | .idea/**/contentModel.xml
129 |
130 | # Sensitive or high-churn files
131 | .idea/**/dataSources/
132 | .idea/**/dataSources.ids
133 | .idea/**/dataSources.local.xml
134 | .idea/**/sqlDataSources.xml
135 | .idea/**/dynamic.xml
136 | .idea/**/uiDesigner.xml
137 | .idea/**/dbnavigator.xml
138 |
139 | # Gradle
140 | .idea/**/gradle.xml
141 | .idea/**/libraries
142 |
143 | # Gradle and Maven with auto-import
144 | # When using Gradle or Maven with auto-import, you should exclude module files,
145 | # since they will be recreated, and may cause churn. Uncomment if using
146 | # auto-import.
147 | .idea/
148 | *.iml
149 |
150 | # CMake
151 | cmake-build-*/
152 |
153 | # Mongo Explorer plugin
154 | .idea/**/mongoSettings.xml
155 |
156 | # File-based project format
157 | *.iws
158 |
159 | # IntelliJ
160 | out/
161 |
162 | # mpeltonen/sbt-idea plugin
163 | .idea_modules/
164 |
165 | # JIRA plugin
166 | atlassian-ide-plugin.xml
167 |
168 | # Cursive Clojure plugin
169 | .idea/replstate.xml
170 |
171 | # Crashlytics plugin (for Android Studio and IntelliJ)
172 | com_crashlytics_export_strings.xml
173 | crashlytics.properties
174 | crashlytics-build.properties
175 | fabric.properties
176 |
177 | # Editor-based Rest Client
178 | .idea/httpRequests
179 |
180 | # Android studio 3.1+ serialized cache file
181 | .idea/caches/build_file_checksums.ser
182 |
183 | # Logs
184 | logs
185 | *.log
186 | npm-debug.log
187 |
188 | # Runtime data
189 | pids
190 | *.pid
191 | *.seed
192 | dist
193 |
194 | # Directory for instrumented libs generated by jscoverage/JSCover
195 | lib-cov
196 |
197 | # Coverage directory used by tools like istanbul
198 | coverage
199 |
200 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
201 | .grunt
202 |
203 | # node-waf configuration
204 | .lock-wscript
205 |
206 | # Compiled binary addons (http://nodejs.org/api/addons.html)
207 | build/Release
208 |
209 | # Dependency directory
210 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
211 | node_modules
212 |
213 | #OS STUFF
214 | .DS_Store
215 | .tmp
216 |
217 | #SERVERLESS STUFF
218 | admin.env
219 | .env
220 | _meta
221 | .serverless
222 | package-lock.json
223 | src/main/resources/lumigo-agent.jar
224 | .vscode/
225 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java Tracer
2 |
3 | [](https://dl.circleci.com/status-badge/redirect/gh/lumigo-io/java-tracer/tree/master)
4 | 
5 | [](https://codecov.io/gh/lumigo-io/java-tracer)
6 |
7 | Supported Runtimes: Java 8, Java 11, Java 17, Java 21
8 |
9 | ## Building With Lumigo
10 | Include lumigo java tracer dependency
11 |
12 | ### Maven
13 | For [Maven](https://maven.apache.org) projects, use:
14 |
15 | ```xml
16 |
17 |
18 | lumigo
19 | https://raw.githubusercontent.com/lumigo-io/java-tracer/master/local-repository/
20 |
21 |
22 | ```
23 |
24 | ```xml
25 |
26 | io.lumigo
27 | java-tracer
28 | 1.0.49
29 |
30 |
31 |
32 | io.lumigo
33 | lumigo-agent
34 | 1.0.49
35 |
36 | ```
37 |
38 | ### Gradle
39 | For [Gradle](https://gradle.org) projects, use:
40 |
41 | ```groovy
42 | repositories {
43 | maven {
44 | url 'https://raw.githubusercontent.com/lumigo-io/java-tracer/master/local-repository/'
45 | }
46 | }
47 | ```
48 |
49 | ```groovy
50 | dependencies {
51 | implementation 'io.lumigo:java-tracer:1.0.49'
52 | implementation 'io.lumigo:lumigo-agent:1.0.49'
53 | }
54 | ```
55 |
56 | Find the latest version here (the format of the version will be n.n.n):
57 |
58 | ## Wrapping your Lambda
59 |
60 | * Wrap your lambda function by implementing a supplier which contains your code
61 |
62 | ```java
63 | class MyFunction implements RequestHandler {
64 |
65 | @Override
66 | public OUTPUT handleRequest(INPUT event, Context context) {
67 | Supplier