-
Notifications
You must be signed in to change notification settings - Fork 742
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
Update CNI metrics #413
Update CNI metrics #413
Conversation
c8faee2
to
5fb8995
Compare
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.
Added initial set of comments for the second commit.
@@ -0,0 +1,102 @@ | |||
package main |
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.
Missing license headers
@@ -0,0 +1,153 @@ | |||
// Package metrics handles the processing of all metrics. This file handles metrics for kube-state-metrics |
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.
Add license headers
// CNIMetricsTarget defines data structure for kube-state-metric target | ||
type CNIMetricsTarget struct { | ||
interestingMetrics map[string]metricsConvert | ||
cwClient publisher.Publisher |
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.
nit: s/cwClient/cwMetricsPublisher/
|
||
func (t *CNIMetricsTarget) grabMetricsFromTarget(cniPod string) ([]byte, error) { | ||
|
||
glog.Info("Grabbing metrics from CNI ", cniPod) |
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.
nit: s/Info/Infof
func (t *CNIMetricsTarget) grabMetricsFromTarget(cniPod string) ([]byte, error) { | ||
|
||
glog.Info("Grabbing metrics from CNI ", cniPod) | ||
output, err := getMetricsFromPod(t.kubeClient, cniPod, metav1.NamespaceSystem, 61678) |
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.
Make 61678 a const
@@ -12,78 +12,92 @@ import ( | |||
|
|||
// InterestingCNIMetrics defines metrics parsing definition for kube-state-metrics |
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.
nit: Metrics from cni prometheus endpoint
@@ -1,4 +1,4 @@ | |||
// Package metrics provide common data structure and routines for converting/aggregating prometheus metrics to cloudwatch metrics | |||
// Package metrics provide common data structure and routines for converting/aggregating prometheus metrics to cloudwatch metrics |
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.
nit: Add license headers
@@ -327,7 +318,7 @@ func filterMetrics(originalMetrics map[string]*dto.MetricFamily, | |||
} | |||
|
|||
func produceCloudWatchMetrics(t metricsTarget, families map[string]*dto.MetricFamily, convertDef map[string]metricsConvert, cw publisher.Publisher) { | |||
// TODO the following will be changed to integate with cloudwatch publisher | |||
// TODO: The following will be changed to integrate with CloudWatch publisher |
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.
nit: remove comment
@@ -8,6 +8,7 @@ import ( | |||
"github.com/aws/aws-sdk-go/aws/session" | |||
"github.com/aws/aws-sdk-go/service/ec2" | |||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface" | |||
"github.com/golang/glog" |
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.
Is glog used within this pkg?
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
@@ -1,4 +1,4 @@ | |||
// Package publisher is used to batch and send metric data to cloudwatch | |||
// Package publisher is used to batch and send metric data to CloudWatch |
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.
nit: Add license headers
Cleaned up some comments and the makefile as well.
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.
@mogren Changes LGTM
Please have follow up items to address issues with the original commits!
*Resolves issue #113 and #409 *
Description of changes:
awscni_add_ip_req_count
andawscni_del_ip_req_count
USE_CLOUDWATCH="yes"
the defaultCLUSTER_ID
tag is not set on the node, tryName
before defaulting tok8s-cluster
Examples
To apply against CNI v1.4.0:
Check logs:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.