func NewCloudRun() *CloudRun {
	return &CloudRun{
		mc:     metadata.NewClient(nil),
		onGCE:  metadata.OnGCE,
		getenv: os.Getenv,
	}
}
NewCloudRun creates a CloudRun detector.
package gcp
import (
	"context"
	"fmt"
	"os"
	"cloud.google.com/go/compute/metadata"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/sdk/resource"
	semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
)
const serviceNamespace = "cloud-run-managed"
type metadataClient interface {
	ProjectID() (string, error)
	Get(string) (string, error)
	InstanceID() (string, error)
}
type CloudRun struct {
	mc     metadataClient
	onGCE  func() bool
	getenv func(string) string
}
var _ resource.Detector = (*CloudRun)(nil)