def set_attribute_label(series, resource_labels, attribute_key,
    canonical_key=None, label_value_prefix=''):
    """Set a label to timeseries that can be used for monitoring
    :param series: TimeSeries object based on view data
    :param resource_labels: collection of labels
    :param attribute_key: actual label key
    :param canonical_key: exporter specific label key, Optional
    :param label_value_prefix: exporter specific label value prefix, Optional
    """
    if attribute_key in resource_labels:
        if canonical_key is None:
            canonical_key = attribute_key
        series.resource.labels[canonical_key
            ] = label_value_prefix + resource_labels[attribute_key]
