mirror of https://github.com/linkerd/linkerd2.git
Document tps-reports (#1509)
It's not obvious from the name what the tps-reports API endpoint does. Added a few comments to clarify. Signed-off-by: Alex Leong <alex@buoyant.io>
This commit is contained in:
parent
1d3580ba0c
commit
1f42996889
|
@ -288,7 +288,7 @@ class Tap extends React.Component {
|
|||
pendingRequests: true
|
||||
});
|
||||
|
||||
let url = "/api/tps-reports?resource_type=all&all_namespaces=true";
|
||||
let url = this.api.urlsForResource("all");
|
||||
this.api.setCurrentRequests([this.api.fetchMetrics(url)]);
|
||||
this.serverPromise = Promise.all(this.api.getCurrentPromises())
|
||||
.then(rsp => {
|
||||
|
|
|
@ -98,7 +98,7 @@ class Top extends React.Component {
|
|||
pendingRequests: true
|
||||
});
|
||||
|
||||
let url = "/api/tps-reports?resource_type=all&all_namespaces=true";
|
||||
let url = this.api.urlsForResource("all");
|
||||
this.api.setCurrentRequests([this.api.fetchMetrics(url)]);
|
||||
this.serverPromise = Promise.all(this.api.getCurrentPromises())
|
||||
.then(rsp => {
|
||||
|
|
|
@ -97,6 +97,7 @@ const ApiHelpers = (pathPrefix, defaultMetricsWindow = '1m') => {
|
|||
};
|
||||
|
||||
const urlsForResource = (type, namespace) => {
|
||||
// Traffic Performance Summary. This retrieves stats for the given resource.
|
||||
let baseUrl = '/api/tps-reports?resource_type=' + type;
|
||||
return !namespace ? baseUrl + '&all_namespaces=true' : baseUrl + '&namespace=' + namespace;
|
||||
};
|
||||
|
|
|
@ -101,6 +101,9 @@ func NewServer(addr, templateDir, staticDir, uuid, controllerNamespace, webpackD
|
|||
|
||||
// webapp api routes
|
||||
server.router.GET("/api/version", handler.handleApiVersion)
|
||||
// Traffic Performance Summary. This route used to be called /api/stat
|
||||
// but was renamed to avoid triggering ad blockers.
|
||||
// See: https://github.com/linkerd/linkerd2/issues/970
|
||||
server.router.GET("/api/tps-reports", handler.handleApiStat)
|
||||
server.router.GET("/api/pods", handler.handleApiPods)
|
||||
server.router.GET("/api/tap", handler.handleApiTap)
|
||||
|
|
Loading…
Reference in New Issue