|
|
@ -22,8 +22,11 @@ import ( |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/pkg/errors" |
|
|
|
"github.com/pkg/errors" |
|
|
|
|
|
|
|
"github.com/prometheus/common/version" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var userAgent = fmt.Sprintf("Prometheus/%s", version.Version) |
|
|
|
|
|
|
|
|
|
|
|
type Applications struct { |
|
|
|
type Applications struct { |
|
|
|
VersionsDelta int `xml:"versions__delta"` |
|
|
|
VersionsDelta int `xml:"versions__delta"` |
|
|
|
AppsHashcode string `xml:"apps__hashcode"` |
|
|
|
AppsHashcode string `xml:"apps__hashcode"` |
|
|
@ -85,6 +88,7 @@ func fetchApps(ctx context.Context, server string, client *http.Client) (*Applic |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
request = request.WithContext(ctx) |
|
|
|
request = request.WithContext(ctx) |
|
|
|
|
|
|
|
request.Header.Add("User-Agent", userAgent) |
|
|
|
|
|
|
|
|
|
|
|
resp, err := client.Do(request) |
|
|
|
resp, err := client.Do(request) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|