Skip to content

Commit 9a92b99

Browse files
authored
[chore][internal/datadog] Add noop implementation for windows/arm64 (open-telemetry#41695)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Adds noop gohai implementation <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Updates open-telemetry#40247
1 parent 2f7c78e commit 9a92b99

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

internal/datadog/hostmetadata/internal/gohai/gohai.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
//go:build !(windows && arm64)
5+
46
package gohai // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog/hostmetadata/internal/gohai"
57

68
import (
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
//go:build windows && arm64
5+
6+
package gohai // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog/hostmetadata/internal/gohai"
7+
8+
import (
9+
"github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata/gohai"
10+
"go.uber.org/zap"
11+
)
12+
13+
// NewPayload returns an empty gohai payload since windows/arm64 is not supported.
14+
func NewPayload(logger *zap.Logger) gohai.Payload {
15+
payload := gohai.NewEmpty()
16+
payload.Gohai.Gohai = newGohai(logger)
17+
return payload
18+
}
19+
20+
func newGohai(logger *zap.Logger) *gohai.Gohai {
21+
logger.Info("Using noop gohai implementation for windows/arm64 since it is not supported")
22+
return new(gohai.Gohai)
23+
}

internal/datadog/hostmetadata/internal/gohai/processes_other.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import (
1111
)
1212

1313
// GetProcessesPayload currently just a stub.
14-
func NewProcessesPayload(_ string, _ *zap.Logger) *gohai.ProcessesPayload {
14+
func NewProcessesPayload(_ string, logger *zap.Logger) *gohai.ProcessesPayload {
1515
// unimplemented for misc platforms.
16+
logger.Info("Using noop gohai implementation since this platform is not supported")
1617
return &gohai.ProcessesPayload{}
1718
}

0 commit comments

Comments
 (0)