func oneAttributePerResource(rawResources definition.FetchedValue, r resourceType) (definition.FetchedValue, error) {
	resources, ok := rawResources.(v1.ResourceList)
	if !ok {
		return rawResources, fmt.Errorf("creating resource %s attributes", r)
	}
	modified := make(definition.FetchedValues, len(resources))
	for resourceName, resourceQuantity := range resources {
		n := camelcase.Camelcase(string(r) + strings.Title(addResourceUnit(resourceName)))
		modified[n] = resourceQuantity.Value()
	}
	return modified, nil
}
oneAttributePerResource transforms a map of resources to
FetchedValues type, which will be converted later to one attribute
per resource.

The attribute names will be prefixed with the given resourceType.
package metric
import (
	"fmt"
	"strings"
	"github.com/segmentio/go-camelcase"
	v1 "k8s.io/api/core/v1"
	"github.com/newrelic/nri-kubernetes/v2/src/definition"
)
type (
	resourceType string
	resourceUnit string
)
const (
	resourceTypeAllocatable resourceType = "allocatable"
	resourceTypeCapacity    resourceType = "capacity"
	resourceUnitBytes       resourceUnit = "Bytes"
	resourceUnitCores       resourceUnit = "Cores"
)