provider Metrics (beta) GET
/api/v2/projects/{projectKey}/metric-groups @utdk/launchdarkly
/api/v2/projects/{projectKey}/metric-groups List metric groups
Get a list of all metric groups for the specified project.
### Expanding the metric groups response
This endpoint does not support response expansion.
Although the API accepts an `expand` query parameter for compatibility reasons, it does not currently modify the response. The parameter is reserved for future use.
### Filtering metric groups
The `filter` parameter supports the following operators: `contains`, `equals`, `anyOf`.
#### Supported fields and operators
You can only filter certain fields in metrics when using the `filter` parameter. Additionally, you can only filter some fields with certain operators.
When you search for metrics, the `filter` parameter supports the following fields and operators:
|<div style="width:120px">Field</div> |Description |Supported operators |
|---|---|---|
| `experimentStatus` | The experiment's status. One of `not_started`, `running`, `stopped`, `started`. | `equals` |
| `hasConnections` | Whether the metric group has connections to experiments or guarded rollouts. One of `true`, `false`. | `equals` |
| `kind` | The metric group kind. One of `funnel`, `standard`. | `equals` |
| `maintainerIds` | The metric maintainer IDs. | `anyOf` |
| `maintainerTeamKey` | The metric maintainer team key. | `equals` |
| `query` | A "fuzzy" search across metric group key and name. Supply a string or list of strings to the operator. | `equals` |
### Sorting metric groups
LaunchDarkly supports the following fields for sorting:
- `name` sorts by metric group name.
- `createdAt` sorts by the creation date of the metric group.
- `connectionCount` sorts by the number of connections to experiments the metric group has.
By default, the sort is in ascending order. Use `-` to sort in descending order. For example, `?sort=name` sorts the response by metric group name in ascending order, and `?sort=-name` sorts in descending order.
#### Sample query
`filter=experimentStatus equals 'not_started' and query equals 'metric name'`
- projectKey path required
- The project key
- string
- filter query
- Accepts filter by `experimentStatus`, `query`, `kind`, `hasConnections`, `maintainerIds`, and `maintainerTeamKey`. Example: `filter=experimentStatus equals 'running' and query equals 'test'`.
- string
- sort query
- A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.
- string
- expand query
- This parameter is reserved for future use and is not currently supported on this endpoint.
- string
- limit query
- The number of metric groups to return in the response. Defaults to 20. Maximum limit is 50.
- integer
- offset query
- Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.
- integer
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.getmetricgroups()