|
29 | 29 | _AWS_KINESIS_STREAM_NAME: str = "aws.kinesis.stream_name" |
30 | 30 | _AWS_SECRETSMANAGER_SECRET_ARN: str = "aws.secretsmanager.secret.arn" |
31 | 31 | _AWS_SNS_TOPIC_ARN: str = "aws.sns.topic.arn" |
| 32 | +_AWS_STEPFUNCTIONS_ACTIVITY_ARN: str = "aws.stepfunctions.activity.arn" |
| 33 | +_AWS_STEPFUNCTIONS_STATE_MACHINE_ARN: str = "aws.stepfunctions.state_machine.arn" |
32 | 34 | _AWS_BEDROCK_GUARDRAIL_ID: str = "aws.bedrock.guardrail.id" |
33 | 35 | _AWS_BEDROCK_AGENT_ID: str = "aws.bedrock.agent.id" |
34 | 36 | _AWS_BEDROCK_KNOWLEDGE_BASE_ID: str = "aws.bedrock.knowledge_base.id" |
@@ -83,10 +85,11 @@ def set_up_dependency_container(cls): |
83 | 85 | ) |
84 | 86 | } |
85 | 87 | cls._local_stack: LocalStackContainer = ( |
86 | | - LocalStackContainer(image="localstack/localstack:3.0.2") |
| 88 | + LocalStackContainer(image="localstack/localstack:4.0.0") |
87 | 89 | .with_name("localstack") |
88 | | - .with_services("s3", "secretsmanager", "sns", "sqs", "dynamodb", "kinesis") |
| 90 | + .with_services("s3", "secretsmanager", "sns", "sqs", "stepfunctions", "dynamodb", "kinesis") |
89 | 91 | .with_env("DEFAULT_REGION", "us-west-2") |
| 92 | + # .with_env("PROVIDER_OVERRIDE_STEPFUNCTIONS", "legacy") |
90 | 93 | .with_kwargs(network=NETWORK_NAME, networking_config=local_stack_networking_config) |
91 | 94 | ) |
92 | 95 | cls._local_stack.start() |
@@ -442,6 +445,101 @@ def test_sns_error(self): |
442 | 445 | # span_name="SNS.CreateTopic" |
443 | 446 | # ) |
444 | 447 |
|
| 448 | + def test_stepfunctions_create_state_machine(self): |
| 449 | + self.do_test_requests( |
| 450 | + "stepfunctions/createstatemachine/some-state-machine", |
| 451 | + "GET", |
| 452 | + 200, |
| 453 | + 0, |
| 454 | + 0, |
| 455 | + rpc_service="SFN", |
| 456 | + remote_service="AWS::StepFunctions", |
| 457 | + remote_operation="CreateStateMachine", |
| 458 | + span_name="SFN.CreateStateMachine", |
| 459 | + ) |
| 460 | + |
| 461 | + def test_stepfunctions_describe_state_machine(self): |
| 462 | + self.do_test_requests( |
| 463 | + "stepfunctions/describestatemachine/some-state-machine", |
| 464 | + "GET", |
| 465 | + 200, |
| 466 | + 0, |
| 467 | + 0, |
| 468 | + rpc_service="SFN", |
| 469 | + remote_service="AWS::StepFunctions", |
| 470 | + remote_operation="DescribeStateMachine", |
| 471 | + remote_resource_type="AWS::StepFunctions::StateMachine", |
| 472 | + remote_resource_identifier="arn:aws:states:us-east-1:000000000000:stateMachine:test-state-machine", |
| 473 | + request_response_specific_attributes={ |
| 474 | + _AWS_STEPFUNCTIONS_STATE_MACHINE_ARN: "arn:aws:states:us-east-1:000000000000:stateMachine:test-state-machine", |
| 475 | + }, |
| 476 | + span_name="SFN.DescribeStateMachine", |
| 477 | + ) |
| 478 | + |
| 479 | + def test_stepfunctions_create_activity(self): |
| 480 | + self.do_test_requests( |
| 481 | + "stepfunctions/createactivity/some-activity", |
| 482 | + "GET", |
| 483 | + 200, |
| 484 | + 0, |
| 485 | + 0, |
| 486 | + rpc_service="SFN", |
| 487 | + remote_service="AWS::StepFunctions", |
| 488 | + remote_operation="CreateActivity", |
| 489 | + span_name="SFN.CreateActivity", |
| 490 | + ) |
| 491 | + |
| 492 | + def test_stepfunctions_describe_activity(self): |
| 493 | + self.do_test_requests( |
| 494 | + "stepfunctions/describeactivity/some-activity", |
| 495 | + "GET", |
| 496 | + 200, |
| 497 | + 0, |
| 498 | + 0, |
| 499 | + rpc_service="SFN", |
| 500 | + remote_service="AWS::StepFunctions", |
| 501 | + remote_operation="DescribeActivity", |
| 502 | + remote_resource_type="AWS::StepFunctions::Activity", |
| 503 | + remote_resource_identifier="arn:aws:states:us-east-1:000000000000:activity:test-activity", |
| 504 | + request_response_specific_attributes={ |
| 505 | + _AWS_STEPFUNCTIONS_ACTIVITY_ARN: "arn:aws:states:us-east-1:000000000000:activity:test-activity", |
| 506 | + }, |
| 507 | + span_name="SFN.DescribeActivity", |
| 508 | + ) |
| 509 | + |
| 510 | + def test_stepfunctions_error(self): |
| 511 | + self.do_test_requests( |
| 512 | + "stepfunctions/error", |
| 513 | + "GET", |
| 514 | + 400, |
| 515 | + 1, |
| 516 | + 0, |
| 517 | + rpc_service="SFN", |
| 518 | + remote_service="AWS::StepFunctions", |
| 519 | + remote_operation="DescribeStateMachine", |
| 520 | + remote_resource_type="AWS::StepFunctions::StateMachine", |
| 521 | + remote_resource_identifier="arn:aws:states:us-east-1:000000000000:stateMachine:error-state-machine", |
| 522 | + request_response_specific_attributes={ |
| 523 | + _AWS_STEPFUNCTIONS_STATE_MACHINE_ARN: "arn:aws:states:us-east-1:000000000000:stateMachine:error-state-machine", |
| 524 | + }, |
| 525 | + span_name="SFN.DescribeStateMachine", |
| 526 | + ) |
| 527 | + |
| 528 | + |
| 529 | + # TODO: https://github.com/aws-observability/aws-otel-dotnet-instrumentation/issues/83 |
| 530 | + # def test_stepfunctions_fault(self): |
| 531 | + # self.do_test_requests( |
| 532 | + # "stepfunctions/fault", |
| 533 | + # "GET", |
| 534 | + # 500, |
| 535 | + # 0, |
| 536 | + # 1, |
| 537 | + # rpc_service="SFN", |
| 538 | + # remote_service="AWS::StepFunctions", |
| 539 | + # remote_operation="CreateStateMachine", |
| 540 | + # span_name="SFN.CreateStateMachine", |
| 541 | + # ) |
| 542 | + |
445 | 543 | def test_bedrock_get_guardrail(self): |
446 | 544 | self.do_test_requests( |
447 | 545 | "bedrock/getguardrail/get-guardrail", |
|
0 commit comments