GetAgentTraceSummary
client.Usage.GetAgentTraceSummary(ctx, body) (*UsageGetAgentTraceSummaryResponse, error)
POST/gitpod.v1.UsageService/GetAgentTraceSummary
Gets aggregated agent trace summary for the organization or a specific project.
Use this method to:
- Measure agent sessions and line changes
- Break down agent activity by model
- Scope agent trace insights to a project, user, or team
Example
dateRange:
startTime: "2024-01-01T00:00:00Z"
endTime: "2024-02-01T00:00:00Z"
projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"GetAgentTraceSummary
package main
import (
"context"
"fmt"
"time"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
"github.com/gitpod-io/gitpod-sdk-go/shared"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.Usage.GetAgentTraceSummary(context.TODO(), gitpod.UsageGetAgentTraceSummaryParams{
DateRange: gitpod.F(shared.DateRangeParam{
EndTime: gitpod.F(time.Now()),
StartTime: gitpod.F(time.Now()),
}),
ProjectID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Sparkline)
}
{
"sparkline": [
{
"time": "2019-12-27T18:11:19.117Z",
"value": 0
}
],
"summary": {
"byModel": [
{
"linesAdded": "linesAdded",
"linesRemoved": "linesRemoved",
"model": "SUPPORTED_MODEL_UNSPECIFIED",
"sessions": "sessions"
}
],
"totalLinesAdded": "totalLinesAdded",
"totalLinesAddedTrend": 0,
"totalLinesRemoved": "totalLinesRemoved",
"totalLinesRemovedTrend": 0,
"totalSessions": "totalSessions",
"totalSessionsTrend": 0
}
}Returns Examples
{
"sparkline": [
{
"time": "2019-12-27T18:11:19.117Z",
"value": 0
}
],
"summary": {
"byModel": [
{
"linesAdded": "linesAdded",
"linesRemoved": "linesRemoved",
"model": "SUPPORTED_MODEL_UNSPECIFIED",
"sessions": "sessions"
}
],
"totalLinesAdded": "totalLinesAdded",
"totalLinesAddedTrend": 0,
"totalLinesRemoved": "totalLinesRemoved",
"totalLinesRemovedTrend": 0,
"totalSessions": "totalSessions",
"totalSessionsTrend": 0
}
}