tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

Prometheus not compatible with tinygo?

Open f0o opened this issue 1 year ago • 1 comments

Possibly related to https://github.com/tinygo-org/tinygo/issues/3705 ?

# github.com/prometheus/client_golang/prometheus/internal
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:42:27: d.Name undefined (type *metrics.Description has no field or method Name)
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:65:7: d.Cumulative undefined (type *metrics.Description has no field or method Cumulative)
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:65:23: d.Kind undefined (type *metrics.Description has no field or method Kind)
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:65:39: undefined: metrics.KindFloat64Histogram
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:70:11: d.Kind undefined (type *metrics.Description has no field or method Kind)
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:71:15: undefined: metrics.KindUint64
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:72:15: undefined: metrics.KindFloat64
../../../../go/pkg/mod/github.com/prometheus/[email protected]/prometheus/internal/go_runtime_metrics.go:73:15: undefined: metrics.KindFloat64Histogram

I'm not even sure where to start looking on this one; I cleared the modcache and let tinygo download the modules fresh but the error is a bit generic.

It works fine on Go 1.19+

f0o avatar Aug 23 '23 17:08 f0o

go the same issue, and not sure how to fix it :/

cpanato avatar Feb 11 '24 14:02 cpanato

The best way to get this working would be to extend the stub runtime/metrics package that got added in this PR: https://github.com/tinygo-org/tinygo/pull/3709

aykevl avatar Feb 19 '24 15:02 aykevl