Using the Operational Metrics Policy

Learn how to collect numeric data relating to service request/response time and by contract, subject, and client region that can be visualized in charts using an Operational Metrics Policy, including a use case.

This policy is used with the Envision product and is installed as part of the Envision Console Extension Feature.

About Policies Managing Policies About Operational Policies

For information about using policies in the context of the developer portal, see Business Policies.

Supported Platforms: 8.0 and later

Table of Contents

  1. Introduction
  2. Configuration
  3. Use case: Generating a Chart from Operational Metrics Obtained from Service Operational Data

Introduction

The Operational Metrics Policy allows you to specify what operational metrics should be gathered. It differs from an auditing policy in that metrics are only numeric values that can be charted; they contain no information about the content of the message.

Instead of collecting all metrics, data capture can be performed at a more granular level to serve specific reporting requirements. For example, you might want to monitor where the maximum API traffic is coming from based on a service, organization, operation, license, binding type, and so forth to determine the best location for your data center. With this policy you can configure the collection of a specific metric type and can also filter the data capture based on a specific dimension.

Metrics

You can enable the collection of all or selected metrics types. Options include:

  • Collect All Metrics: Enables collection of all metrics types.
  • Collect Selected Metrics: Enables the collection of selected metrics types.

Supported metrics types include:

  • Numbers of Requests
  • Response Time
  • Downstream Response Time
  • Request Size
  • Response Size

Dimensions

You can enable the collection of all or selected dimensions. Options include:

  • Support All: Enables collection of all dimension types.
  • Support Selected Dimensions: Enables the collection of selected dimension types.

Supported dimension types include:

  • Client Region
  • Contract
  • Authenticated Subject: This option allows you to state whether or not you want the authenticated subject (User) to be audited. You then select the category of user to audit. Predefined categories include Consumer, End-User, and User Defined. If you choose User Defined, you can specify a custom category name, as shown below.

back to top

Configuration

For a complete walk-through tutorial on adding and configuring an Operational Metrics Policy, generating audit and log data for a virtual service, and using this data in the Envision Console to generate a variety of different charts, refer to Use case: Generating a Chart from Operational Metrics Obtained from Service Operational Data below.

back to top

Use case: Generating a Chart from Operational Metrics Obtained from Service Operational Data

The following use case illustrates how to generate a chart from Operational Metrics obtained from Service Operational Data.

Configuration

  1. Perform the Policy Manager / Envision Integration Installation. At the end of this process you will have configured Envision, Policy Manager, and Network Director container instances. This process also includes using Add Container in the Policy Manager Management Console to register the Network Director container.
  2. Launch the Akana Administration Console for the Network Director container instance, and change the following configuration properties via the Configuration tab:
    1. com.soa.metrics: metrics.rollup.reporter.requireMetricsPolicy set to true.

      Changing the metrics rollup configuration

    2. com.soa.monitor.usage: set values as shown below.

      Changeing the monitor usage configuration

  3. Restart the Network Director container instance.
  4. Launch the Policy Manager Management Console and create a physical service using the file at this URL: http://petstore.swagger.io/v2/swagger.json.
  5. Select Virtualize Service, and virtualize the physical service in the Network Director container.
  6. Go to Policies > Operational and use Add Policy to create an Operational Metrics Policy and configure it based on the illustration below.

    Adding the Operational Metrics policy

  7. Attach a Detailed Auditing Policy (found in the root Policies folder) and an Operational Metrics Policy to the virtual service.
  8. Send requests to the virtual service.

    Send requests to the virtual service

  9. View the usage logs for the service.

    Viewing the usage logs

    Usage data details

  10. View the recorded logs in MongoDB in the AUDIT_LOG collection.

    Viewing the logs in MongoDB

  11. METRICDATASEC should be aggregating the logs per second. To see this, view the following collections: API Operational Metric Data Set, API Contract Metric Data Set, and API User Metric Data Set.

    Viewing the User Metric data set

    Viewing the Operational Metric data set

    Viewing the Contract Metric data set

  12. METRICDATAMIN should be aggregating the logs per minute on the basis of METRICDATASEC. To see this, view the following collections: API Operational Metric Data Set, API Contract Metric Data Set, and API User Metric Data Set.
  13. Send requests to various operations.

    Sending requests to generate data

  14. View the usage logs in MongoDB. The logs should contain the fields and information as per the Operational policy configuration made above

    Viewing the usage logs in MongoDB

  15. Launch the Envision Console and make a chart using the collections API Operational Metric Data Set, API Contract Metric Data Set, and API User Metric Data Set. The charts should show appropriate data:
    • API Operational Metric Data Set

      Making a chart in Envision

      Chart axis properties

      Chart preview

  16. In the same way, verify charts for the API Contract Metric Data Set and API User Metric Data Set.

Back to top