返回单个命名空间的所有 Atlas Search 索引指标
返回指定进程中一个命名空间在指定时间范围内的 Atlas Search 索引指标。
路径参数
-
为 MongoDB 进程提供服务的主机名和 IANA 端口的组合。主机必须是运行 MongoDB 进程(mongod 或 mongos)的主机的主机名、完全限定域名 (FQDN) 或 Internet 协议地址(IPv4 或 IPv6)。该端口必须是 MongoDB 进程侦听请求的 IANA 端口。
格式应符合以下模式:
^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$
。 -
用于标识数据库的人类可读标签。
-
用于标识集合的用户可读标签。
-
用于标识项目的唯一 24-十六进制数字字符串。 使用 /groups 端点检索身份验证的用户有权访问权限的所有项目。
注意:群组和项目是同义词。您的群组 ID 与项目 ID 相同。对于现有群组,群组/项目 ID 保持不变。资源和相应的端点使用“群组”一词。
格式应符合以下模式:
^([a-f0-9]{24})$
。
查询参数
-
持续时间,用于指定 Atlas 报告指标的时间间隔。此参数以 UTC 格式的 ISO 8601 持续时间格式表示其值。
-
Atlas 报告指标的持续时间。此参数以 UTC 格式的 ISO 8601 持续时间格式表示其值。在未设置开始和结束时包含此参数。
-
MongoDB Cloud 开始报告指标的日期和时间。此参数以 UTC 格式的 ISO 8601 时间戳表示其值。未设置周期时,请包含此参数。
-
MongoDB Cloud 停止报告指标的日期和时间。此参数以 UTC 格式的 ISO 8601 时间戳表示其值。未设置周期时,请包含此参数。
-
指示应用程序是否将响应包装在
envelope
JSON 对象中的标志。某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,请在查询中设置 Envelope=true。返回结果列表的端点将结果对象用作 envelope。应用程序将状态参数添加到响应正文中。默认值为
false
。 -
包含 MongoDB Atlas 报告的关联数据系列的测量值的列表。
不超过
10
个元素。取值为INDEX_SIZE_ON_DISK
、NUMBER_OF_DELETES
、NUMBER_OF_ERROR_QUERIES
、NUMBER_OF_GETMORE_COMMANDS
、NUMBER_OF_INDEX_FIELDS
、NUMBER_OF_INSERTS
、NUMBER_OF_SUCCESS_QUERIES
、NUMBER_OF_UPDATES
、REPLICATION_LAG
或TOTAL_NUMBER_OF_QUERIES
。
atlas api monitoringAndLogs listGroupHostFtsMetricIndexMeasurements --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20230101001/admin"
)
func main() {
ctx := context.Background()
clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.ListGroupHostFtsMetricIndexMeasurementsApiParams{}
sdkResp, httpResp, err := client.MonitoringandLogsApi.
ListGroupHostFtsMetricIndexMeasurementsWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2023-01-01+json" \
-X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/measurements?pretty=true"
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2023-01-01+json" \
-X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/measurements?pretty=true"
{
"collectionName": "string",
"databaseName": "string",
"end": "2025-05-04T09:42:00Z",
"granularity": "PT1M",
"groupId": "32b6e34b3d91647abb20e7b8",
"indexIds": [
"string"
],
"indexStatsMeasurements": [
{
"dataPoints": [
{
"timestamp": "2025-05-04T09:42:00Z",
"value": 42.0
}
],
"name": "string",
"units": "BYTES"
}
],
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"processId": "mongodb.example.com:27017",
"start": "2025-05-04T09:42:00Z"
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 429,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Too Many Requests",
"errorCode": "RATE_LIMITED"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}