Return the Latest Targets for Prometheus
On this page
Note
Groups and projects are synonymous terms. Your {GROUP-ID}
is the
same as your project ID. For existing groups, your group/project ID
remains the same. The resource and corresponding endpoints use the
term groups
.
https://cloud.mongodb.com/prometheus/v1.0
Syntax
GET /groups/{GROUP-ID}/discovery
Request Path Parameters
Parameter | Required/Optional | Description |
---|---|---|
| Required | Project identifier. |
Request Query Parameters
Name | Type | Necessity | Description | Default |
---|---|---|---|---|
targetScheme | TargetScheme | Optional | Type of targets to return. Values include:
|
|
Request Body Parameters
This endpoint doesn't use HTTP request body parameters.
Response
Response Document
The response JSON document includes an array of your latest targets from which to scrape and a document containing their labels.
Name | Type | Description |
---|---|---|
| array of objects | Each |
| document | Document that contains the label and value that differentiates your metrics. |
labels Embedded Document
Label | Description |
---|---|
| AWS availability zone ID, Google Cloud fully-qualified name for a zone, or Azure zone number. Azure supports availability zones only in a subset of regions. Atlas provides pre-defined availability zone tags for Azure only for regions that support availability zones. To learn more, see Microsoft Azure. For more information about the possible |
| Label that uniquely identifies the cluster. |
| Unique hexadecimal digit string that identifies the project. |
| Label that uniquely identifies the project. |
| Node type. Possible values are For more information, see Node Types. |
| Unique hexadecimal digit string that identifies the organization. |
| Cloud provider on which the node is provisioned. Possible values are |
| |
| Label that uniquely identifies the replica set. |
Example Request
curl --header 'Accept: application/json' Sets the `Authorization` header on every scrape request with the configured username and password. --user prom_user_618d48e05277a606ed2496fe:fSIMUngfTmOTVEB4 The URL that Prometheus fetches the targets from. --request GET "https://cloud.mongodb.com/prometheus/v1.0/groups/673f4ae24759b47bdd3a2e90/discovery"
Example Response
1 [ 2 { 3 "labels": { 4 "availability_zone": "use1-az4", 5 "cl_name": "Cluster012", 6 "group_id": "673f4ae24759b47bdd3a2e90", 7 "node_type": "ELECTABLE", 8 "org_id": "673cad5b6b921181d015e1de", 9 "provider": "AWS", 10 "region": "us-east-1" 11 }, 12 "targets": [ 13 "cluster012-shard-00-00.rffkz.mongodb-dev.net:27018" 14 ] 15 }, 16 { 17 "labels": { 18 "availability_zone": "use1-az6", 19 "cl_name": "Cluster012", 20 "group_id": "673f4ae24759b47bdd3a2e90", 21 "node_type": "ELECTABLE", 22 "org_id": "673cad5b6b921181d015e1de", 23 "provider": "AWS", 24 "region": "us-east-1" 25 }, 26 "targets": [ 27 "cluster012-shard-00-01.rffkz.mongodb-dev.net:27018" 28 ] 29 }, 30 { 31 "labels": { 32 "availability_zone": "use1-az1", 33 "cl_name": "Cluster012", 34 "group_id": "673f4ae24759b47bdd3a2e90", 35 "node_type": "ELECTABLE", 36 "org_id": "673cad5b6b921181d015e1de", 37 "provider": "AWS", 38 "region": "us-east-1" 39 }, 40 "targets": [ 41 "cluster012-shard-00-02.rffkz.mongodb-dev.net:27018" 42 ] 43 } 44 ]