def get_cloud_resource_detectors()

in src/elasticotel/distro/resource_detectors.py [0:0]


def get_cloud_resource_detectors():
    """Helper to get a subset of the available cloud resource detectors depending on the environment

    This is done to avoid loading resource detectors doing HTTP requests for metadata that will fail"""
    if _on_aws_lambda():
        return AWS_LAMBDA_DETECTORS
    elif _on_azure_functions():
        return AZURE_FUNCTIONS_DETECTORS
    elif _on_gcp_cloud_run():
        return GCP_CLOUD_RUN_DETECTORS
    elif _on_k8s():
        return KUBERNETES_DETECTORS
    return OTHER_CLOUD_DETECTORS