Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rhsakarpos
Copy link
Contributor

@rhsakarpos rhsakarpos commented May 2, 2019

What this PR does / why we need it:
This PR enables us to

  1. Upload a configuration file to Prometheus
  2. Download the configuration file from Prometheus

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
NA

Special notes for your reviewer:
The similar API is going to be used to upload and download configuration files for all telemetry 3rd party components, like Prometheus, Alert manager, Node exporter etc. The general flow is as below

Upload

  • Backup the current configuration file with extension .bak
  • Upload the configuration file to the server, in the right location
  • Call some API or POST request to reload the configuration (if the 3rd party supports it)

Release note:

Upload API

http://localhost:50040/v1beta/metrics/uploadconf?conftype=prometheus
// the value of the conftype determines the component, like 'prometheus', 'nodeexporter' etc.

Download API

http://localhost:50040/v1beta/metrics/downloadconf?conftype=prometheus
// the value of the conftype determines the component, like 'prometheus', 'nodeexporter' etc.

@rhsakarpos
Copy link
Contributor Author

@skdwriting @wisererik @xing-yang Please review

@rhsakarpos
Copy link
Contributor Author

This is tested for Prometheus, am now extending it to the other 3rd party components too...that is a WIP

@coveralls
Copy link

coveralls commented May 2, 2019

Coverage Status

Coverage decreased (-0.1%) to 30.209% when pulling e234684 on rhsakarpos:updownload into 1a13191 on opensds:development.

@leonwanghui leonwanghui added the patch there is minor code change label May 5, 2019
Copy link
Collaborator

@leonwanghui leonwanghui left a comment

Choose a reason for hiding this comment

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

I mean can you move the code in fileops.go to metrics.go. Because downloadconf and uploadconf is subpath under metrics.

Copy link
Collaborator

@leonwanghui leonwanghui left a comment

Choose a reason for hiding this comment

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

Please refer to the comments in #708.

@rhsakarpos
Copy link
Contributor Author

I mean can you move the code in fileops.go to metrics.go. Because downloadconf and uploadconf is subpath under metrics.

refactored, moved into metrics.go

@leonwanghui
Copy link
Collaborator

Please rebase it.

@rhsakarpos
Copy link
Contributor Author

Please rebase it.

Done

@leonwanghui
Copy link
Collaborator

Also need a rebase.

rhsakarpos and others added 2 commits May 9, 2019 09:29
- added . in header copyright line
Copy link
Collaborator

@leonwanghui leonwanghui left a comment

Choose a reason for hiding this comment

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

LGTM

@leonwanghui
Copy link
Collaborator

@wisererik Please take a look at this PR.

@leonwanghui leonwanghui merged commit 291b4ff into sodafoundation:development May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch there is minor code change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants