存储项目级别的 OTLP 跟踪导出设置。身份验证秘密只被引用(headers_secret_ref);原始值从不被接受或存储。增加生成计数器,并将配置标记为待下游发送。项目范围由路由 ID 路径参数传递,组织来自该项目。
body
必需
类型化 JSON 配置
-
内容模式选择跨度内容日志校订。空表示仅允许元数据。
值为
metadata_only或full。 -
EgressMode 选择 span 的交付位置。空白表示仅限平台。
值为
platform_only、platform_and_customer_mirror或customer_only。 -
启用是一个指针,以便处理程序可以区分忽略的字段(nil,已拒绝)与明确的 false (有效的“禁用导出”请求)。
-
终结点是客户的 OTLP/HTTP 终结点。启用时必须。必须是 HTTPS,并且不得指向内部/回环地址(请参阅验证)。
最大长度为
2048。 -
头部包含预设所需的非秘密导出头部(例如:工作区 ID)。绝不可将秘密值放在这里 — 请使用 HeadersSecretRef。
-
HeadersSecretRef 是指向单个存储的认证秘密(通常是 API 密钥)的指针。它是一个引用 — 从不是秘密值。必须限定在调用者的项目(请参阅 Validate)。
最大长度为
512。 -
InsecureSkipVerify 关闭客户终结点的 TLS 验证。指针为 nil 状态(验证,默认)与明确选择关闭功能区别开来;用户界面将启用此功能显示为有意降低安全性的操作。
-
协议是出站 OTLP 协议。v1 仅支持 HTTP/protobuf。
值为
http/protobuf。 -
ResourceAttributes 是标记在发送到客户数终结点的每个跨度上的额外的 OTLP 资源属性(例如:目的地要求的项目/模型标识符)。给定的目标需要哪些密钥来自其预设(请参阅 pkg/traceexportconfig/presets);值始终由客户提供,因为它们通常命名目标自身侧的项目,而此平台无法查询该项目。
-
SamplingPolicy 选择在导出前应用的头采样器。
-
SecretHeaderName 是发送引用的密钥的值时所使用的标头名称(例如"api_key"),可以来自预设的 secret_header_keys,也可以由用户输入以用于自定义目标地。平台构建外发头部行“: ”,因此,存储的秘密始终是本身值(从不是预格式化的头部行)。当 HeadersSecretRef 设置时必需(请参阅 Validate)。
最大长度为
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
}