存储项目级 OTLP 跟踪导出设置。身份验证密钥仅被引用 (headers_secret_ref);原始值永远不会被接受或存储。增加生成计数器并将配置标记为待下游交付。项目范围由路由 ID 路径参数承载,而组织则派生自该项目。
body
必需
类型化JSON配置
-
ContentMode 选择跨度内容校订。空表示 metadata_only。
值为
metadata_only或full。 -
EgressMode 选择跨度的交付位置。空表示仅platform_only。
值为
platform_only、platform_and_customer_mirror或customer_only。 -
Enabled 是一个指针,因此处理程序可以区分省略的字段(nil、被拒绝)和显式 false(有效的“禁用导出”请求)。
-
端点是客户的 OTLP/ HTTP端点。启用后为必填项。必须是 https,并且不能点内部/环回解决(请参阅验证)。
最大长度为
2048。 -
标头包含预设所需的非秘密导出标头(例如工作区 ID)。切勿将密钥值放在此处 — 请使用 HeadersSecretRef。
-
HeadersSecretRef 是指向单个存储的身份验证密钥(通常是API密钥)的指针。它只是一个引用,而不是秘密值。必须将范围限定为调用者的项目(请参阅验证)。
最大长度为
512。 -
InsecureSkipVerify 禁用客户端点的 TLS 验证。指针 so nil(验证,默认)与显式选择退出不同;用户界面表面将其视为故意降低的安全性。
-
协议是出站 OTLP协议。 v1 仅支持 http/protobuf。
值为
http/protobuf。 -
ResourceAttributes 是额外的OTLP资源属性,印在发送到客户端点的每个范围上(例如,目标所需的项目/模型标识符)。给定目标所需的哪些密钥来自其预设(请参阅 pkg/traceexportconfig/presets);值始终由客户提供,因为它们通常命名目标端自己的项目,而该平台无法查找该项目。
-
SamplingPolicy 选择导出前应用的头部采样器。
-
SecretheaderName 是引用密钥的值作为发送的标头名称(例如“api_key”),可以从预设的 secret_header_keys 中获取或由用户为自定义目标输入。平台将出站“:”标题行,因此存储的密钥始终是裸值(而不是预先格式化的标题行)。设立HeadersSecretRef 时为必填项(请参阅验证)。
最大长度为
128。
curl \
--request PUT 'https://agentengine.mongodb.com/api/v1/projects/{id}/trace-export/config' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"content_mode": "metadata_only",
"egress_mode": "platform_only",
"enabled": true,
"endpoint": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"headers_secret_ref": "string",
"insecure_skip_verify": true,
"protocol": "http/protobuf",
"resource_attributes": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"sampling_policy": {
"ratio": 42.0,
"type": "always_on"
},
"secret_header_name": "string"
}'
{
"content_mode": "metadata_only",
"egress_mode": "platform_only",
"enabled": true,
"endpoint": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"headers_secret_ref": "string",
"insecure_skip_verify": true,
"protocol": "http/protobuf",
"resource_attributes": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"sampling_policy": {
"ratio": 42.0,
"type": "always_on"
},
"secret_header_name": "string"
}
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
"error": 406,
"errorCode": "UNACCEPTABLE_MEDIA_TYPE",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
"error": 406,
"errorCode": "UNSUPPORTED_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"generation": 42,
"updated_at": "string"
}
{
"generation": 42,
"updated_at": "string"
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}