-
Notifications
You must be signed in to change notification settings - Fork 215
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
ENH: metrics in secret extension #3922
ENH: metrics in secret extension #3922
Conversation
Signed-off-by: George Chen <[email protected]>
Signed-off-by: George Chen <[email protected]>
@@ -33,6 +35,7 @@ public AwsSecretPlugin(final AwsSecretPluginConfig awsSecretPluginConfig) { | |||
this.pluginConfigPublisher = new AwsSecretsPluginConfigPublisher(); | |||
pluginConfigValueTranslator = new AwsSecretsPluginConfigValueTranslator(secretsSupplier); | |||
scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); | |||
pluginMetrics = PluginMetrics.fromNames("secrets", "aws"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to think that this should be fromNames("aws", "secrets")
I'm not sure that we will even have other secrets, so this seems to create an unnecessary extra layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to be consistent with
Line 68 in e6df3eb
final PluginMetrics awsSdkMetrics = PluginMetrics.fromNames("sdk", "aws"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation indicates that we go from a componentId to a componentScope.
data-prepper/data-prepper-api/src/main/java/org/opensearch/dataprepper/metrics/PluginMetrics.java
Lines 36 to 37 in 1af1ce9
* @param componentId It can be either pluginId or Data Prepper core component id | |
* @param componentScope It can be pipeline name or Data Prepper core component |
I think the component in this case is the aws-plugin. So I would be in favor of using aws
as the componentId.
@asifsmohammed , Any thoughts from you end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what George has in the PR is right order. We do <componentScope> + "." + <componentId>
try { | ||
secretsSupplier.refresh(secretConfigId); | ||
secretsRefreshSuccessCounter.increment(); | ||
pluginConfigPublisher.notifyAllPluginConfigObservable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I am not sure how long this operations is going to take, can it increase the timer metric which tracks refresh duration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I include it in the timer to track the total time. But this operation should all be in-memory and I expect it to be much less time consuming compared to get secret call
Description
This PR adds metrics on AWS secrets extension plugin
Issues Resolved
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.