diff --git a/pkg/customresourcestate/custom_resource_metrics_test.go b/pkg/customresourcestate/custom_resource_metrics_test.go index fa31029922..8fbdbca4f3 100644 --- a/pkg/customresourcestate/custom_resource_metrics_test.go +++ b/pkg/customresourcestate/custom_resource_metrics_test.go @@ -83,7 +83,7 @@ func TestNewCustomResourceMetrics(t *testing.T) { Families: []compiledFamily{ { Name: "kube_customresource_test_metrics", - Help: "metrics for testing", + Help: "metrics for testing for apps/v1/Deployment", Each: &compiledInfo{}, Labels: map[string]string{ "customresource_group": "apps", @@ -146,7 +146,7 @@ func TestNewCustomResourceMetrics(t *testing.T) { Families: []compiledFamily{ { Name: "apps_deployment_test_metrics", - Help: "metrics for testing", + Help: "metrics for testing for apps/v1/Deployment", Each: &compiledInfo{}, Labels: map[string]string{ "customresource_group": "apps", @@ -208,7 +208,7 @@ func TestNewCustomResourceMetrics(t *testing.T) { Families: []compiledFamily{ { Name: "apps_deployment_test_metrics", - Help: "metrics for testing", + Help: "metrics for testing for apps/v1/Deployment", Each: &compiledInfo{}, Labels: map[string]string{ "customresource_group": "apps", diff --git a/pkg/customresourcestate/registry_factory.go b/pkg/customresourcestate/registry_factory.go index 5d2f22b068..c777f0853a 100644 --- a/pkg/customresourcestate/registry_factory.go +++ b/pkg/customresourcestate/registry_factory.go @@ -90,10 +90,13 @@ func compileFamily(f Generator, resource Resource) (*compiledFamily, error) { if errorLogV == 0 { errorLogV = resource.ErrorLogV } + + help := fmt.Sprintf("%s for %s", f.Help, resource.GroupVersionKind) + return &compiledFamily{ Name: fullName(resource, f), ErrorLogV: errorLogV, - Help: f.Help, + Help: help, Each: metric, Labels: labels.CommonLabels, LabelFromPath: labelsFromPath,