-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add metrics and additional logging for Data Sources #5404
base: main
Are you sure you want to change the base?
Conversation
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.
Two minor comments, but I'm okay submitting this as-is.
dataSourceLatencyHistogram, err = meter.Int64Histogram( | ||
"datasource.rest.latency", | ||
metric.WithDescription("Latency of data source requests in milliseconds"), |
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.
Record the unit with the metric:
dataSourceLatencyHistogram, err = meter.Int64Histogram( | |
"datasource.rest.latency", | |
metric.WithDescription("Latency of data source requests in milliseconds"), | |
dataSourceLatencyHistogram, err = meter.Int64Histogram( | |
"datasource.rest.latency", | |
metric.WithDescription("Latency of data source requests in milliseconds"), | |
metric.WithUnit("ms"), |
dataSourceRequestCounter, err = meter.Int64Counter( | ||
"datasource.rest.request", | ||
metric.WithDescription("Total number of data source requests issued"), | ||
) |
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.
If we're keeping a histogram, we don't need a separate counter -- the top bin of the histogram will give us the total counts.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes mindersec/minder-rules-and-profiles#304
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: