MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / instanceID

Function instanceID

api/pkg/di/container.go:1949–1958  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1947}
1948
1949func instanceID() string {
1950 h, err := os.Hostname()
1951 if err != nil {
1952 h = strconv.Itoa(os.Getpid())
1953 }
1954 if metadata.OnGCE() {
1955 return getGCEInstanceID(h)
1956 }
1957 return h
1958}
1959
1960func getGCEInstanceID(hostname string) string {
1961 instanceID, err := metadata.InstanceIDWithContext(context.Background())

Callers 2

OtelResourcesMethod · 0.85
loggerFunction · 0.85

Calls 1

getGCEInstanceIDFunction · 0.85

Tested by

no test coverage detected