provider Metrics GET
/api/v2/metrics/{projectKey}/{metricKey} @utdk/launchdarkly
/api/v2/metrics/{projectKey}/{metricKey} 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.
- projectKey path required
- The project key
- string
- metricKey path required
- The metric key
- string
- expand query
- 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`.
- string
- versionId query
- The specific version ID of the metric
- string
Try it
Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import launchdarkly from '@utdk/launchdarkly';
await launchdarkly.getmetric()