-
Notifications
You must be signed in to change notification settings - Fork 753
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
Enable log config for the metrics agent #1104
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.
++ couple suggestions if you want to address in a future patch.
@@ -121,7 +117,7 @@ func processPercentile(metric *dto.Metric, act *metricsAction) { | |||
act.actionFunc(&act.data.curSingleDataPoint, p99) | |||
} | |||
|
|||
func processHistogram(metric *dto.Metric, act *metricsAction) { | |||
func processHistogram(metric *dto.Metric, act *metricsAction, log logger.Logger) { |
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 fine. might be a bit cleaner, though, to make this function a method on metricsTarget
struct versus adding a log
parameter to all these functions. :)
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 agree, but since metricsTarget
is an interface, it will be a somewhat bigger change. Will check in a follow up PR how that would look like. 😄
) | ||
|
||
type testMetricsTarget struct { | ||
metricFile string | ||
interestingMetrics map[string]metricsConvert | ||
} | ||
|
||
func (target *testMetricsTarget) getLogger() logger.Logger { | ||
return logger.DefaultLogger() | ||
} |
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.
you wouldn't need this interface method if you just made all those functions instead be methods on metricsTarget.
any progress on this pr? |
The cni-metrics-helper should check the same loging config env variables as ipamd does.
1a4334c
to
7ee6081
Compare
@wguto I was out last week, but now I'm back. 🙂 |
Issue #, if available:
#1089
Description of changes:
The cni-metrics-helper should check the same logging config env variable as ipamd does to get the log level. Will still log to stdout after this change.
cni-metrics-helper
will get the LogLevel from env variableAWS_VPC_K8S_CNI_LOGLEVEL
Debug
logFilePath
tostdout
in Zap configBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.