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: add metrics for provider #407

Merged
merged 1 commit into from Sep 9, 2021
Merged

feat: add metrics for provider #407

merged 1 commit into from Sep 9, 2021

Conversation

aramase
Copy link
Member

@aramase aramase commented Feb 17, 2021

Signed-off-by: Anish Ramasekar anish.ramasekar@gmail.com

Reason for Change:

  • Adds metrics framework with otel

Requirements

  • squashed commits
  • included documentation
  • added unit tests and e2e tests (if applicable).

Issue Fixed:

fixes #400

Does this change contain code from or inspired by another project?

  • Yes
  • No

If "Yes," did you notify that project's maintainers and provide attribution?

Special Notes for Reviewers:

@aramase aramase added this to the 0.0.15 milestone Apr 12, 2021
@aramase aramase removed this from the 0.0.15 milestone May 10, 2021
@aramase aramase added this to the v0.1.0 milestone Jun 7, 2021
@aramase aramase modified the milestones: v0.1.0, Stable Jun 30, 2021
@github-actions
Copy link

This PR is stale because it has been open 14 days with no activity. Please comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 31, 2021
@aramase aramase removed the stale label Aug 2, 2021
@github-actions
Copy link

This PR is stale because it has been open 14 days with no activity. Please comment or this will be closed in 7 days.

@github-actions
Copy link

github-actions bot commented Sep 4, 2021

This PR is stale because it has been open 14 days with no activity. Please comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 4, 2021
@aramase aramase removed the stale label Sep 4, 2021
@aramase aramase force-pushed the metrics branch 5 times, most recently from 26c35ea to 0c2f195 Compare September 7, 2021 16:45
@aramase aramase marked this pull request as ready for review September 7, 2021 16:56
@aramase aramase force-pushed the metrics branch 2 times, most recently from 0cecca0 to e28e704 Compare September 7, 2021 18:07
@aramase
Copy link
Member Author

aramase commented Sep 7, 2021

/azp run pr-e2e-azure

@aramase aramase requested a review from nilekhc September 7, 2021 18:17
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

pkg/metrics/exporter.go Outdated Show resolved Hide resolved
pkg/metrics/prometheus_exporter.go Outdated Show resolved Hide resolved
pkg/metrics/prometheus_exporter.go Outdated Show resolved Hide resolved
pkg/provider/provider.go Outdated Show resolved Hide resolved
pkg/provider/stats_reporter.go Outdated Show resolved Hide resolved
cmd/main.go Outdated
@@ -106,9 +112,10 @@ func main() {
grpc.UnaryInterceptor(utils.LogGRPC),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add metrics for grpc as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added metrics for gRPC too. The gRPC request has a different set of attributes compared to the keyvault metric, so I've kept that as a separate metric. The keyvault metric is what will be useful for users to monitor the plugin is functioning correctly.

resp, err := handler(ctx, req)
s, _ := status.FromError(err)
klog.V(5).InfoS("response", "method", info.FullMethod, "duration", time.Since(start).String(), "code", s.Code().String(), "message", s.Message())
reporter.ReportGRPCRequest(ctx, time.Since(start).Seconds(), info.FullMethod, s.Code().String(), s.Message())
Copy link
Member Author

Choose a reason for hiding this comment

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

Using the full method for metric to track the proto version for the RPC call

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

chore: update to latest version of otel

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
@aramase aramase merged commit c1baa7a into Azure:master Sep 9, 2021
Secret Store CSI Azure Provider Roadmap automation moved this from In progress to Done Sep 9, 2021
@aramase aramase deleted the metrics branch September 9, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add metrics for provider requests
2 participants