-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
k8sclusterreceiver: Support OpenShift cluster quota metrics #4342
k8sclusterreceiver: Support OpenShift cluster quota metrics #4342
Conversation
@@ -72,7 +72,7 @@ func getMetricsForResourceQuota(rq *corev1.ResourceQuota) []*resourceMetrics { | |||
&metricspb.Metric{ | |||
MetricDescriptor: t.metric, | |||
Timeseries: []*metricspb.TimeSeries{ | |||
utils.GetInt64TimeSeriesWithLabels(val, []*metricspb.LabelValue{{Value: string(k)}}), | |||
utils.GetInt64TimeSeriesWithLabels(val, []*metricspb.LabelValue{{Value: string(k), HasValue: true}}), |
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.
oppurtunistic bug fix. labels were not actually recorded for this timeseries.
|
||
```yaml | ||
k8s_cluster: | ||
openshift: true |
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.
What about maybe making the distribution configurable?
k8s_cluster:
distribution: openshift
There might be other features added for other distros.
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 good.
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/utils" | ||
) | ||
|
||
var clusterResourceQuotaLimitMetric = &metricspb.MetricDescriptor{ |
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.
At the time this receiver was written metadata.yaml and pdata weren't around. Would it be possible to add net-new stuff using the new ways so there's less code that has to be translated in the future?
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.
Happy to have an issue assigned to me and do it in a separate PR.
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.
workspace.code-workspace
Outdated
@@ -0,0 +1,11 @@ | |||
{ |
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.
Don't think you meant to commit this.
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 was sure I removed it after adding to gitignore. Will remove
if err != nil { | ||
return nil, err | ||
} | ||
case distributionKubernetes: |
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 think a comment like // Nothing to initialize
could help to make clear the empty block isn't a typo
This commit adds support for OpenShift Cluster Resource Quota metrics.
Description:
Adds support for OpenShift's cluster resource quota by recording quota spec and usage as metrics.
Testing:
Documentation:
Updated README with receiver config and cluster role examples.