Hierarchy

  • MetricsApi

Constructors

Properties

configuration: Configuration
requestFactory: MetricsApiRequestFactory
responseProcessor: MetricsApiResponseProcessor

Methods

  • Create a tag indexing rule for the org. rule_order is assigned server-side as max+1 among existing rules; use the reorder endpoint to change the evaluation order. Every rule that matches a metric applies, in rule_order; a rule with override_previous_rules set to false (merge) adds to the tags configured by earlier rules, and a rule with override_previous_rules set to true replaces them. Requires the Manage Tags for Metrics permission.

    Limits:

    • An org can have at most 1,000 active tag indexing rules. Creating a rule when the org already has 1,000 active rules returns a 403 error with the title Tag indexing rule limit reached.
    • Tag indexing rules are unavailable for orgs with more than 700,000 custom metrics; requests from those orgs return a 403 error with the title Tag indexing rules unavailable.
    • name can be at most 200 characters, and metric_name_matches can contain at most 50 patterns of at most 200 characters each. Requests that exceed these limits return a 400 error.

    Parameters

    Returns Promise<TagIndexingRuleResponse>

  • Get a list of actively reporting metrics for your organization, with optional volumes, query activity, and tag configuration filters. When you need volumes, query activity, or tag configuration status for many metrics, use this endpoint instead of calling per-metric endpoints (such as GET /api/v2/metrics/{metric_name}/volumes or GET /api/v2/metrics/{metric_name}/tags) in a loop, which is slower and quickly reaches rate limits. This endpoint does not return the tag keys or values that a metric was submitted with.

    Always paginate: send page[size] (up to 10000; a few hundred to a few thousand is typical) and follow meta.pagination.next_cursor (or links.next) until it is null or missing. Without page[size] or page[cursor], the response is not paginated: it returns matching metrics in one response, with no pagination metadata, up to a limit of 250,000 metrics by default (some organizations have a different limit). Metrics beyond the limit are left out without any indication. Unpaginated requests in large organizations can also be slow or time out, and clients with response-size limits may fail or truncate the response. If a request with page[cursor] returns 410 Gone, the cursor has expired: restart from the first page (send page[size] without page[cursor]).

    • Volumes: include=metric_volumes adds the indexed and ingested volume of each metric. The volume is a fixed one-hour value and is not affected by window[seconds]. Volumes are not returned inside data: each metric with volume data has a relationships.metric_volumes.data reference, and the volumes themselves are returned as metric_volumes resources in the top-level included array. To join them, match included[].id to the id of data[] items with type metrics; both are the metric name. manage_tags items in data repeat the same id, so skip them when joining. Metrics without volume data, such as standard (non-custom) metrics, have no metric_volumes reference or entry.
    • Top metrics by volume: sort=-metric_volumes.indexed_volume together with include=metric_volumes and page[size] (for example, page[size]=20) returns the metrics with the highest indexed volume first. Sorting requires a paginated request.
    • Volume for a family of metrics: filter[metrics.id]=http.request* with include=metric_volumes and page[size] returns volumes for every metric whose name starts with http.request (a value whose only * is at the end is case-sensitive). A value without * matches names that contain it, ignoring case.
    • Unqueried metrics: filter[queried]=false with filter[queried][window][seconds] (for example, 2592000 for 30 days) and page[size] returns metrics that were not queried in that window.
    • Metrics without a tag configuration: filter[configured]=false with page[size] returns custom metrics that have no Metrics without Limits™ tag configuration.
    • Metric types: if filter[metric_type] is omitted, metrics of all types are returned.

    Examples:

    • Top 20 metrics by indexed volume: GET /api/v2/metrics?include=metric_volumes&sort=-metric_volumes.indexed_volume&page[size]=20
    • Metrics not queried in the last 30 days, with their volumes: GET /api/v2/metrics?filter[queried]=false&filter[queried][window][seconds]=2592000&include=metric_volumes&page[size]=1000
    • Metrics without a tag configuration: GET /api/v2/metrics?filter[configured]=false&page[size]=1000
    • Volumes for metrics whose name starts with http.request: GET /api/v2/metrics?filter[metrics.id]=http.request*&include=metric_volumes&page[size]=1000

    Query parameters use bracket notation (for example, filter[tags], filter[queried][window][seconds]). Pass them as standard URL query strings, URL-encoding the brackets if your client does not handle them. For example: GET /api/v2/metrics?filter[tags]=env:prod&window[seconds]=86400&page[size]=500.

    Parameters

    Returns Promise<MetricsAndMetricTagConfigurationsResponse>

Generated using TypeDoc