Skip to content

Commit

Permalink
Update system/info metrics links to use API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jul 17, 2018
1 parent 5663a7d commit 3fbc491
Showing 1 changed file with 8 additions and 4 deletions.
Expand Up @@ -409,7 +409,7 @@ class ApiController extends ControllerBase{
/**
* /api/1/system/info: display stats and info about the server
*/
def apiSystemInfo={
def apiSystemInfo(){
if (!apiService.requireApi(request, response)) {
return
}
Expand All @@ -436,9 +436,12 @@ class ApiController extends ControllerBase{
Date startupDate = new Date(nowDate.getTime()-durationTime)
int threadActiveCount=Thread.activeCount()
boolean executionModeActive=configurationService.executionModeActive
def metricsJsonUrl = createLink(uri: '/metrics/metrics?pretty=true',absolute: true)
def metricsThreadDumpUrl = createLink(uri: '/metrics/threads',absolute: true)
def metricsHealthcheckUrl = createLink(uri: '/metrics/healthcheck',absolute: true)

def metricsJsonUrl = grailsLinkGenerator.link(uri: "/api/${ApiVersions.API_CURRENT_VERSION}/metrics/metrics?pretty=true", absolute: true)
def metricsThreadDumpUrl = grailsLinkGenerator.link(uri: "/api/${ApiVersions.API_CURRENT_VERSION}/metrics/threads", absolute: true)
def metricsHealthcheckUrl = grailsLinkGenerator.link(uri: "/api/${ApiVersions.API_CURRENT_VERSION}/metrics/healthcheck", absolute: true)
def metricsPingUrl = grailsLinkGenerator.link(uri: "/api/${ApiVersions.API_CURRENT_VERSION}/metrics/ping", absolute: true)

if (request.api_version < ApiVersions.V14 && !(response.format in ['all','xml'])) {
return apiService.renderErrorXml(response,[
status:HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE,
Expand Down Expand Up @@ -511,6 +514,7 @@ class ApiController extends ControllerBase{
metrics(href:metricsJsonUrl,contentType:'application/json')
threadDump(href:metricsThreadDumpUrl,contentType:'text/plain')
healthcheck(href:metricsHealthcheckUrl,contentType:'application/json')
ping(href:metricsPingUrl,contentType:'text/plain')

if (extMeta) {
extended {
Expand Down

0 comments on commit 3fbc491

Please sign in to comment.