Set labels to span that can be used for tracing.
    :param span: Span object

def set_monitored_resource_attributes(span):
    """Set labels to span that can be used for tracing.
    :param span: Span object
    """
    resource = monitored_resource.get_instance()
    if resource is not None:
        resource_type = resource.get_type()
        resource_labels = resource.get_labels()

        if resource_type == 'gke_container':
            resource_type = 'k8s_container'
            set_attribute_label(span, resource_type, resource_labels,
                                'project_id')
            set_attribute_label(span, resource_type, resource_labels,
                                'cluster_name')
            set_attribute_label(span, resource_type, resource_labels,
                                'container_name')
            set_attribute_label(span, resource_type, resource_labels,
                                'namespace_id', 'namespace_name')
            set_attribute_label(span, resource_type, resource_labels,
                                'pod_id', 'pod_name')
            set_attribute_label(span, resource_type, resource_labels,
                                'zone', 'location')

        elif resource_type == 'gce_instance':
            set_attribute_label(span, resource_type, resource_labels,
                                'project_id')
            set_attribute_label(span, resource_type, resource_labels,
                                'instance_id')
            set_attribute_label(span, resource_type, resource_labels,
                                'zone')

        elif resource_type == 'aws_ec2_instance':
            set_attribute_label(span, resource_type, resource_labels,
                                'aws_account')
            set_attribute_label(span, resource_type, resource_labels,
                                'instance_id')
            set_attribute_label(span, resource_type, resource_labels,
                                'region', label_value_prefix='aws:')