Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics Policy : update the documentation with all available properties #680

Open
apoddany opened this issue Feb 3, 2022 · 0 comments
Open

Comments

@apoddany
Copy link
Contributor

apoddany commented Feb 3, 2022

<#assign metrics = request.getMetrics() >
<#assign log = metrics.getLog()! >
{
  "requestId" : "${metrics.getRequestId()!}",
  "transactionId":"${metrics.getTransactionId()!}",
  "api":"${metrics.getApi()!}",
  "application":"${metrics.getApplication()!}",
  "plan":"${metrics.getPlan()!}",
  "subscription":"${metrics.getSubscription()!}",
  "endpoint":"${metrics.getEndpoint()!}",
  "host":"${metrics.getHost()!}",
  "uri":"${metrics.getUri()!}",
  "httpMethod":"${metrics.getHttpMethod()!}",
  "path":"${metrics.getPath()!}",
  "mappedPath":"${metrics.getMappedPath()!}",
  "userAgent":"${metrics.getUserAgent()!}",
  "localAddress":"${metrics.getLocalAddress()!}",
  "remoteAddress":"${metrics.getRemoteAddress()!}",
  "requestContentLength":"${metrics.getRequestContentLength()!}",
  "responseContentLength":"${metrics.getResponseContentLength()!}",
  "apiResponseTimeMs":"${metrics.getApiResponseTimeMs()!}",
  "proxyResponseTimeMs":"${metrics.getProxyResponseTimeMs()!}",
  "proxyLatencyMs":"${metrics.getProxyLatencyMs()!}",
  "status":"${metrics.getStatus()!}",
  "message":"${metrics.getMessage()!}",
  "errorKey":"${metrics.getErrorKey()!}",
  "user":"${metrics.getUser()!}",
  "securityType":"${metrics.getSecurityType()!}",
  "securityToken":"${metrics.getSecurityToken()!}",
  "tenant":"${metrics.getTenant()!}",
  "zone":"${metrics.getZone()!}"
  <#if (log.getClientRequest())??>
  ,"client-request": {
  "method":"${log.getClientRequest().getMethod()}",
  "uri":"${log.getClientRequest().getUri()}"
    <#if log.getClientRequest().getBody()??>
    ,"body":"${log.getClientRequest().getBody()?j_string}"
    </#if>
    <#if log.getClientRequest().getHeaders()??>
    ,"headers":{
      <#list log.getClientRequest().getHeaders().names() as header>
      "${header}": [
        <#list log.getClientRequest().getHeaders().getAll(header) as value>
          <#if value??>
            "${value?j_string}"
            <#sep>,</#sep>
          </#if>
        </#list>
      ]
        <#sep>,</#sep>
      </#list>
    }
    </#if>
  }
  ,"client-response": {
  "status":${log.getClientResponse().getStatus()}
    <#if log.getClientResponse().getBody()??>
    ,"body":"${log.getClientResponse().getBody()?j_string}"
    </#if>
    <#if log.getClientResponse().getHeaders()??>
    ,"headers":{
      <#list log.getClientResponse().getHeaders().names() as header>
      "${header}": [
        <#list log.getClientResponse().getHeaders().getAll(header) as value>
          <#if value??>
            "${value?j_string}"
            <#sep>,</#sep>
          </#if>
        </#list>
      ]
        <#sep>,</#sep>
      </#list>
    }
    </#if>
  }
  </#if>
  <#if (log.getProxyRequest())??>
    <#if log.getClientRequest()??>,</#if>
  "proxy-request": {
  "method":"${log.getProxyRequest().getMethod()}",
  "uri":"${log.getProxyRequest().getUri()}"
    <#if log.getProxyRequest().getBody()??>
    ,"body":"${log.getProxyRequest().getBody()?j_string}"
    </#if>
    <#if log.getProxyRequest().getHeaders()??>
    ,"headers":{
      <#list log.getProxyRequest().getHeaders().names() as header>
      "${header}": [
        <#list log.getProxyRequest().getHeaders().getAll(header) as value>
          <#if value??>
          "${value?j_string}"
            <#sep>,</#sep>
          </#if>
        </#list>
      ]
        <#sep>,</#sep>
      </#list>
    }
    </#if>
  }
  </#if>
  <#if (log.getProxyResponse())??>
  ,"proxy-response": {
  "status":${log.getProxyResponse().getStatus()}
    <#if log.getProxyResponse().getBody()??>
    ,"body":"${log.getProxyResponse().getBody()?j_string}"
    </#if>
    <#if log.getProxyResponse().getHeaders()??>
    ,"headers":{
      <#list log.getProxyResponse().getHeaders().names() as header>
      "${header}": [
        <#list log.getProxyResponse().getHeaders().getAll(header) as value>
          <#if value??>
          "${value?j_string}"
            <#sep>,</#sep>
          </#if>
        </#list>
      ]
        <#sep>,</#sep>
      </#list>
    }
    </#if>
  }
  </#if>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant