Docs Menu
Docs Home
/
MongoDB Atlas
/ / /

Return the Latest Targets for Prometheus

On this page

  • Syntax
  • Request Path Parameters
  • Request Query Parameters
  • Request Body Parameters
  • Response
  • Response Document
  • labels Embedded Document
  • Example Request
  • Example Response

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

GET /groups/{GROUP-ID}/discovery
Parameter
Required/Optional
Description

{GROUP-ID}

Required

Project identifier.

Name
Type
Necessity
Description
Default

targetScheme

TargetScheme

Optional

Type of targets to return. Values include:

  • PUBLIC: Public internet accessible targets.

  • PRIVATE: Private IP for VPC peering compatible targets.

PUBLIC

This endpoint doesn't use HTTP request body parameters.

The response JSON document includes an array of your latest targets from which to scrape and a document containing their labels.

Name
Type
Description

targets

array of objects

Each host and port from which to scrape metrics.

labels

document

Document that contains the label and value that differentiates your metrics.

Label
Description

availability_zone

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 availabilityZone values for each cloud provider, see the AWS, GCP, or Azure documentation.

cl_name

Label that uniquely identifies the cluster.

group_id

Unique hexadecimal digit string that identifies the project.

group_name

Label that uniquely identifies the project.

node_type

Node type.

Possible values are ELECTABLE, READ_ONLY, and ANALYTICS.

For more information, see Node Types.

org_id

Unique hexadecimal digit string that identifies the organization.

provider

Cloud provider on which the node is provisioned.

Possible values are AWS, GCP, and AZURE.

region

Cloud region in which the node resides.

For a complete list of possible region values, see the AWS, GCP, or Azure reference page.

replica_set_name

Label that uniquely identifies the replica set.

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"
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]

Back

More API Resources