Description
Bug Report
What did you do?
Tried to import github.com/prometheus/prometheus/config
for use in my own application:
package main
import "github.com/prometheus/prometheus/config"
func main() {
config.LoadFile("./prometheus.yml")
}
What did you expect to see?
successful compilation.
What did you see instead? Under which circumstances?
$ go version
go version go1.12.5 linux/amd64
$ go build
go: finding github.com/Azure/azure-sdk-for-go/arm/compute latest
go: finding github.com/Azure/azure-sdk-for-go/arm/network latest
go: finding github.com/Azure/azure-sdk-for-go/arm latest
build github.com/myorg/myapp/prometheus: cannot load github.com/Azure/azure-sdk-for-go/arm/compute: cannot find module providing package github.com/Azure/azure-sdk-for-go/arm/compute
Environment
- System information:
$ uname -srm
Linux 4.4.0-17763-Microsoft x86_64
Notes
This might be something to do with #4468 - in that issue, volatile third-party dependencies is the reason given for still using the vendor directory. I don't see why this is necessary when a requirement can be pinned to a specific commit in go.mod
?
The reason I'm trying to do all this is that I need to a way to configure Prometheus targets at launch time, preferably by environment variables. I don't have the ability to mount in a configuration file (running in docker), and the targets vary depending on environment so can't bake the config into the image. My plan is to use an entrypoint script to generate a custom config file based off of environment variables... if there's an easier way to do this, please let me know.