add support for additional prometheus labels for query (#1936)

This commit is contained in:
Harshavardhana
2022-05-05 13:44:10 -07:00
committed by GitHub
parent 9103ea9d70
commit 3bfdbb5ec7
109 changed files with 606 additions and 841 deletions

View File

@@ -144,7 +144,7 @@ func GetAuditEntry(ctx context.Context) *audit.Entry {
}
r = &audit.Entry{
Version: audit.Version,
//DeploymentID: globalDeploymentID,
// DeploymentID: globalDeploymentID,
Time: time.Now().UTC(),
}
SetAuditEntry(ctx, r)

View File

@@ -144,7 +144,7 @@ func uniqueEntries(paths []string) []string {
// and GOROOT directories. Also append github.com/minio/minio
// This is done to clean up the filename, when stack trace is
// displayed when an errors happens.
func Init(goPath string, goRoot string) {
func Init(goPath, goRoot string) {
var goPathList []string
var goRootList []string
var defaultgoPathList []string

View File

@@ -59,7 +59,6 @@ func TestNewEntry(t *testing.T) {
}
func TestToEntry(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/api/v1/tenants?test=xyz", nil)
req.Header.Set("Authorization", "xyz")
req.Header.Set("ETag", "\"ABCDE\"")
@@ -91,7 +90,6 @@ func TestToEntry(t *testing.T) {
},
postFunc: func() {
os.Unsetenv("CONSOLE_OPERATOR_MODE")
},
name: "constructs an audit entry from a http request",
args: args{

View File

@@ -105,8 +105,7 @@ func (h *Target) Init() error {
xhttp.DrainBody(resp.Body)
if !acceptedResponseStatusCode(resp.StatusCode) {
switch resp.StatusCode {
case http.StatusForbidden:
if resp.StatusCode == http.StatusForbidden {
return fmt.Errorf("%s returned '%s', please check if your auth token is correctly set",
h.config.Endpoint, resp.Status)
}