이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Defining methods and metrics


An application plan sets limits and pricing rules for consumer access to your API. To enable enforcement of limits and rules, designate methods in your API for which to collect individual usage data or add metrics. Add a mapping rule to each designated method and each custom metric. The mapping rule specifies details about the usage data that you want to capture.

For more information about methods and metrics, see Designating methods and adding metrics for capturing usage details.

3.1. Adding methods to products and backends

Adding a method to a product or backend means that you are designating a method in your API for which you want to capture individual usage details. An application plan provides the ability to set a limit for each method that you add to a product or backend. The procedure for adding a method or metric to a product is similar to adding a method or metric to a backend.

Procedure

  1. Navigate to [Your_product_name] > Integration > Methods & Metrics or [Your_backend_name] > Methods & Metrics.
  2. Click New method.
  3. In the Friendly name field, enter a short description of the method. This name is displayed in different sections of the 3scale Admin Portal. The friendly name must be unique for the product.

    Important

    Be careful with changing the system name of the methods or deleting them. These changes can break your already deployed 3scale integration if there are mapping rules pointing to the previous system name of the method.

  4. In the System name field, enter the name of the method in your API to use to report the usage through the 3scale Service Management API. The system name must conform to these rules:

    • Unique in the product or backend
    • Contain only alphanumeric characters, underscore _, hyphen - or forward slash /
    • No spaces

    Otherwise, you are free to decide what the system name looks like. It can be the same as the endpoint (/status), or, for example, it can include the method and the path (GET_/status).

  5. Optional: In the Description field, enter a more detailed description of the method.
  6. Click Create Method.

Verification steps

  • Added methods are available in your application plans.

3.2. Adding metrics to products and backends

Adding a metric specifies a usage unit that you want to capture for all calls to your API. An application plan provides the ability to set a limit for each metric that you add to a product or backend. The procedure for adding a method or metric to a product is similar to adding a method or metric to a backend.

Procedure

  1. Navigate to [Your_product_name] > Integration > Methods & Metrics or [Your_backend_name] > Methods & Metrics.
  2. Click New metric.
  3. In the Friendly name field, enter a short description of the metric. This name is displayed in different sections of the 3scale Admin Portal. The friendly name must be unique for the product.

    Important

    Be careful with changing the system name of the metrics or deleting them. These changes can break your already deployed 3scale integration if there are mapping rules pointing to the previous system name of the metric.

  4. In the System name field, enter the name of the metric in your API to use to report the usage through the 3scale Service Management API. The system name must conform to these rules:

    • Unique in the product or backend
    • Contain only alphanumeric characters, underscore _, hyphen - or forward slash /
    • No spaces

    Otherwise, you are free to decide what the system name looks like.

  5. In the Unit field, enter the unit.

    • Use a singular noun, for example, hit. The singular will become plural in the analytics charts.
  6. Optional: In the Description field, enter a more detailed description of the metric.
  7. Click Create Metric.

Verification steps

  • Added metrics are available in your application plans.

3.3. Alternatives for importing methods and metrics

If your API has multiple endpoints, there are two ways to automatically designate methods and add metrics to 3scale products and backends:

3.4. Adding mapping rules to methods and metrics

Mapping rules are operations that are mapped to previously created methods and metrics in your products and backends.

Note

Mapping rules are required in your previously created methods, however, they are optional for metrics.

Procedure

  1. Navigate to [Your_product_name] > Integration > Mapping Rules.
  2. Click Add Mapping Rule.
  3. The Verb field is pre-populated with the HTTP method, GET, however you can select other options from the dropdown list.
  4. In the Pattern field, add a valid URL that starts with an forward slash /. The URL can be from a wildcard you specified inside curly brackets {}.
  5. In the Metric or Method to increment field, select from one of your previously created methods or metrics.
  6. The Increment by field is pre-populated with 1, however, change this to suit your own needs.
  7. Click the Create Mapping Rule button.

Verification steps

  • To verify your mapping rules, navigate to [Your_product_name] > Integration > Methods & Metrics. Each method and metric should have a check mark in the Mapped column.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동