feat(appsync): add EnhancedMetricsConfigProperty for GraphQL api#35328
feat(appsync): add EnhancedMetricsConfigProperty for GraphQL api#35328mergify[bot] merged 58 commits intoaws:mainfrom
Conversation
6566b24 to
d62f669
Compare
mazyu36
left a comment
There was a problem hiding this comment.
Thank you for the contribution.
Before reviewing the details, let me confirm.
Don’t we need to add the metricConfig property to Resolver and DataSource?
If the API’s config is set to per-resolver metrics, I think the resolver’s config is also needed.
|
There’s an existing issue, please associate it. |
badmintoncryer
left a comment
There was a problem hiding this comment.
Thank you for you contribution! I've added some minor comments.
| }); | ||
|
|
||
| api.addNoneDataSource('NoneDS', { | ||
| name: cdk.Lazy.string({ produce(): string { return 'NoneDS'; } }), |
There was a problem hiding this comment.
Why is it necessary to use Lazy here?
There was a problem hiding this comment.
@badmintoncryer
Thanks.
Thinking it over again, I found I didn't need to use Lazy.
| new appsync.GraphqlApi(stack, 'minimal-enhanced-metrics', { | ||
| name: 'enhanced-metrics', | ||
| schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'appsync.test.graphql')), | ||
| enhancedMetricsConfig: {}, |
There was a problem hiding this comment.
Do other constructs also have arguments where we can pass {} like this?
Personally, I feel that having settings activated as a result of passing {} is not very intuitive.
There was a problem hiding this comment.
I found that the appsync.GraphqlApi.logConfig property was passing {}, but I think also passing {} is not very intuitive.
Suggest requiring the dataSourceLevelMetricsBehavior and resolverLevelMetricsBehavior property, because after setting those property the behavior changes.
ex)
EnhancedMetricsConfig {
readonly dataSourceLevelMetricsBehavior: DataSourceLevelMetricsBehavior;
readonly operationLevelMetricsEnabled?: boolean;
readonly resolverLevelMetricsBehavior: ResolverLevelMetricsBehavior;
}There was a problem hiding this comment.
Some of the existing arguments can also accept empty objects! In that case, I don’t think it’s a big issue, so please feel free to implement it in whichever way you prefer!
There was a problem hiding this comment.
@badmintoncryer
Implemented dataSourceLevelMetricsBehavior and resolverLevelMetricsBehavior as required properties.
@mazyu36 |
a2a41a7 to
d8b65ca
Compare
d8b65ca to
af5940a
Compare
…s for data source and resolver
af5940a to
4b19182
Compare
02248fb to
3f4abf1
Compare
Merge Queue StatusRule:
This pull request spent 2 hours 39 minutes 49 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
|
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). |
Merge Queue StatusRule:
This pull request spent 5 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
Merge Queue StatusRule:
This pull request spent 5 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
|
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). |
Merge Queue StatusRule:
This pull request spent 30 minutes 47 seconds in the queue, including 30 minutes 37 seconds running CI. Required conditions to merge
|
|
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). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #29933 .
Reason for this change
A property in L1 construct was not in L2 construct.
Description of changes
Add
enhancedMetricsConfigproperty toGraphqlApiPropsand set in theCfnGraphQLApiconstructor.enhanced Metrics Confignow includes theoperationLevelMetricsEnabledproperty, which has changed from an enum of "ENABLED" and "DISABLED" to a boolean.EnhancedMetricsConfigare not flattened because they interact with each other.For example, if
operationLevelMetricsConfigis enabled,dataSourceLevelMetricsBehaviorwill default toPER_DATA_SOURCE_METRICS.Describe any new or updated permissions being added
Description of how you validated changes
Added both unit and integration tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license