floyd871 / prometheus_oracle_exporter

Prometheus Oracle Database exporter
MIT License
109 stars 77 forks source link

Compile error in alertlog.go #77

Closed This-is-me-now closed 3 years ago

This-is-me-now commented 3 years ago

As I also have the problem with the alertlog (described in #70) and the last release (1.1.5) here still has this issue I decided to compile a version on my own. Downloaded the project and it's dependencies with "go get".

Trying a first compile, I get the following error message:

johndoe@jd-VirtualBox:~/go/src/github.com/freenetdigital/prometheus_oracle_exporter$ go build 
# github.com/freenetdigital/prometheus_oracle_exporter
./alertlog.go:148:7: undefined: strings.ToValidUTF8

To be honest, I don't know, how to handle this. This is the first time, I work with go.lang source code.

Thanks for any help.

This-is-me-now commented 3 years ago

Problem solved!

The function ToValidUTF8 has been added to package strings with version 1.13, my go version here was 1.12, which explains why this function was marked as undefined.

After updating to latest version (1.15.8) compile runs fine.

Seth1u commented 3 years ago

And did you have errors ORA- on prometheus output ?

This-is-me-now commented 3 years ago

Yes, after setting the correct date format in alertlog.go as described here:

https://github.com/freenetdigital/prometheus_oracle_exporter/issues/70#issuecomment-775314463

Looks like this: oracledb_error{code="ORA-00600",database="myDB",dbinstance="myDB",description="This is a test error message for monitoring and can be ignored.",ignore="0"} 23