I am using prometheus-postgresql-adapter for my project and I am trying to run it in Docker.
And I am going through all of their documentation:
go get -u github.com/timescale/prometheus-postgresql-adapter
dep ensure
make
When i wrote make
command it threw me this error:
GOOS=mingw64_nt-10.0 GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags '-w' -o prometheus-postgresql-adapter main.go cmd/go: unsupported GOOS/GOARCH pair mingw64_nt-10.0/amd64 make: *** [prometheus-postgresql-adapter] Error 2
so i ran it as make OS=windows
then
make docker-image
make docker-push ORGANIZATOIN=myusername
But when I am trying to run that image with this code:
docker run --name prometheus_postgresql_adapter --link pg_prometheus -d -p 9201:9201 \
timescale/prometheus-postgresql-adapter:master \
-pg-host=pg_prometheus \
-pg-prometheus-log-samples
And got that error
flag provided but not defined: -pg-host
I even changed -pg-host=pg_prometheus
to pg-password='mypassword'
since the default host is localhost still get that error:
flag provided but not defined: -pg-password
when I am trying to remove -pg-host
or -pg-password
and let only the pg-prometheus-log-samples
still get that error":
flag provided but not defined: -pg-prometheus-log-samples
Anyone has any idea why is not recognizing these flag values?
Also i tried writing -pg-password='mypassword'
as -pg-password=mypassword
and even -pg-password mypassword
but still the same error comes up.
p.s. I am doing all of this in windows
Here,
you need to have all your containers in one docker network. So create one, say named psgs:
After that, you run your containers with the --net=psgs to indicate what docker network you want them run in.
Finally, the adapter seems to expect parameters with the pg.* pattern instead of pg-* pattern.