MetricListingRep
February 28, 2026 ยท View on GitHub
Example Usage
import { MetricListingRep } from "@launchdarkly/mcp-server/models/components";
let value: MetricListingRep = {
experimentCount: 0,
metricGroupCount: 0,
activeExperimentCount: 2,
activeGuardedRolloutCount: 1,
id: "5902deadbeef667524a01290",
versionId: "version-id-123abc",
version: 1,
key: "metric-key-123abc",
name: "My metric",
kind: "custom",
attachedFlagCount: 0,
links: {
"parent": {
href: "/api/v2/metrics/my-project",
type: "application/json",
},
"self": {
href: "/api/v2/metrics/my-project/my-metric",
type: "application/json",
},
},
access: {
denied: [],
allowed: [],
},
tags: [],
creationDate: 68842,
lastModified: {
date: new Date("2021-08-05T19:46:31.148082Z"),
},
maintainerId: "569fdeadbeef1644facecafe",
maintainer: {
links: {
"self": {
href: "/api/v2/members/569f183514f4432160000007",
type: "application/json",
},
},
id: "569f183514f4432160000007",
firstName: "Ariel",
lastName: "Flores",
role: "admin",
email: "ariel@acme.com",
},
category: "Error monitoring",
isNumeric: true,
eventKey: "Order placed",
randomizationUnits: [
"user",
],
filters: {
type: "contextAttribute",
attribute: "country",
op: "<value>",
values: [
"JP",
],
contextKind: "user",
negate: false,
},
unitAggregationType: "average",
analysisType: "mean",
percentileValue: 95,
eventDefault: {
value: 0,
},
dataSource: {
key: "<key>",
},
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
experimentCount | number | :heavy_minus_sign: | The number of experiments using this metric | 0 |
metricGroupCount | number | :heavy_minus_sign: | The number of metric groups using this metric | 0 |
activeExperimentCount | number | :heavy_minus_sign: | The number of active experiments using this metric | 2 |
activeGuardedRolloutCount | number | :heavy_minus_sign: | The number of active guarded rollouts using this metric | 1 |
id | string | :heavy_check_mark: | The ID of this metric | 5902deadbeef667524a01290 |
versionId | string | :heavy_check_mark: | The version ID of the metric | version-id-123abc |
version | number | :heavy_minus_sign: | Version of the metric | 1 |
key | string | :heavy_check_mark: | A unique key to reference the metric | metric-key-123abc |
name | string | :heavy_check_mark: | A human-friendly name for the metric | My metric |
kind | components.MetricListingRepKind | :heavy_check_mark: | The kind of event the metric tracks | custom |
attachedFlagCount | number | :heavy_minus_sign: | The number of feature flags currently attached to this metric | 0 |
links | Record<string, components.Link> | :heavy_check_mark: | The location and content type of related resources | { "parent": { "href": "/api/v2/metrics/my-project", "type": "application/json" }, "self": { "href": "/api/v2/metrics/my-project/my-metric", "type": "application/json" } } |
site | components.Link | :heavy_minus_sign: | N/A | |
access | components.Access | :heavy_minus_sign: | N/A | |
tags | string[] | :heavy_check_mark: | Tags for the metric | [] |
creationDate | number | :heavy_check_mark: | N/A | |
lastModified | components.Modification | :heavy_minus_sign: | N/A | |
maintainerId | string | :heavy_minus_sign: | The ID of the member who maintains this metric | 569fdeadbeef1644facecafe |
maintainer | components.MemberSummary | :heavy_minus_sign: | N/A | |
description | string | :heavy_minus_sign: | Description of the metric | |
category | string | :heavy_minus_sign: | The category of the metric | Error monitoring |
isNumeric | boolean | :heavy_minus_sign: | For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false). | true |
successCriteria | components.MetricListingRepSuccessCriteria | :heavy_minus_sign: | For custom metrics, the success criteria | |
unit | string | :heavy_minus_sign: | For numeric custom metrics, the unit of measure | |
eventKey | string | :heavy_minus_sign: | For custom metrics, the event key to use in your code | Order placed |
randomizationUnits | string[] | :heavy_minus_sign: | An array of randomization units allowed for this metric | [ "user" ] |
filters | components.Filter | :heavy_minus_sign: | N/A | |
unitAggregationType | components.MetricListingRepUnitAggregationType | :heavy_minus_sign: | The method by which multiple unit event values are aggregated | average |
analysisType | components.MetricListingRepAnalysisType | :heavy_minus_sign: | The method for analyzing metric events | mean |
percentileValue | number | :heavy_minus_sign: | The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile. | 95 |
eventDefault | components.MetricEventDefaultRep | :heavy_minus_sign: | N/A | |
dataSource | components.MetricDataSourceRefRep | :heavy_check_mark: | N/A | |
lastSeen | number | :heavy_minus_sign: | N/A | |
archived | boolean | :heavy_minus_sign: | Whether the metric version is archived | |
archivedAt | number | :heavy_minus_sign: | N/A | |
selector | string | :heavy_minus_sign: | For click metrics, the CSS selectors | |
urls | Record<string, any>[] | :heavy_minus_sign: | N/A |