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

Update logging and dependencies #294

Merged
merged 5 commits into from
Aug 28, 2023

Conversation

Knalltuete5000
Copy link
Contributor

@Knalltuete5000 Knalltuete5000 commented Aug 22, 2023

This PR includes multiple changes to the exporter, but should not change the functionality of the exporter.

First of all this PR upgrades the dependencies and removes the deprecated log library form prometheus mentioned in #256. It will be replaced with the github.com/go-kit/log library, which is used by other exporters, e.g. the smartctl_exporter or the node_exporter

Due to the switch of the logging library it is possible to upgrade the prometheus libraries to the current versions. This includes also scraping the exporter via tls.

In addition the landing page is replaced with the landing page provided by the github.com/prometheus/exporter-toolkit

NOTE: I have added a golangci configuration file to exclude the .Log-method from checking the error returned. Please let me know if this is wanted or not. If not I will remove the configuration fill and work around the linting issues.

Copy link
Member

@niedbalski niedbalski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs extra info here.

@@ -176,7 +178,7 @@ func (exporter *BaseOpenStackExporter) AddMetric(name string, fn ListFunc, label
// @TODO: get the region. constLabels["region"] = exporter.

if _, ok := exporter.Metrics[name]; !ok {
log.Infof("Adding metric: %s to exporter: %s", name, exporter.Name)
// log.Infof("Adding metric: %s to exporter: %s", name, exporter.Name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't remove this.

main.go Show resolved Hide resolved
* Remove deprecated dependency github.com/prometheus/common/log and
  replace with github.com/go-kit/log

* Update dependencies to the latest version
* Replace the landing page with the default landing page generated
  by the prometheus exporter toolkit
* Update the server handling to use the prometheus exporter toolkit
  This enables also the experimental tls support.
* Update the readme to include the current help output
@niedbalski niedbalski merged commit ea93db0 into openstack-exporter:main Aug 28, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants