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

FieldTypeRequiredDescriptionExample
experimentCountnumber:heavy_minus_sign:The number of experiments using this metric0
metricGroupCountnumber:heavy_minus_sign:The number of metric groups using this metric0
activeExperimentCountnumber:heavy_minus_sign:The number of active experiments using this metric2
activeGuardedRolloutCountnumber:heavy_minus_sign:The number of active guarded rollouts using this metric1
idstring:heavy_check_mark:The ID of this metric5902deadbeef667524a01290
versionIdstring:heavy_check_mark:The version ID of the metricversion-id-123abc
versionnumber:heavy_minus_sign:Version of the metric1
keystring:heavy_check_mark:A unique key to reference the metricmetric-key-123abc
namestring:heavy_check_mark:A human-friendly name for the metricMy metric
kindcomponents.MetricListingRepKind:heavy_check_mark:The kind of event the metric trackscustom
attachedFlagCountnumber:heavy_minus_sign:The number of feature flags currently attached to this metric0
linksRecord<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"
}
}
sitecomponents.Link:heavy_minus_sign:N/A
accesscomponents.Access:heavy_minus_sign:N/A
tagsstring[]:heavy_check_mark:Tags for the metric[]
creationDatenumber:heavy_check_mark:N/A
lastModifiedcomponents.Modification:heavy_minus_sign:N/A
maintainerIdstring:heavy_minus_sign:The ID of the member who maintains this metric569fdeadbeef1644facecafe
maintainercomponents.MemberSummary:heavy_minus_sign:N/A
descriptionstring:heavy_minus_sign:Description of the metric
categorystring:heavy_minus_sign:The category of the metricError monitoring
isNumericboolean: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
successCriteriacomponents.MetricListingRepSuccessCriteria:heavy_minus_sign:For custom metrics, the success criteria
unitstring:heavy_minus_sign:For numeric custom metrics, the unit of measure
eventKeystring:heavy_minus_sign:For custom metrics, the event key to use in your codeOrder placed
randomizationUnitsstring[]:heavy_minus_sign:An array of randomization units allowed for this metric[
"user"
]
filterscomponents.Filter:heavy_minus_sign:N/A
unitAggregationTypecomponents.MetricListingRepUnitAggregationType:heavy_minus_sign:The method by which multiple unit event values are aggregatedaverage
analysisTypecomponents.MetricListingRepAnalysisType:heavy_minus_sign:The method for analyzing metric eventsmean
percentileValuenumber: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
eventDefaultcomponents.MetricEventDefaultRep:heavy_minus_sign:N/A
dataSourcecomponents.MetricDataSourceRefRep:heavy_check_mark:N/A
lastSeennumber:heavy_minus_sign:N/A
archivedboolean:heavy_minus_sign:Whether the metric version is archived
archivedAtnumber:heavy_minus_sign:N/A
selectorstring:heavy_minus_sign:For click metrics, the CSS selectors
urlsRecord<string, any>[]:heavy_minus_sign:N/A