Commit cb31105
authored
feat: Add auto-instrumentation support for Step Functions, SNS, Secre… (#899)
### *Description of changes:*
Changes in ADOT package to support new AWS resources in Java V1 & V2
SDKs.
Related changes for V1 SDK in upstream package:
mxiamxia/opentelemetry-java-instrumentation#11
Related changes for V2 SDK in upstream package:
mxiamxia/opentelemetry-java-instrumentation#12
These changes add auto-instrumentation support for the following AWS
resources. Additionally, a new attribute for
`aws.remote.resource.cfn.primary.identifier` is also added for each new
resource.
- Populate `aws.sns.topic.arn` in Span by extracting `TopicArn` from the
request body.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html
- The CFN Id should be the ARN of the Topic.
- Populate `aws.secretsmanager.secret.arn` in Span by extracting `ARN`
from response body.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secret.html
- The CFN Id should be the ARN of the Secret.
- Populate `aws.stepfunctions.state_machine.arn` in Span by extracting
`stateMachineArn` from the request body.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html
- The CFN Id should be the ARN of the State Machine.
- Populate `aws.stepfunctions.activity.arn` in Span by extracting
`activityArn` from the request body.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-activity.html
- The CFN Id should be the ARN of the Activity.
- Populate `aws.lambda.function.name` in Span by extracting
`FunctionName` from the request body.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html
- The CFN Id should be the ARN of the Lambda Function.
- Populate `aws.lambda.resource_mapping.id` in Span by extracting `UUID`
from the request body.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html
- The CFN Id should be the UUID of the Event Source Mapping.
### *Test Plan:*
Set up a client-server with auto-instrumentation to verify that the
correct span data is being generated.
Note: V1 span data is top pic and V2 span data is bottom pic for each
resource.
`aws.lambda.function.name`
<img width="1512" alt="lambda-function-name-span-data-verification-v1"
src="https://github.com/user-attachments/assets/ecc6780e-546b-4776-a916-16cac97863ec">
<img width="1512" alt="lambda-function-name-span-data-verification-v2"
src="https://github.com/user-attachments/assets/eb4d288d-dbb4-4dd1-9562-abea8ec91937">
`aws.lambda.resource_mapping.id`
<img width="1512"
alt="lambda-resource-mapping-id-span-data-verification-v1"
src="https://github.com/user-attachments/assets/5059000a-ef5a-4eec-a0d8-e2e63c144ff3">
<img width="1512"
alt="lambda-resource-mapping-id-span-data-verification-v2"
src="https://github.com/user-attachments/assets/54fea71d-05bc-40ac-98b8-5e4d49b0d391">
`aws.secretsmanager.secret.arn`
<img width="1512"
alt="secretsmanager-secret-arn-span-data-verification-v1"
src="https://github.com/user-attachments/assets/e0cf9fcb-1d99-4ed9-bf33-f9e04c4ad352">
<img width="1512"
alt="secretsmanager-secret-arn-span-data-verification-v2"
src="https://github.com/user-attachments/assets/2db81495-d8a7-43cf-a616-4cbe6bd3d3f8">
`aws.sns.topic.arn`
<img width="1512" alt="sns-topic-arn-span-data-verification-v1"
src="https://github.com/user-attachments/assets/cc000f1f-ded7-4d02-98e6-545583f47e5e">
<img width="1512" alt="sns-topic-arn-span-data-verification-v2"
src="https://github.com/user-attachments/assets/666fcfd2-045a-4a0a-a5c2-662bcaa60e41">
`aws.stepfunctions.activity.arn`
<img width="1512"
alt="stepfunctions-activity-arn-span-data-verification-v1"
src="https://github.com/user-attachments/assets/e3ade244-eb1e-4f5c-9878-5c78ee4f2a32">
<img width="1512" alt="sfn-activity-arn-span-data-verification-v2"
src="https://github.com/user-attachments/assets/89814a71-bbac-4026-b4e1-591f767e3a13">
`aws.stepfunction.state_machine.arn`
<img width="1512"
alt="stepfunctions-state-machine-arn-span-data-verification-v1"
src="https://github.com/user-attachments/assets/91670d86-a726-472a-8f0f-b156cd68ef63">
<img width="1512" alt="sfn-state-machine-arn-span-data-verification-v2"
src="https://github.com/user-attachments/assets/70f59b80-af4c-400d-84e5-35fd06eef20e">
Metric Attribute Generator Unit Test
<img width="1512" alt="Screenshot 2024-10-02 at 2 59 35 PM"
src="https://github.com/user-attachments/assets/fadf5ec5-dba3-46a4-abdd-d8cd9ab56cc5">
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.1 parent 47ce3b1 commit cb31105
File tree
4 files changed
+163
-0
lines changed- awsagentprovider
- src
- main/java/software/amazon/opentelemetry/javaagent/providers
- test/java/software/amazon/opentelemetry/javaagent/providers
4 files changed
+163
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
53 | 76 | | |
54 | 77 | | |
55 | 78 | | |
| |||
Lines changed: 95 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| |||
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
114 | 126 | | |
115 | 127 | | |
116 | 128 | | |
| |||
371 | 383 | | |
372 | 384 | | |
373 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
374 | 398 | | |
375 | 399 | | |
376 | 400 | | |
| |||
392 | 416 | | |
393 | 417 | | |
394 | 418 | | |
| 419 | + | |
395 | 420 | | |
396 | 421 | | |
397 | 422 | | |
| |||
434 | 459 | | |
435 | 460 | | |
436 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
437 | 502 | | |
438 | 503 | | |
439 | 504 | | |
440 | 505 | | |
441 | 506 | | |
442 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
443 | 512 | | |
444 | 513 | | |
445 | 514 | | |
| 515 | + | |
446 | 516 | | |
447 | 517 | | |
448 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
449 | 544 | | |
450 | 545 | | |
451 | 546 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
770 | 776 | | |
771 | 777 | | |
772 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
773 | 815 | | |
774 | 816 | | |
775 | 817 | | |
| |||
1175 | 1217 | | |
1176 | 1218 | | |
1177 | 1219 | | |
| 1220 | + | |
1178 | 1221 | | |
1179 | 1222 | | |
1180 | 1223 | | |
| |||
0 commit comments