grafana / grafana/alerting

http/instrument does not build from go.mod alone: stdoutlog v0.12.2 vs otel/sdk v1.44.0

Open Beginner friendly
#671 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
89
Forks
74
Avg merge
2d 7h
Merged PRs (30d)
8

Description

Building `./http/instrument/` with the workspace disabled fails today on `main`:

```
$ GOWORK=off go build ./http/instrument/
# go.opentelemetry.io/otel/exporters/stdout/stdoutlog
.../stdoutlog@v0.12.2/record.go:109:13: cannot use &res (value of type **resource.Resource) as *resource.Resource value in struct literal
```

`go.work` hides it locally, so `make build` / `make test` stay green: the workspace resolves `stdoutlog` to `v0.19.0`, while `go.mod` alone resolves `v0.12.2`.

```
$ GOWORK=off go list -m go.opentelemetry.io/otel/exporters/stdout/stdoutlog go.opentelemetry.io/otel/sdk
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.12.2
go.opentelemetry.io/otel/sdk v1.44.0

$ go list -m go.opentelemetry.io/otel/exporters/stdout/stdoutlog
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.19.0
```

The dependency reaches us indirectly:

```
$ GOWORK=off go mod why go.opentelemetry.io/otel/exporters/stdout/stdoutlog
github.com/grafana/alerting/http/instrument
github.com/grafana/dskit/instrument
github.com/grafana/dskit/tracing
go.opentelemetry.io/contrib/exporters/autoexport
go.opentelemetry.io/otel/exporters/stdout/stdoutlog
```

`go.mod` carries `go.opentelemetry.io/otel/sdk v1.44.0` (line 135) alongside `stdoutlog v0.12.2` (line 130), and that pair does not compile — `stdoutlog v0.12.2` predates the `resource.Resource` signature change in the SDK.

**Impact:** anyone importing `github.com/grafana/alerting/http/instrument` from a released version of this module cannot build it. Only contributors working inside this repo's workspace are shielded.

**Suggested fix:** raise the indirect `stdoutlog` requirement to a version compatible with `otel/sdk v1.44.0` (the workspace already uses `v0.19.0` successfully), and consider whether CI should run a `GOWORK=off` build so a workspace-masked resolution cannot pass again.

Contributor guide

Open the contributing guide

Research direction

Inspect go.mod around lines 130 and 135, then reproduce the failure with GOWORK=off go build ./http/instrument/. Align the indirect stdoutlog requirement with otel/sdk v1.44.0 and verify that the package builds without the workspace; review whether CI should include this workspace-disabled check.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.