Skip to content

Add unified metrics definition YAML file API endpoint

What does this MR do?

Part of #323548 (closed).

This adds GET /usage_data/metric_definitions API endpoint for unauthenticated users to get a unified YAML of all metric definitions. Relevant docs have been added to the Usage Ping guide.

Example response

❯ http gdk.test:3000/api/v4/usage_data/metric_definitions
HTTP/1.1 200 OK
Cache-Control: max-age=0, private, must-revalidate
Content-Type: application/yaml
Date: Thu, 25 Mar 2021 20:53:25 GMT
Etag: W/"f618ef6668089d6f81bf1070ce8cdf56"
Transfer-Encoding: chunked
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Gitlab-Feature-Category: usage_ping
X-Request-Id: 01F1NJKJSXPD0B3TT4AS36VTFP
X-Runtime: 0.091602
---
- key_path: redis_hll_counters.search.i_search_paid_monthly
  description: Calculated unique users to perform a search with a paid license enabled
    by month
  product_section: enablement
  product_stage: enablement
  product_group: group::global search
  product_category: global_search
  value_type: number
  status: data_available
  time_frame: 28d
  data_source: redis_hll
  distribution:
  - ee
  tier:
  - premium
  - ultimate
- key_path: search_unique_visits.i_search_advanced
  description: Calculated unique users to perform Advanced searches by week
  product_section: enablement
  product_stage: enablement
  product_group: group::global search
  product_category: global_search
  value_type: number
  status: data_available
  time_frame: all
  data_source: redis_hll
  distribution:
  - ee
  tier:
  - premium
  - ultimate
- (...)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #323548 (closed)

Edited by Piotr Skorupa

Merge request reports