Skip to content
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

Merged
merged 1 commit into from Jul 27, 2021
Merged

k8sclusterreceiver: Support OpenShift cluster quota metrics #4342

merged 1 commit into from Jul 27, 2021

Conversation

owais
Copy link
Contributor

@owais owais commented Jul 26, 2021

Description:
Adds support for OpenShift's cluster resource quota by recording quota spec and usage as metrics.

Testing:

  • Manually testing with a local OpenShift cluster with CodeReady Containers
  • Added tests to the receiver and internal utils.

Documentation:
Updated README with receiver config and cluster role examples.

@@ -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}}),
Copy link
Contributor Author

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.

@owais owais marked this pull request as ready for review July 26, 2021 13:43

```yaml
k8s_cluster:
openshift: true
Copy link
Contributor

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.

Copy link
Contributor Author

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{
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,11 @@
{
Copy link
Contributor

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.

Copy link
Contributor Author

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:
Copy link
Contributor

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.
@bogdandrutu bogdandrutu merged commit 42952ab into open-telemetry:main Jul 27, 2021
mstumpfx pushed a commit to mstumpfx/opentelemetry-collector-contrib that referenced this pull request Aug 31, 2021
This commit adds support for OpenShift Cluster Resource Quota metrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants