Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apprunner): add ObservabilityConfiguration for AppRunner Service #30359

Merged
merged 25 commits into from
Jun 24, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented May 28, 2024

Issue # (if applicable)

Closes #22985 .

Reason for this change

At the moment, L2 Construct does not support a tracing setting for the AppRunner Service.

Description of changes

  • Add ObservabilityConfiguration Class
  • Add observabilityConfiguration property to the Service Class

Description of how you validated changes

Add unit tests and integ tests.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added admired-contributor [Pilot] contributed between 13-24 PRs to the CDK feature-request A feature should be added or improved. p2 labels May 28, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team May 28, 2024 10:09
@mazyu36 mazyu36 force-pushed the apprunner-observability-22985 branch from 4dbae36 to a4e11b4 Compare May 28, 2024 10:40
@mazyu36 mazyu36 force-pushed the apprunner-observability-22985 branch from c4002bf to e73b10d Compare May 28, 2024 23:53
@mazyu36 mazyu36 marked this pull request as ready for review May 30, 2024 11:24
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 30, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍
Left some comments for some minor adjustments and an open question on the vendor property.

@@ -1,3 +1,4 @@
// AWS::AppRunner CloudFormation Resources:
export * from './service';
export * from './vpc-connector';
export * from './observability-configuration';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please order this alphabetically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I fixed it.

packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-apprunner-alpha/README.md Outdated Show resolved Hide resolved
/**
* The implementation provider chosen for tracing App Runner services.
*
* @default Vendor.AWSXRAY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @default Vendor.AWSXRAY
* @default - tracing is not enabled for the service

From the CloudFormation documentation, it seems we're allowed to omit this value.
Can you please verify if the construct deploys when that is the case?
Ie, changing the implementation to:

    const resource = new CfnObservabilityConfiguration(this, 'Resource', {
      observabilityConfigurationName: props.observabilityConfigurationName,
      traceConfiguration: props.vendor ? {
        vendor: props.vendor,
      } : undefined,
    });

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
I fixed it, and I tried to deploy it.
An Observability Configuration without TraceConfiguration could be deployed.

% aws apprunner describe-observability-configuration --observability-configuration-arn arn:aws:apprunner:us-east-1: 01234567890:observabilityconfiguration/my-observability-no-vendor/1/2bc8fefaddcc4b878c0dfe2598412555 --region us-east-1
{
    "ObservabilityConfiguration": {
        "ObservabilityConfigurationArn": "arn:aws:apprunner:us-east-1:01234567890:observabilityconfiguration/my-observability-no-vendor/1/2bc8fefaddcc4b878c0dfe2598412555",
        "ObservabilityConfigurationName": "my-observability-no-vendor",
        "ObservabilityConfigurationRevision": 1,
        "Latest": false,
        "Status": "ACTIVE",
        "CreatedAt": "2024-06-02T09:46:36.997000+09:00"
    }
}

But the App Runner Service with it could not be deployed. It threw an error.
スクリーンショット 2024-06-02 10 11 59

So, I added the above information to the documentation for the vendor property.

packages/@aws-cdk/aws-apprunner-alpha/test/service.test.ts Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 1, 2024
@mazyu36 mazyu36 force-pushed the apprunner-observability-22985 branch from 967bb81 to 8d7c747 Compare June 2, 2024 02:00
@mazyu36 mazyu36 force-pushed the apprunner-observability-22985 branch from 8d7c747 to b93cd9b Compare June 2, 2024 02:28
@@ -143,15 +145,25 @@ export class ObservabilityConfiguration extends cdk.Resource implements IObserva
physicalName: props.observabilityConfigurationName,
});

if (props.observabilityConfigurationName !== undefined) {
Copy link
Contributor Author

@mazyu36 mazyu36 Jun 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a validation for observabilityConfigurationName and unit tests.

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 2, 2024

@lpizzinidev
Thank you for the review!
I've addressed all your comments.

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍 Left comments for some final adjustments

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 3, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

GavinZZ
GavinZZ previously approved these changes Jun 20, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing!

Copy link
Contributor

mergify bot commented Jun 20, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 20, 2024
@GavinZZ
Copy link
Contributor

GavinZZ commented Jun 21, 2024

@mazyu36 Can you fix the failed unit test please when available?

@mergify mergify bot dismissed GavinZZ’s stale review June 21, 2024 01:25

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 21, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 21, 2024

@GavinZZ
Thanks.
I've updated to resolve conflicts by #30358.

Could you please review and approve again?

@mazyu36 mazyu36 requested a review from GavinZZ June 21, 2024 03:25
Copy link
Contributor

mergify bot commented Jun 24, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 24, 2024
Copy link
Contributor

mergify bot commented Jun 24, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: c850eb3
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 9e9cc27 into aws:main Jun 24, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Jun 24, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mazyu36 mazyu36 deleted the apprunner-observability-22985 branch June 25, 2024 00:44
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(apprunner): (apprunner observability configuration support)
4 participants