创建遥测目标
POST/v1/organizations/telemetry_destinations
为组织注册一个 OpenTelemetry 目标。
目标初始状态为 enabled。一个组织最多可拥有 10 个目标(包括已禁用的目标)。
请参阅 OpenTelemetry 导出指南,详细了解如何添加目标。
Parameters
Returns
创建遥测目标
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaTelemetryDestination, err := client.Beta.Organization.TelemetryDestinations.New(context.TODO(), anthropic.BetaOrganizationTelemetryDestinationNewParams{
EndpointURL: "x",
Workspaces: anthropic.BetaTelemetryDestinationWorkspacesParamsUnion{
OfAll: &anthropic.BetaTelemetryDestinationWorkspacesAllParams{},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaTelemetryDestination.ID)
}Response 200
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"delivery_health": {
"last_error": "last_error",
"last_error_at": "2019-12-27T18:11:19.117Z",
"last_success_at": "2019-12-27T18:11:19.117Z"
},
"display_name": "display_name",
"endpoint_url": "endpoint_url",
"header_names": [
"string"
],
"state": {
"type": "enabled"
},
"traces": {
"content_mode": "metadata_only",
"enabled": true,
"endpoint_url": "endpoint_url",
"max_content_bytes": 0
},
"type": "telemetry_destination",
"updated_at": "2019-12-27T18:11:19.117Z",
"workspaces": {
"type": "all"
}
}Returns Examples
Response 200
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"delivery_health": {
"last_error": "last_error",
"last_error_at": "2019-12-27T18:11:19.117Z",
"last_success_at": "2019-12-27T18:11:19.117Z"
},
"display_name": "display_name",
"endpoint_url": "endpoint_url",
"header_names": [
"string"
],
"state": {
"type": "enabled"
},
"traces": {
"content_mode": "metadata_only",
"enabled": true,
"endpoint_url": "endpoint_url",
"max_content_bytes": 0
},
"type": "telemetry_destination",
"updated_at": "2019-12-27T18:11:19.117Z",
"workspaces": {
"type": "all"
}
}