Metrics, Billing & Quotas

Readme Metrics

Readme (readme.com) is a developer Documentation and metrics service. This policy pushes the request/response data to their ingestion endpoint so you can see your Zuplo API traffic in their API calls dashboard.

Readme API Calls Dashboard

Configuration#

{
  "name": "my-readme-metrics-inbound-policy",
  "policyType": "readme-metrics-inbound",
  "handler": {
    "module": "$import(@zuplo/runtime)",
    "export": "ReadmeMetricsInboundPolicy",
    "options": {
      "apiKey": "YOUR_API_KEY",
      "userLabelPropertyPath": ".sub",
      "development": true,
      "useFullRequestPath": false
    }
  }
}

Options#

  • name the name of your policy instance. This is used as a reference in your routes.
  • policyType the identifier of the policy. This is used by the Zuplo UI. Value should be readme-metrics-inbound.
  • handler/export The name of the exported type. Value should be ReadmeMetricsInboundPolicy.
  • handler/module the module containing the policy. Value should be $import(@zuplo/runtime).
  • handler/options The options for this policy:
    • apiKey

      The API key to use when sending metrics calls to Readme

    • userLabelPropertyPath

      Optional - defaults to '.sub'. This is the path to the property on request.user that contains the label you want to use. For example .data.accountNumber would read the request.user.data.accountNumber property.

    • userEmailPropertyPath

      Optional - defaults to empty. This is the path to the property on request.user that contains the e-mail of the user. For example .data.email would read the request.user.data.email property.

    • development

      Optional. Whether the data should be ingested as 'development' mode or not. Defaults to true for working-copy and false for all other environments.

    • useFullRequestPath

      Optional - defaults to false. When true, Zuplo sends the full request path (which might contain sensitive information). By default, we only send the route path which should not contain sensitive information.

    • url

      Optional, the URL to send metering events to (defaults to https://metrics.readme.io/request). This is useful for testing purposes.

Was this article helpful?

Do you have any questions?Contact us
Check out ourproduct changelog