All Downloads are FREE. Search and download functionalities are using the official Maven repository.

freemarker.es8x.index.v4-metrics.ftl Maven / Gradle / Ivy

There is a newer version: 5.6.0
Show newest version
<#-- @ftlvariable name="@timestamp" type="java.lang.String" -->
<#-- @ftlvariable name="index" type="java.lang.String" -->
<#-- @ftlvariable name="pipeline" type="java.lang.String" -->
<#-- @ftlvariable name="gateway" type="java.lang.String" -->
<#-- @ftlvariable name="metrics" type="io.gravitee.reporter.api.v4.metric.Metrics" -->
<#-- @ftlvariable name="endpointResponseTimeMs" type="java.lang.Long" -->
<#-- @ftlvariable name="gatewayResponseTimeMs" type="java.lang.Long" -->
<#-- @ftlvariable name="gatewayLatencyMs" type="java.lang.Long" -->
<#-- @ftlvariable name="requestContentLength" type="java.lang.Long" -->
<#-- @ftlvariable name="responseContentLength" type="java.lang.Long" -->

{ "index" : { "_index" : "${index}", "_id" : "${metrics.getRequestId()}"<#if pipeline??>, "pipeline" : "${pipeline}"} }
<@compress single_line=true>
{
  "gateway":"${gateway}"
  ,"@timestamp":"${@timestamp}"
  ,"request-id":"${metrics.getRequestId()}"
  <#if metrics.getClientIdentifier()??>
  ,"client-identifier":"${metrics.getClientIdentifier()}"
  
  ,"transaction-id":"${metrics.getTransactionId()}"
  <#if metrics.getApiId()??>
  ,"api-id":"${metrics.getApiId()}"
  
  <#if metrics.getPlanId()??>
  ,"plan-id":"${metrics.getPlanId()}"
  
  <#if metrics.getApplicationId()??>
  ,"application-id":"${metrics.getApplicationId()}"
  
  <#if metrics.getSubscriptionId()??>
  ,"subscription-id":"${metrics.getSubscriptionId()}"
  
  <#if metrics.getTenant()??>
  ,"tenant":"${metrics.getTenant()}"
  
  <#if metrics.getZone()??>
  ,"zone":"${metrics.getZone()}"
  
  <#if metrics.getHttpMethod()??>
  ,"http-method":${metrics.getHttpMethod().code()?c}
  
  <#if metrics.getLocalAddress()??>
  ,"local-address":"${metrics.getLocalAddress()}"
  
  <#if metrics.getRemoteAddress()??>
  ,"remote-address":"${metrics.getRemoteAddress()}"
  
  <#if metrics.getHost()??>
  ,"host":"${metrics.getHost()}"
  
  <#if metrics.getUri()??>
  ,"uri":"${metrics.getUri()}"
  
  <#if metrics.getPathInfo()??>
  ,"path-info":"${metrics.getPathInfo()}"
  
  <#if metrics.getMappedPath()??>
  ,"mapped-path":"${metrics.getMappedPath()}"
  
  <#if metrics.getUserAgent()?? && pipeline?has_content>
  ,"user-agent":"${metrics.getUserAgent()?j_string}"
  <#else>
  ,"user-agent":""
  
  <#if requestContentLength??>
  ,"request-content-length":${requestContentLength}
  
  ,"request-ended":"${metrics.isRequestEnded()?c}"
  <#if metrics.getEndpoint()??>
  ,"endpoint":"${metrics.getEndpoint()}"
  
  <#if endpointResponseTimeMs??>
  ,"endpoint-response-time-ms":${endpointResponseTimeMs}
  
  <#if metrics.getStatus()??>
  ,"status":${metrics.getStatus()}
  
  <#if responseContentLength??>
  ,"response-content-length":${responseContentLength}
  
  <#if gatewayResponseTimeMs??>
  ,"gateway-response-time-ms":${gatewayResponseTimeMs}
  
  <#if gatewayLatencyMs??>
  ,"gateway-latency-ms":${gatewayLatencyMs}
  
  <#if metrics.getUser()??>
  ,"user":"${metrics.getUser()}"
  
  <#if metrics.getSecurityType()??>
  ,"security-type":"${metrics.getSecurityType()}"
  
  <#if metrics.getSecurityToken()??>
  ,"security-token":"${metrics.getSecurityToken()}"
  
  <#if metrics.getErrorMessage()??>
  ,"error-message":"${metrics.getErrorMessage()?j_string}"
  
  <#if metrics.getErrorKey()??>
  ,"error-key":"${metrics.getErrorKey()}"
  
  <#if metrics.getCustomMetrics()??>
  ,"custom": {
  <#list metrics.getCustomMetrics() as propKey, propValue>
    "${propKey}":"${propValue}"<#sep>,
  
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy