prometheus_oracle_exporter icon indicating copy to clipboard operation
prometheus_oracle_exporter copied to clipboard

go get is failing because of change in the folder format in prometheus/common

Open isshwar opened this issue 3 years ago • 2 comments

Hi,

I am new to go programming but using various resources on google built oracle exporter docker container for the version of oracle that we are running. while until recently, i was able to build this successfully, this is now failing because of a change in folder format on prometheus end.

error message: RUN go get -d github.com/freenetdigital/prometheus_oracle_exporter ---> Running in 8073d698d479 cannot find package "github.com/prometheus/common/log" in any of: /usr/local/go/src/github.com/prometheus/common/log (from $GOROOT) /go/src/github.com/prometheus/common/log (from $GOPATH)

while looking at the folders available https://github.com/prometheus/common i see only promlog and not log.

package main

import (
	"bufio"
	"os"
	"regexp"
	"strconv"
	"strings"
	"time"

	"github.com/prometheus/common/log"
)

Change required at the above code snippet, but i am not sure if changing this alone would be suffice or it breaks things further.

I tried to change "github.com/prometheus/common/log" to "github.com/prometheus/common/promlog" but this started failing at further down the code

#13 15.28 ./alertlog.go:11:2: imported and not used: "github.com/prometheus/common/promlog"
#13 15.28 ./alertlog.go:127:5: undefined: log
#13 15.28 ./main.go:14:2: imported and not used: "github.com/prometheus/common/promlog"
#13 15.28 ./main.go:913:6: undefined: log
#13 15.28 ./main.go:1088:2: undefined: log
#13 15.28 ./main.go:1090:3: undefined: log
#13 15.28 ./main.go:1098:3: undefined: log
#13 15.28 ./main.go:1099:3: undefined: log
#13 15.28 ./misc.go:12:2: imported and not used: "github.com/prometheus/common/promlog"
#13 15.28 ./misc.go:66:3: undefined: log
#13 15.28 ./misc.go:66:3: too many errors

isshwar avatar Aug 03 '21 13:08 isshwar

A quick update, i have upgraded the golang version to 1.6 and then created added the below which helped me fix the issue and complete the docker build process. so, I am pulling the version before the change.

go get github.com/prometheus/[email protected] go get -d github.com/freenetdigital/prometheus_oracle_exporter go mod init go mod tidy

Thanks

isshwar avatar Aug 06 '21 07:08 isshwar

go get is no longer supported.

do you have any idea to make it functionnal ?

Neurozone avatar Jul 26 '23 13:07 Neurozone