Get metric

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

Headers

AuthorizationstringRequired

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
The kind of event the metric tracks
Allowed values:
tagslist of strings
Tags for the metric
_creationDatelong
Timestamp of when the metric was created
experimentCountinteger or null
The number of experiments using this metric
metricGroupCountinteger or null
The number of metric groups using this metric
_attachedFlagCountinteger or null
The number of feature flags currently attached to this metric
_siteobject or null
Details on how to access the metric in the LaunchDarkly UI
_accessobject or null
Details on the allowed and denied actions for this metric
lastModifiedobject or null
maintainerIdstring or null
The ID of the member who maintains this metric
_maintainerobject or null
Details on the member who maintains this metric
descriptionstring or null
Description of the metric
categorystring or null
The category of the metric
isNumericboolean or null

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

successCriteriaenum or null
For custom metrics, the success criteria
Allowed values:
unitstring or null
For numeric custom metrics, the unit of measure
eventKeystring or null
For custom metrics, the event key to use in your code
randomizationUnitslist of strings or null
An array of randomization units allowed for this metric
filtersobject or null
The filters narrowing down the audience based on context attributes or event properties.
unitAggregationTypeenum or null
The method by which multiple unit event values are aggregated
Allowed values:
analysisTypeenum or null
The method for analyzing metric events
Allowed values:
percentileValueinteger or null

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

eventDefaultobject or null
experimentslist of objects or null
Experiments that use this metric, including those using a metric group that contains this metric
metricGroupslist of objects or null
Metric groups that use this metric
isActiveboolean or null
Whether the metric is active
_attachedFeatureslist of objects or null
Details on the flags attached to this metric
_versioninteger or null
Version of the metric
selectorstring or null
For click metrics, the CSS selectors
urlslist of maps from strings to any or null
For click and pageview metrics, the target URLs

Errors