Get metric

GET
/api/v2/metrics/:projectKey/:metricKey

Get information for a single metric from the specific project.

Expanding the metric response

LaunchDarkly supports four fields for expanding the “Get metric” response. By default, these fields are not included in the response.

To expand the response, append the expand query parameter and add a comma-separated list with any of the following fields:

  • experiments includes all experiments from the specific project that use the metric
  • experimentCount includes the number of experiments from the specific project that use the metric
  • metricGroups includes all metric groups from the specific project that use the metric
  • metricGroupCount includes the number of metric groups from the specific project that use the metric

For example, expand=experiments includes the experiments field in the response.

Path parameters

projectKeystringRequired

The project key

metricKeystringRequired

The metric key

Query parameters

expandstringOptional

A comma-separated list of properties that can reveal additional information in the response.

versionIdstringOptional

The specific version ID of the metric

Response

Metric response

_idstring

The ID of this metric

_versionIdstring

The version ID of the metric

keystring

A unique key to reference the metric

namestring

A human-friendly name for the metric

kindenum
Allowed values: pageviewclickcustom

The kind of event the metric tracks

tagslist of strings

Tags for the metric

_creationDatelong

Timestamp of when the metric was created

experimentCountintegerOptional

The number of experiments using this metric

metricGroupCountintegerOptional

The number of metric groups using this metric

_attachedFlagCountintegerOptional

The number of feature flags currently attached to this metric

_siteobjectOptional

Details on how to access the metric in the LaunchDarkly UI

_accessobjectOptional

Details on the allowed and denied actions for this metric

lastModifiedobjectOptional
maintainerIdstringOptional

The ID of the member who maintains this metric

_maintainerobjectOptional

Details on the member who maintains this metric

descriptionstringOptional

Description of the metric

categorystringOptional

The category of the metric

isNumericbooleanOptional

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).

successCriteriaenumOptional
Allowed values: HigherThanBaselineLowerThanBaseline

For custom metrics, the success criteria

unitstringOptional

For numeric custom metrics, the unit of measure

eventKeystringOptional

For custom metrics, the event key to use in your code

randomizationUnitslist of stringsOptional

An array of randomization units allowed for this metric

unitAggregationTypeenumOptional
Allowed values: averagesum

The method by which multiple unit event values are aggregated

analysisTypeenumOptional
Allowed values: meanpercentile

The method for analyzing metric events

percentileValueintegerOptional

The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile.

eventDefaultobjectOptional
experimentslist of objectsOptional

Experiments that use this metric, including those using a metric group that contains this metric

metricGroupslist of objectsOptional

Metric groups that use this metric

isActivebooleanOptional

Whether the metric is active

_attachedFeatureslist of objectsOptional

Details on the flags attached to this metric

_versionintegerOptional

Version of the metric

selectorstringOptional

For click metrics, the CSS selectors

urlslist of maps from strings to anyOptional

For click and pageview metrics, the target URLs

Errors

Built with