@rustrak/client 0.14.3 → 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +108 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -1
- package/dist/index.d.ts +74 -1
- package/dist/index.js +108 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -121,24 +121,61 @@ declare const agentTraceSummarySchema: z.ZodObject<{
|
|
|
121
121
|
duration_ms: z.ZodNullable<z.ZodNumber>;
|
|
122
122
|
total_tokens: z.ZodNumber;
|
|
123
123
|
tool_call_count: z.ZodNumber;
|
|
124
|
+
llm_call_count: z.ZodNumber;
|
|
125
|
+
error_count: z.ZodNumber;
|
|
124
126
|
started_at: z.ZodString;
|
|
125
127
|
}, z.core.$strip>;
|
|
128
|
+
declare const agentSummarySchema: z.ZodObject<{
|
|
129
|
+
agent_runs: z.ZodNumber;
|
|
130
|
+
llm_calls: z.ZodNumber;
|
|
131
|
+
tool_calls: z.ZodNumber;
|
|
132
|
+
error_count: z.ZodNumber;
|
|
133
|
+
total_tokens: z.ZodNumber;
|
|
134
|
+
avg_duration_ms: z.ZodNumber;
|
|
135
|
+
p95_duration_ms: z.ZodNumber;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
declare const agentModelRowSchema: z.ZodObject<{
|
|
138
|
+
model: z.ZodString;
|
|
139
|
+
requests: z.ZodNumber;
|
|
140
|
+
errors: z.ZodNumber;
|
|
141
|
+
avg_ms: z.ZodNumber;
|
|
142
|
+
p95_ms: z.ZodNumber;
|
|
143
|
+
input_tokens: z.ZodNumber;
|
|
144
|
+
cached_input_tokens: z.ZodNumber;
|
|
145
|
+
output_tokens: z.ZodNumber;
|
|
146
|
+
reasoning_output_tokens: z.ZodNumber;
|
|
147
|
+
total_tokens: z.ZodNumber;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
declare const agentToolRowSchema: z.ZodObject<{
|
|
150
|
+
tool: z.ZodString;
|
|
151
|
+
calls: z.ZodNumber;
|
|
152
|
+
errors: z.ZodNumber;
|
|
153
|
+
avg_ms: z.ZodNumber;
|
|
154
|
+
p95_ms: z.ZodNumber;
|
|
155
|
+
}, z.core.$strip>;
|
|
126
156
|
|
|
127
157
|
type AgentTimeseriesPoint = z.infer<typeof agentTimeseriesPointSchema>;
|
|
128
158
|
type AgentDurationPoint = z.infer<typeof agentDurationPointSchema>;
|
|
129
159
|
type GenAiBreakdownRow = z.infer<typeof genAiBreakdownRowSchema>;
|
|
130
160
|
type AgentTraceSummary = z.infer<typeof agentTraceSummarySchema>;
|
|
161
|
+
type AgentSummary = z.infer<typeof agentSummarySchema>;
|
|
162
|
+
type AgentModelRow = z.infer<typeof agentModelRowSchema>;
|
|
163
|
+
type AgentToolRow = z.infer<typeof agentToolRowSchema>;
|
|
131
164
|
interface AgentTimeseriesOptions {
|
|
132
165
|
period_hours?: number;
|
|
133
166
|
interval_hours?: number;
|
|
167
|
+
environment?: string;
|
|
134
168
|
}
|
|
135
169
|
interface AgentBreakdownOptions {
|
|
136
170
|
period_hours?: number;
|
|
137
171
|
limit?: number;
|
|
172
|
+
environment?: string;
|
|
138
173
|
}
|
|
139
174
|
interface AgentTracesOptions {
|
|
140
175
|
page?: number;
|
|
141
176
|
per_page?: number;
|
|
177
|
+
period_hours?: number;
|
|
178
|
+
environment?: string;
|
|
142
179
|
}
|
|
143
180
|
|
|
144
181
|
declare const providerTypeSchema: z.ZodEnum<{
|
|
@@ -979,6 +1016,36 @@ declare const spanSchema: z.ZodObject<{
|
|
|
979
1016
|
gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
980
1017
|
gen_ai_usage_total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
981
1018
|
}, z.core.$strip>;
|
|
1019
|
+
declare const spanDetailSchema: z.ZodObject<{
|
|
1020
|
+
id: z.ZodString;
|
|
1021
|
+
transaction_id: z.ZodNullable<z.ZodString>;
|
|
1022
|
+
span_id: z.ZodNullable<z.ZodString>;
|
|
1023
|
+
trace_id: z.ZodNullable<z.ZodString>;
|
|
1024
|
+
parent_span_id: z.ZodNullable<z.ZodString>;
|
|
1025
|
+
op: z.ZodNullable<z.ZodString>;
|
|
1026
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1027
|
+
status: z.ZodNullable<z.ZodString>;
|
|
1028
|
+
start_timestamp: z.ZodNullable<z.ZodString>;
|
|
1029
|
+
timestamp: z.ZodNullable<z.ZodString>;
|
|
1030
|
+
duration_ms: z.ZodNullable<z.ZodNumber>;
|
|
1031
|
+
exclusive_time_ms: z.ZodNullable<z.ZodNumber>;
|
|
1032
|
+
is_segment: z.ZodBoolean;
|
|
1033
|
+
segment_id: z.ZodNullable<z.ZodString>;
|
|
1034
|
+
platform: z.ZodNullable<z.ZodString>;
|
|
1035
|
+
release: z.ZodNullable<z.ZodString>;
|
|
1036
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1037
|
+
gen_ai_operation_type: z.ZodNullable<z.ZodString>;
|
|
1038
|
+
gen_ai_agent_name: z.ZodNullable<z.ZodString>;
|
|
1039
|
+
gen_ai_request_model: z.ZodNullable<z.ZodString>;
|
|
1040
|
+
gen_ai_response_model: z.ZodNullable<z.ZodString>;
|
|
1041
|
+
gen_ai_tool_name: z.ZodNullable<z.ZodString>;
|
|
1042
|
+
gen_ai_conversation_id: z.ZodNullable<z.ZodString>;
|
|
1043
|
+
gen_ai_usage_input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
1044
|
+
gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
1045
|
+
gen_ai_usage_total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
1046
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
1047
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
1048
|
+
}, z.core.$strip>;
|
|
982
1049
|
declare const transactionStatsSchema: z.ZodObject<{
|
|
983
1050
|
transaction_name: z.ZodString;
|
|
984
1051
|
op: z.ZodNullable<z.ZodString>;
|
|
@@ -992,6 +1059,7 @@ declare const transactionStatsSchema: z.ZodObject<{
|
|
|
992
1059
|
type Transaction = z.infer<typeof transactionSchema>;
|
|
993
1060
|
type TransactionDetail = z.infer<typeof transactionDetailSchema>;
|
|
994
1061
|
type Span = z.infer<typeof spanSchema>;
|
|
1062
|
+
type SpanDetail = z.infer<typeof spanDetailSchema>;
|
|
995
1063
|
type TransactionStats = z.infer<typeof transactionStatsSchema>;
|
|
996
1064
|
interface ListSpansOptions {
|
|
997
1065
|
page?: number;
|
|
@@ -1078,6 +1146,10 @@ declare class AgentsResource extends BaseResource {
|
|
|
1078
1146
|
getModelsByTokens(projectId: number, options?: AgentBreakdownOptions): Promise<Result<GenAiBreakdownRow[], RustrakError>>;
|
|
1079
1147
|
getTools(projectId: number, options?: AgentBreakdownOptions): Promise<Result<GenAiBreakdownRow[], RustrakError>>;
|
|
1080
1148
|
getTraces(projectId: number, options?: AgentTracesOptions): Promise<Result<OffsetPaginatedResponse<AgentTraceSummary>, RustrakError>>;
|
|
1149
|
+
getSummary(projectId: number, options?: AgentBreakdownOptions): Promise<Result<AgentSummary, RustrakError>>;
|
|
1150
|
+
getModelsTable(projectId: number, options?: AgentBreakdownOptions): Promise<Result<AgentModelRow[], RustrakError>>;
|
|
1151
|
+
getToolsTable(projectId: number, options?: AgentBreakdownOptions): Promise<Result<AgentToolRow[], RustrakError>>;
|
|
1152
|
+
getEnvironments(projectId: number): Promise<Result<string[], RustrakError>>;
|
|
1081
1153
|
}
|
|
1082
1154
|
|
|
1083
1155
|
declare class AlertIntegrationsResource extends BaseResource {
|
|
@@ -1195,6 +1267,7 @@ declare class SourceMapsResource extends BaseResource {
|
|
|
1195
1267
|
|
|
1196
1268
|
declare class SpansResource extends BaseResource {
|
|
1197
1269
|
list(projectId: number, options?: ListSpansOptions): Promise<Result<OffsetPaginatedResponse<Span>, RustrakError>>;
|
|
1270
|
+
get(projectId: number, spanId: string): Promise<Result<SpanDetail, RustrakError>>;
|
|
1198
1271
|
}
|
|
1199
1272
|
|
|
1200
1273
|
declare class StatsResource extends BaseResource {
|
|
@@ -1260,4 +1333,4 @@ declare class RustrakClient {
|
|
|
1260
1333
|
constructor(config: ClientConfig);
|
|
1261
1334
|
}
|
|
1262
1335
|
|
|
1263
|
-
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentTraceSummary, type AgentTracesOptions, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, type BulkDeleteIssues, type BulkUpdateIssues, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, type LoginRequest, type LoginResult, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
|
1336
|
+
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentModelRow, type AgentSummary, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentToolRow, type AgentTraceSummary, type AgentTracesOptions, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, type BulkDeleteIssues, type BulkUpdateIssues, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, type LoginRequest, type LoginResult, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type SpanDetail, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
package/dist/index.d.ts
CHANGED
|
@@ -121,24 +121,61 @@ declare const agentTraceSummarySchema: z.ZodObject<{
|
|
|
121
121
|
duration_ms: z.ZodNullable<z.ZodNumber>;
|
|
122
122
|
total_tokens: z.ZodNumber;
|
|
123
123
|
tool_call_count: z.ZodNumber;
|
|
124
|
+
llm_call_count: z.ZodNumber;
|
|
125
|
+
error_count: z.ZodNumber;
|
|
124
126
|
started_at: z.ZodString;
|
|
125
127
|
}, z.core.$strip>;
|
|
128
|
+
declare const agentSummarySchema: z.ZodObject<{
|
|
129
|
+
agent_runs: z.ZodNumber;
|
|
130
|
+
llm_calls: z.ZodNumber;
|
|
131
|
+
tool_calls: z.ZodNumber;
|
|
132
|
+
error_count: z.ZodNumber;
|
|
133
|
+
total_tokens: z.ZodNumber;
|
|
134
|
+
avg_duration_ms: z.ZodNumber;
|
|
135
|
+
p95_duration_ms: z.ZodNumber;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
declare const agentModelRowSchema: z.ZodObject<{
|
|
138
|
+
model: z.ZodString;
|
|
139
|
+
requests: z.ZodNumber;
|
|
140
|
+
errors: z.ZodNumber;
|
|
141
|
+
avg_ms: z.ZodNumber;
|
|
142
|
+
p95_ms: z.ZodNumber;
|
|
143
|
+
input_tokens: z.ZodNumber;
|
|
144
|
+
cached_input_tokens: z.ZodNumber;
|
|
145
|
+
output_tokens: z.ZodNumber;
|
|
146
|
+
reasoning_output_tokens: z.ZodNumber;
|
|
147
|
+
total_tokens: z.ZodNumber;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
declare const agentToolRowSchema: z.ZodObject<{
|
|
150
|
+
tool: z.ZodString;
|
|
151
|
+
calls: z.ZodNumber;
|
|
152
|
+
errors: z.ZodNumber;
|
|
153
|
+
avg_ms: z.ZodNumber;
|
|
154
|
+
p95_ms: z.ZodNumber;
|
|
155
|
+
}, z.core.$strip>;
|
|
126
156
|
|
|
127
157
|
type AgentTimeseriesPoint = z.infer<typeof agentTimeseriesPointSchema>;
|
|
128
158
|
type AgentDurationPoint = z.infer<typeof agentDurationPointSchema>;
|
|
129
159
|
type GenAiBreakdownRow = z.infer<typeof genAiBreakdownRowSchema>;
|
|
130
160
|
type AgentTraceSummary = z.infer<typeof agentTraceSummarySchema>;
|
|
161
|
+
type AgentSummary = z.infer<typeof agentSummarySchema>;
|
|
162
|
+
type AgentModelRow = z.infer<typeof agentModelRowSchema>;
|
|
163
|
+
type AgentToolRow = z.infer<typeof agentToolRowSchema>;
|
|
131
164
|
interface AgentTimeseriesOptions {
|
|
132
165
|
period_hours?: number;
|
|
133
166
|
interval_hours?: number;
|
|
167
|
+
environment?: string;
|
|
134
168
|
}
|
|
135
169
|
interface AgentBreakdownOptions {
|
|
136
170
|
period_hours?: number;
|
|
137
171
|
limit?: number;
|
|
172
|
+
environment?: string;
|
|
138
173
|
}
|
|
139
174
|
interface AgentTracesOptions {
|
|
140
175
|
page?: number;
|
|
141
176
|
per_page?: number;
|
|
177
|
+
period_hours?: number;
|
|
178
|
+
environment?: string;
|
|
142
179
|
}
|
|
143
180
|
|
|
144
181
|
declare const providerTypeSchema: z.ZodEnum<{
|
|
@@ -979,6 +1016,36 @@ declare const spanSchema: z.ZodObject<{
|
|
|
979
1016
|
gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
980
1017
|
gen_ai_usage_total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
981
1018
|
}, z.core.$strip>;
|
|
1019
|
+
declare const spanDetailSchema: z.ZodObject<{
|
|
1020
|
+
id: z.ZodString;
|
|
1021
|
+
transaction_id: z.ZodNullable<z.ZodString>;
|
|
1022
|
+
span_id: z.ZodNullable<z.ZodString>;
|
|
1023
|
+
trace_id: z.ZodNullable<z.ZodString>;
|
|
1024
|
+
parent_span_id: z.ZodNullable<z.ZodString>;
|
|
1025
|
+
op: z.ZodNullable<z.ZodString>;
|
|
1026
|
+
description: z.ZodNullable<z.ZodString>;
|
|
1027
|
+
status: z.ZodNullable<z.ZodString>;
|
|
1028
|
+
start_timestamp: z.ZodNullable<z.ZodString>;
|
|
1029
|
+
timestamp: z.ZodNullable<z.ZodString>;
|
|
1030
|
+
duration_ms: z.ZodNullable<z.ZodNumber>;
|
|
1031
|
+
exclusive_time_ms: z.ZodNullable<z.ZodNumber>;
|
|
1032
|
+
is_segment: z.ZodBoolean;
|
|
1033
|
+
segment_id: z.ZodNullable<z.ZodString>;
|
|
1034
|
+
platform: z.ZodNullable<z.ZodString>;
|
|
1035
|
+
release: z.ZodNullable<z.ZodString>;
|
|
1036
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
1037
|
+
gen_ai_operation_type: z.ZodNullable<z.ZodString>;
|
|
1038
|
+
gen_ai_agent_name: z.ZodNullable<z.ZodString>;
|
|
1039
|
+
gen_ai_request_model: z.ZodNullable<z.ZodString>;
|
|
1040
|
+
gen_ai_response_model: z.ZodNullable<z.ZodString>;
|
|
1041
|
+
gen_ai_tool_name: z.ZodNullable<z.ZodString>;
|
|
1042
|
+
gen_ai_conversation_id: z.ZodNullable<z.ZodString>;
|
|
1043
|
+
gen_ai_usage_input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
1044
|
+
gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
1045
|
+
gen_ai_usage_total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
1046
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
1047
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
1048
|
+
}, z.core.$strip>;
|
|
982
1049
|
declare const transactionStatsSchema: z.ZodObject<{
|
|
983
1050
|
transaction_name: z.ZodString;
|
|
984
1051
|
op: z.ZodNullable<z.ZodString>;
|
|
@@ -992,6 +1059,7 @@ declare const transactionStatsSchema: z.ZodObject<{
|
|
|
992
1059
|
type Transaction = z.infer<typeof transactionSchema>;
|
|
993
1060
|
type TransactionDetail = z.infer<typeof transactionDetailSchema>;
|
|
994
1061
|
type Span = z.infer<typeof spanSchema>;
|
|
1062
|
+
type SpanDetail = z.infer<typeof spanDetailSchema>;
|
|
995
1063
|
type TransactionStats = z.infer<typeof transactionStatsSchema>;
|
|
996
1064
|
interface ListSpansOptions {
|
|
997
1065
|
page?: number;
|
|
@@ -1078,6 +1146,10 @@ declare class AgentsResource extends BaseResource {
|
|
|
1078
1146
|
getModelsByTokens(projectId: number, options?: AgentBreakdownOptions): Promise<Result<GenAiBreakdownRow[], RustrakError>>;
|
|
1079
1147
|
getTools(projectId: number, options?: AgentBreakdownOptions): Promise<Result<GenAiBreakdownRow[], RustrakError>>;
|
|
1080
1148
|
getTraces(projectId: number, options?: AgentTracesOptions): Promise<Result<OffsetPaginatedResponse<AgentTraceSummary>, RustrakError>>;
|
|
1149
|
+
getSummary(projectId: number, options?: AgentBreakdownOptions): Promise<Result<AgentSummary, RustrakError>>;
|
|
1150
|
+
getModelsTable(projectId: number, options?: AgentBreakdownOptions): Promise<Result<AgentModelRow[], RustrakError>>;
|
|
1151
|
+
getToolsTable(projectId: number, options?: AgentBreakdownOptions): Promise<Result<AgentToolRow[], RustrakError>>;
|
|
1152
|
+
getEnvironments(projectId: number): Promise<Result<string[], RustrakError>>;
|
|
1081
1153
|
}
|
|
1082
1154
|
|
|
1083
1155
|
declare class AlertIntegrationsResource extends BaseResource {
|
|
@@ -1195,6 +1267,7 @@ declare class SourceMapsResource extends BaseResource {
|
|
|
1195
1267
|
|
|
1196
1268
|
declare class SpansResource extends BaseResource {
|
|
1197
1269
|
list(projectId: number, options?: ListSpansOptions): Promise<Result<OffsetPaginatedResponse<Span>, RustrakError>>;
|
|
1270
|
+
get(projectId: number, spanId: string): Promise<Result<SpanDetail, RustrakError>>;
|
|
1198
1271
|
}
|
|
1199
1272
|
|
|
1200
1273
|
declare class StatsResource extends BaseResource {
|
|
@@ -1260,4 +1333,4 @@ declare class RustrakClient {
|
|
|
1260
1333
|
constructor(config: ClientConfig);
|
|
1261
1334
|
}
|
|
1262
1335
|
|
|
1263
|
-
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentTraceSummary, type AgentTracesOptions, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, type BulkDeleteIssues, type BulkUpdateIssues, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, type LoginRequest, type LoginResult, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
|
1336
|
+
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentModelRow, type AgentSummary, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentToolRow, type AgentTraceSummary, type AgentTracesOptions, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, type BulkDeleteIssues, type BulkUpdateIssues, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, type LoginRequest, type LoginResult, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type SpanDetail, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
package/dist/index.js
CHANGED
|
@@ -53,8 +53,40 @@ var agentTraceSummarySchema = z.object({
|
|
|
53
53
|
duration_ms: z.number().nullable(),
|
|
54
54
|
total_tokens: z.number(),
|
|
55
55
|
tool_call_count: z.number().int(),
|
|
56
|
+
/** `ai_client` spans: how many times a model was actually called. */
|
|
57
|
+
llm_call_count: z.number().int(),
|
|
58
|
+
/** AI spans in this trace whose status is set and not `ok`. */
|
|
59
|
+
error_count: z.number().int(),
|
|
56
60
|
started_at: dateTimeSchema
|
|
57
61
|
});
|
|
62
|
+
var agentSummarySchema = z.object({
|
|
63
|
+
agent_runs: z.number().int(),
|
|
64
|
+
llm_calls: z.number().int(),
|
|
65
|
+
tool_calls: z.number().int(),
|
|
66
|
+
error_count: z.number().int(),
|
|
67
|
+
total_tokens: z.number(),
|
|
68
|
+
avg_duration_ms: z.number(),
|
|
69
|
+
p95_duration_ms: z.number()
|
|
70
|
+
});
|
|
71
|
+
var agentModelRowSchema = z.object({
|
|
72
|
+
model: z.string(),
|
|
73
|
+
requests: z.number().int(),
|
|
74
|
+
errors: z.number().int(),
|
|
75
|
+
avg_ms: z.number(),
|
|
76
|
+
p95_ms: z.number(),
|
|
77
|
+
input_tokens: z.number(),
|
|
78
|
+
cached_input_tokens: z.number(),
|
|
79
|
+
output_tokens: z.number(),
|
|
80
|
+
reasoning_output_tokens: z.number(),
|
|
81
|
+
total_tokens: z.number()
|
|
82
|
+
});
|
|
83
|
+
var agentToolRowSchema = z.object({
|
|
84
|
+
tool: z.string(),
|
|
85
|
+
calls: z.number().int(),
|
|
86
|
+
errors: z.number().int(),
|
|
87
|
+
avg_ms: z.number(),
|
|
88
|
+
p95_ms: z.number()
|
|
89
|
+
});
|
|
58
90
|
var providerTypeSchema = z.enum(["webhook", "email", "slack"]);
|
|
59
91
|
var alertTypeSchema = z.enum(["new_issue", "regression", "unmute"]);
|
|
60
92
|
var alertStatusSchema = z.enum([
|
|
@@ -592,7 +624,7 @@ var spanSchema = z.object({
|
|
|
592
624
|
exclusive_time_ms: z.number().nullable(),
|
|
593
625
|
is_segment: z.boolean(),
|
|
594
626
|
segment_id: z.string().nullable(),
|
|
595
|
-
/**
|
|
627
|
+
/** Reported by the span itself, or stamped from its parent transaction. Null only for rows ingested before that stamping existed. */
|
|
596
628
|
platform: z.string().nullable(),
|
|
597
629
|
release: z.string().nullable(),
|
|
598
630
|
environment: z.string().nullable(),
|
|
@@ -607,6 +639,11 @@ var spanSchema = z.object({
|
|
|
607
639
|
gen_ai_usage_output_tokens: z.number().nullable(),
|
|
608
640
|
gen_ai_usage_total_tokens: z.number().nullable()
|
|
609
641
|
});
|
|
642
|
+
var spanDetailSchema = spanSchema.extend({
|
|
643
|
+
attributes: z.record(z.string(), z.any()),
|
|
644
|
+
/** Always absent for a Spans Protocol v2 span: v2 has no tags concept. */
|
|
645
|
+
tags: z.record(z.string(), z.any()).nullish()
|
|
646
|
+
});
|
|
610
647
|
var transactionStatsSchema = z.object({
|
|
611
648
|
transaction_name: z.string(),
|
|
612
649
|
op: z.string().nullable(),
|
|
@@ -999,6 +1036,9 @@ function timeseriesSearchParams(options) {
|
|
|
999
1036
|
if (options?.interval_hours) {
|
|
1000
1037
|
searchParams.interval_hours = String(options.interval_hours);
|
|
1001
1038
|
}
|
|
1039
|
+
if (options?.environment) {
|
|
1040
|
+
searchParams.environment = options.environment;
|
|
1041
|
+
}
|
|
1002
1042
|
return searchParams;
|
|
1003
1043
|
}
|
|
1004
1044
|
function breakdownSearchParams(options) {
|
|
@@ -1009,6 +1049,9 @@ function breakdownSearchParams(options) {
|
|
|
1009
1049
|
if (options?.limit) {
|
|
1010
1050
|
searchParams.limit = String(options.limit);
|
|
1011
1051
|
}
|
|
1052
|
+
if (options?.environment) {
|
|
1053
|
+
searchParams.environment = options.environment;
|
|
1054
|
+
}
|
|
1012
1055
|
return searchParams;
|
|
1013
1056
|
}
|
|
1014
1057
|
var AgentsResource = class extends BaseResource {
|
|
@@ -1079,6 +1122,12 @@ var AgentsResource = class extends BaseResource {
|
|
|
1079
1122
|
if (options?.per_page) {
|
|
1080
1123
|
searchParams.per_page = String(options.per_page);
|
|
1081
1124
|
}
|
|
1125
|
+
if (options?.period_hours) {
|
|
1126
|
+
searchParams.period_hours = String(options.period_hours);
|
|
1127
|
+
}
|
|
1128
|
+
if (options?.environment) {
|
|
1129
|
+
searchParams.environment = options.environment;
|
|
1130
|
+
}
|
|
1082
1131
|
return this.request(
|
|
1083
1132
|
() => this.http.get(`api/projects/${projectId}/agents/traces`, {
|
|
1084
1133
|
searchParams
|
|
@@ -1086,6 +1135,50 @@ var AgentsResource = class extends BaseResource {
|
|
|
1086
1135
|
offsetPaginatedResponseSchema(agentTraceSummarySchema)
|
|
1087
1136
|
);
|
|
1088
1137
|
}
|
|
1138
|
+
/**
|
|
1139
|
+
* Headline totals over the selected window — the numbers the charts show
|
|
1140
|
+
* the shape of but cannot state.
|
|
1141
|
+
*/
|
|
1142
|
+
async getSummary(projectId, options) {
|
|
1143
|
+
return this.request(
|
|
1144
|
+
() => this.http.get(`api/projects/${projectId}/agents/summary`, {
|
|
1145
|
+
searchParams: breakdownSearchParams(options)
|
|
1146
|
+
}),
|
|
1147
|
+
agentSummarySchema
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Per-model table: volume, failures, latency and the full token split.
|
|
1152
|
+
*/
|
|
1153
|
+
async getModelsTable(projectId, options) {
|
|
1154
|
+
return this.request(
|
|
1155
|
+
() => this.http.get(`api/projects/${projectId}/agents/models`, {
|
|
1156
|
+
searchParams: breakdownSearchParams(options)
|
|
1157
|
+
}),
|
|
1158
|
+
z.array(agentModelRowSchema)
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Per-tool table: call volume, failures and latency.
|
|
1163
|
+
*/
|
|
1164
|
+
async getToolsTable(projectId, options) {
|
|
1165
|
+
return this.request(
|
|
1166
|
+
() => this.http.get(`api/projects/${projectId}/agents/tools/stats`, {
|
|
1167
|
+
searchParams: breakdownSearchParams(options)
|
|
1168
|
+
}),
|
|
1169
|
+
z.array(agentToolRowSchema)
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Environments present in this project's AI spans — the options the filter
|
|
1174
|
+
* offers, read from the data rather than hardcoded.
|
|
1175
|
+
*/
|
|
1176
|
+
async getEnvironments(projectId) {
|
|
1177
|
+
return this.request(
|
|
1178
|
+
() => this.http.get(`api/projects/${projectId}/agents/environments`),
|
|
1179
|
+
z.array(z.string())
|
|
1180
|
+
);
|
|
1181
|
+
}
|
|
1089
1182
|
};
|
|
1090
1183
|
var AlertIntegrationsResource = class extends BaseResource {
|
|
1091
1184
|
/**
|
|
@@ -2018,6 +2111,20 @@ var SpansResource = class extends BaseResource {
|
|
|
2018
2111
|
offsetPaginatedResponseSchema(spanSchema)
|
|
2019
2112
|
);
|
|
2020
2113
|
}
|
|
2114
|
+
/**
|
|
2115
|
+
* Fetch one span together with its raw attribute bag — the `gen_ai.*`
|
|
2116
|
+
* payload (prompts, responses, tool arguments and results) that `list()`
|
|
2117
|
+
* omits so a trace's worth of spans stays cheap to load.
|
|
2118
|
+
*
|
|
2119
|
+
* `spanId` is the row id from a list item's `id`, not the SDK's 16-hex
|
|
2120
|
+
* `span_id`.
|
|
2121
|
+
*/
|
|
2122
|
+
async get(projectId, spanId) {
|
|
2123
|
+
return this.request(
|
|
2124
|
+
() => this.http.get(`api/projects/${projectId}/spans/${spanId}`),
|
|
2125
|
+
spanDetailSchema
|
|
2126
|
+
);
|
|
2127
|
+
}
|
|
2021
2128
|
};
|
|
2022
2129
|
|
|
2023
2130
|
// src/resources/stats.ts
|