1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-28 21:09:17 +02:00
opentelemetry-go/sdk/resource/host_id_export_test.go
2024-02-29 07:05:28 +01:00

27 lines
532 B
Go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package resource_test
import (
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/otel/sdk/resource"
)
func mockHostIDProvider() {
resource.SetHostIDProvider(
func() (string, error) { return "f2c668b579780554f70f72a063dc0864", nil },
)
}
func mockHostIDProviderWithError() {
resource.SetHostIDProvider(
func() (string, error) { return "", assert.AnError },
)
}
func restoreHostIDProvider() {
resource.SetDefaultHostIDProvider()
}