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

Add logRotate to mongodb_exporter #88

Open
zhihuiFan opened this issue Feb 25, 2018 · 7 comments
Open

Add logRotate to mongodb_exporter #88

zhihuiFan opened this issue Feb 25, 2018 · 7 comments

Comments

@zhihuiFan
Copy link
Contributor

zhihuiFan commented Feb 25, 2018

Hi @dcu
Currently I'm using mongodb_expoerter in my environment, and I don't want to install too many agents. Now I want a feature to a different url path.

  1. allow a user to logRotate regularly. Like once per day
  2. configure a log retention policy so that the old log can be purged automatically.

I know it is not part of Prometheus agent, so I want to know if it is welcome to send such PR to this repo. Personally, I do want add it.

Thanks

@avishefi
Copy link
Collaborator

Prometheus exporters do not generate logs normally, what log do you want to configure & rotate?

@zhihuiFan
Copy link
Contributor Author

The logs of mongodb, sometime it may take a lot of spaces

@avishefi
Copy link
Collaborator

Prometheus exporters expose metrics, they do not manage log files

@sanvila
Copy link

sanvila commented Apr 23, 2018

OP probably refers to all the stuff accumulating at /var/log/prometheus in the form prometheus-mongodb-exporter.MACHINE.TIMESTAMP. Those log files are generated by prometheus-mongodb-exporter and
by default they take a lot of disk space.

I agree that it would be nice to have a procedure allowing the user to rotate those logs.

@gao-jian-zz
Copy link

gao-jian-zz commented May 2, 2018

my log file is named like mongodb_exporter.ip-10-72-229-205.ec2-user.log.INFO.20180502-212317.24179.

How to change the log level to others than INFO?

@zjagust
Copy link

zjagust commented Sep 26, 2018

OP probably refers to all the stuff accumulating at /var/log/prometheus in the form prometheus-mongodb-exporter.MACHINE.TIMESTAMP. Those log files are generated by prometheus-mongodb-exporter and
by default they take a lot of disk space.

I agree that it would be nice to have a procedure allowing the user to rotate those logs.

Yeah, I'd like to know what and how generates those files. The largest one I have is aroung 350 MB and others are no less than 80 MB. Would be cool if there is some way to rotate/compress/purge old those file.

@IntiGabriel
Copy link

IntiGabriel commented Nov 4, 2019

You can configure glog to log to stderr -logtostderr=true or log to another dir -log_dir="<ANOTHER_DIR>" to avoid filling up disk space. I need to redirect logs for long running containers.

More documentation for glog: https://godoc.org/github.com/golang/glog

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

6 participants