Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors without using modules #219

Open
acsbendi opened this issue Jun 24, 2019 · 4 comments
Open

Build errors without using modules #219

acsbendi opened this issue Jun 24, 2019 · 4 comments

Comments

@acsbendi
Copy link

When trying to build simple_server.go (as a dependency of another project), I get the following build errors:

../gizmo/server/simple_server.go:103:2: undefined: prometheus.InstrumentHandlerWithOpts
../gizmo/server/simple_server.go:123:3: undefined: prometheus.InstrumentHandler
../gizmo/server/simple_server.go:123:46: undefined: prometheus.UninstrumentedHandler
@jprobinson
Copy link
Contributor

Howdy @acsbendi!

It looks like you may be attempting to build against the latest version of that prometheus client.

With Go Modules, gizmo currently has that client pinned at version v0.9.2, where those do functions exist.

Have you tried this using Go 1.11+ and Go Modules? Here's some documentation that should help: https://github.com/golang/go/wiki/Modules#how-to-install-and-activate-module-support

@acsbendi
Copy link
Author

acsbendi commented Jun 24, 2019

Yes, it's when I don't use Go modules. I just thought it's a good idea to let you know about this problem, since there might be a good reason why the missing parts were removed from prometheus.

When I build with modules, everything is okay, thanks for the suggestion.

@acsbendi acsbendi changed the title Build errors Build errors without using modules Jun 24, 2019
@rogeriozambon
Copy link

I'm running my apps with dep instead go mod. I just override the Prometheus' client to the pinned version by gizmo and worked well.

[[override]]
  name = "github.com/prometheus/client_golang"
  version = "0.9.2"

@alexellis
Copy link

Did we find a root cause for this? Is using an old version the only solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants