-
Notifications
You must be signed in to change notification settings - Fork 165
LOG-4812: Refactor metrics templates and helper functions #2244
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
Conversation
@jcantrill: This pull request references LOG-4812 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.8.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcantrill The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
op[framework.MinTLSVersion] = outMinTlsVersion | ||
op[framework.Ciphers] = outCiphers | ||
} | ||
} |
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.
How 'bout
func SetTLSProfileOptions(o logging.OutputSpec, op framework.Options) {
op[framework.MinTLSVersion], op[framework.Ciphers] = func()(string, string) {
if o.Name == logging.OutputNameDefault && o.Type == logging.OutputTypeElasticsearch {
return "", ""
} else {
return op.TLSProfileInfo(o, ",")
}
}()
}
) | ||
|
||
var ( | ||
SinkTransformThrottle = "sink_throttle" |
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.
Not used outside of package
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.
Updated code to remove vars
return NewThrottleForSink(id, spec, inputs) | ||
} | ||
|
||
func NewThrottleForSink(id string, spec *logging.OutputSpec, inputs []string) []framework.Element { |
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.
Not used outside of package either
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.
Moved to 'normalize' and made more generic
PrometheusExporterListenPort = `24231` | ||
AddNodenameToMetricTransformName = "add_nodename_to_metric" | ||
InternalMetricsSourceName = "internal_metrics" | ||
PrometheusOutputSinkName = "prometheus_output" |
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 Prometheus* consts should've gone to the metrics package it seems
/retest |
/lgtm |
|
||
UserDefinedInput = fmt.Sprintf("%s.%%s", RouteApplicationLogs) | ||
UserDefinedSourceThrottle = fmt.Sprintf("%s_%%s", SourceTransformThrottle) | ||
UserDefinedSourceThrottle = `source_throttle_%s` |
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.
UserDefinedSourceThrottle and perContainerLimitKeyField look like consts
{{end}}` | ||
} | ||
|
||
type AddNodenameToMetric struct { |
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.
AddNodeNameToMetric is only used in one place, together with the PrometheusOutput, may be we could just inline it into func (p PrometheusExporter) Template() string {
and remove all the AddNodenameToMetric code?
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.
And even merge internal_metrics
into that same template ^^^?
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.
sounds like a future refactoring
/test functional-target |
/test functional |
@jcantrill: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Description
This PR:
Links
cc @syedriko @cahartma