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

Config filename hard-coded to metrics/vertica-prometheus-exporter.yml #24

Open
hhromic opened this issue Jan 19, 2023 · 1 comment
Open

Comments

@hhromic
Copy link

hhromic commented Jan 19, 2023

Hi @verticacrossman,
Here is the first issue we found yesterday while testing this exporter.

The logger implementation uses metrics/vertica-prometheus-exporter.yml as hard-coded fname for the config file for obtaining the logging configuration here:

func SetupLogger(configFile string) {
yfile, err1 := ioutil.ReadFile("metrics/vertica-prometheus-exporter.yml")
if err1 != nil {
log.Fatal(err1)
}

This means that currently is impossible to start the Vertica exporter with a config file NOT in metrics/vertica-prometheus-exporter.yml:

# simplest example is to just rename `metrics` in the repo to something else
$ mv metrics other
$ ./vertica-prometheus-exporter -config.file other/vertica-prometheus-exporter.yml
INFO[2023-01-19T11:33:02Z] Starting vertica exporter (version=v1.0.2, branch=main, revision=becca378611ba84b2b40c5dd8aeb698443bf8fe0) (go=go1.19.2, user=root@USNPrabhu01, date=20221025-16:18:53)
INFO[2023-01-19T11:33:02Z] Loading configuration from other/vertica-prometheus-exporter.yml
INFO[2023-01-19T11:33:02Z] Loaded collector "example" from other/vertica-example.collector.yml
INFO[2023-01-19T11:33:02Z] Loaded collector "example1" from other/vertica-example1.collector.yml
INFO[2023-01-19T11:33:02Z] [collector="example"] Non-zero min_interval (10s), using cached collector.
INFO[2023-01-19T11:33:02Z] [collector="example1"] Non-zero min_interval (10s), using cached collector.
(0xa97620,0xc0000d2a00)
FATA[2023-01-19T11:33:02Z] open metrics/vertica-prometheus-exporter.yml: no such file or directory

The code should use configFile instead of the hard-coded name in ReadFile().

@hhromic hhromic changed the title Config filename harc-coded to metrics/vertica-prometheus-exporter.yml Config filename hard-coded to metrics/vertica-prometheus-exporter.yml Jan 19, 2023
@verticacrossman
Copy link
Contributor

@hhromic Thanks for this feedback. So the issue is that we allow you to use --config_file when starting the exporter, but the logger expects to find it's configuration options in a specific path/config file. This one is clear and we'll add to our list of fixes for the next release.

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

2 participants