1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 21:45:43 +01:00
Files
glusterd2/pkg/restclient/tracing.go
Sridhar Seshasayee ec25ca6619 Tracing: Implement glustercli command to disable the trace configuration
Implement glustercli command to disable and delete the current tracing
configuration on the cluster. The changes include gd2 transaction that
first deletes the trace configuration from the store on one node and then
a subsequent step clears the in-memory trace configuration on all nodes.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30

35 lines
1.1 KiB
Go

package restclient
import (
"net/http"
tracemgmtapi "github.com/gluster/glusterd2/plugins/tracemgmt/api"
)
// TraceEnable enables tracing
func (c *Client) TraceEnable(req tracemgmtapi.SetupTracingReq) (tracemgmtapi.JaegerConfigInfo, error) {
var jaegercfginfo tracemgmtapi.JaegerConfigInfo
err := c.post("/v1/tracemgmt", req, http.StatusCreated, &jaegercfginfo)
return jaegercfginfo, err
}
// TraceStatus displays tracing config
func (c *Client) TraceStatus() (tracemgmtapi.JaegerConfigInfo, error) {
var jaegercfginfo tracemgmtapi.JaegerConfigInfo
err := c.get("/v1/tracemgmt", nil, http.StatusOK, &jaegercfginfo)
return jaegercfginfo, err
}
// TraceUpdate updates an exisiting trace configuration
func (c *Client) TraceUpdate(req tracemgmtapi.SetupTracingReq) (tracemgmtapi.JaegerConfigInfo, error) {
var jaegercfginfo tracemgmtapi.JaegerConfigInfo
err := c.post("/v1/tracemgmt/update", req, http.StatusOK, &jaegercfginfo)
return jaegercfginfo, err
}
// TraceDisable disables and optionally deletes the tracing config
func (c *Client) TraceDisable() error {
err := c.del("/v1/tracemgmt", nil, http.StatusNoContent, nil)
return err
}