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
The project key
The project key
The metric key
The metric key
Query parameters
A comma-separated list of properties that can reveal additional information in the response. Supported fields are experiments, experimentCount, metricGroups, metricGroupCount, eventSources, guardedRollouts, guardedRolloutCount, lastUsedInExperiment, and lastUsedInGuardedRollout.
A comma-separated list of properties that can reveal additional information in the response. Supported fields are experiments, experimentCount, metricGroups, metricGroupCount, eventSources, guardedRollouts, guardedRolloutCount, lastUsedInExperiment, and lastUsedInGuardedRollout.
The specific version ID of the metric
The specific version ID of the metric
Response
Metric response
Example response
{
"activeExperimentCount": 2,
"activeGuardedRolloutCount": 1,
"_id": "5902deadbeef667524a01290",
"_versionId": "version-id-123abc",
"_version": 1,
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"_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": [
{
"reason": {
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
}
],
"allowed": [
{
"reason": {
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
}
]
},
"tags": [],
"lastModified": {
"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",
"values": [
"JP"
],
"contextKind": "user"
},
"unitAggregationType": "average",
"analysisType": "mean",
"percentileValue": 95,
"experiments": [
{
"key": "experiment-key-123abc",
"name": "Example experiment",
"environmentId": "1234a56b7c89d012345e678f",
"environmentKey": "production",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/environments/my-environment/experiments/example-experiment",
"type": "application/json"
}
}
}
],
"metricGroups": [
{
"key": "metric-group-key-123abc",
"name": "My metric group",
"kind": "funnel",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/metric-groups/my-metric-group",
"type": "application/json"
}
}
}
],
"lastUsedInExperiment": {
"key": "experiment-key-123abc",
"name": "Example experiment",
"environmentId": "1234a56b7c89d012345e678f",
"environmentKey": "production",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/environments/my-environment/experiments/example-experiment",
"type": "application/json"
}
}
},
"lastUsedInGuardedRollout": {
"_id": "885ccadf-181b-4a9a-8414-7ad6f7ba2db0",
"flagKey": "my-flag",
"flagName": "My Flag",
"flagPurpose": "migration",
"environmentKey": "production",
"environmentName": "Production",
"status": "monitoring",
"_links": {
"self": {
"href": "/api/v2/projects/my-project/flags/my-flag/environments/production/measured-rollouts/885ccadf-181b-4a9a-8414-7ad6f7ba2db0",
"type": "application/json"
}
}
},
"isActive": true,
"_attachedFeatures": [
{
"name": "Example flag",
"key": "flag-key-123abc"
}
]
}