From 93b4de4ff13e3e181299f8a894eff8fd7bfa8d7f Mon Sep 17 00:00:00 2001 From: ysyneu Date: Thu, 2 Jul 2026 00:56:03 -0700 Subject: [PATCH] chore: sync OpenAPI spec --- alerts.go | 2 +- data_query.go | 22 + facets.go | 50 + models_gen.go | 352 +++++- openapi/openapi.en.json | 2373 ++++++++++++++++++++++++++++++-------- openapi/openapi.zh.json | 2385 +++++++++++++++++++++++++++++++-------- roundtrip_gen_test.go | 5 + services_gen.go | 4 + sourcemaps.go | 14 + 9 files changed, 4278 insertions(+), 929 deletions(-) create mode 100644 data_query.go create mode 100644 facets.go diff --git a/alerts.go b/alerts.go index 653f4e4..81dab3f 100644 --- a/alerts.go +++ b/alerts.go @@ -23,7 +23,7 @@ func (s *AlertsService) EventReadList(ctx context.Context, req *AlertEventGlobal // List events for an alert. // -// Return all raw events that have been ingested into a specific alert, in chronological order. +// Return raw events for an alert with cursor or page-number pagination. // // API: POST /alert/event/list (alert-read-event-list). func (s *AlertsService) ReadEventList(ctx context.Context, req *AlertEventListRequest) (*AlertEventListResponse, *Response, error) { diff --git a/data_query.go b/data_query.go new file mode 100644 index 0000000..4961e00 --- /dev/null +++ b/data_query.go @@ -0,0 +1,22 @@ +// Code generated by internal/cmd/gen; DO NOT EDIT. + +package flashduty + +import "context" + +// DataQueryService handles the "RUM/Data query" API resource. +type DataQueryService service + +// Query RUM data. +// +// Run one or more SQL-style RUM data queries over a bounded time range. +// +// API: POST /rum/data/query (rum-read-data-query). +func (s *DataQueryService) Query(ctx context.Context, req *RUMDataQueryRequest) (*RUMDataQueryResponse, *Response, error) { + out := new(RUMDataQueryResponse) + resp, err := s.client.do(ctx, "/rum/data/query", req, out) + if err != nil { + return nil, resp, err + } + return out, resp, nil +} diff --git a/facets.go b/facets.go new file mode 100644 index 0000000..6972e00 --- /dev/null +++ b/facets.go @@ -0,0 +1,50 @@ +// Code generated by internal/cmd/gen; DO NOT EDIT. + +package flashduty + +import "context" + +// FacetsService handles the "RUM/Facets" API resource. +type FacetsService service + +// Count facet value distribution. +// +// Return the top N values for a facet field within a time range, sorted by occurrence count descending. +// +// API: POST /rum/facet/count (rum-read-facet-count). +func (s *FacetsService) FacetCount(ctx context.Context, req *RUMFacetCountRequest) (*RUMFacetCountResponse, *Response, error) { + out := new(RUMFacetCountResponse) + resp, err := s.client.do(ctx, "/rum/facet/count", req, out) + if err != nil { + return nil, resp, err + } + return out, resp, nil +} + +// List RUM facet fields. +// +// Return all available RUM field definitions, optionally filtered by scope and facet status. +// +// API: POST /rum/facet/list (rum-read-facet-list). +func (s *FacetsService) FacetList(ctx context.Context, req *RUMFacetListRequest) (*RUMFacetListResponse, *Response, error) { + out := new(RUMFacetListResponse) + resp, err := s.client.do(ctx, "/rum/facet/list", req, out) + if err != nil { + return nil, resp, err + } + return out, resp, nil +} + +// List RUM fields. +// +// Return RUM field definitions, optionally filtered by scope and facet status. +// +// API: POST /rum/field/list (rum-read-field-list). +func (s *FacetsService) FieldList(ctx context.Context, req *RUMFieldListRequest) (*RUMFieldListResponse, *Response, error) { + out := new(RUMFieldListResponse) + resp, err := s.client.do(ctx, "/rum/field/list", req, out) + if err != nil { + return nil, resp, err + } + return out, resp, nil +} diff --git a/models_gen.go b/models_gen.go index 2d5142b..96e5d8e 100644 --- a/models_gen.go +++ b/models_gen.go @@ -25,7 +25,7 @@ func (e CSVFileResponse) String() string { return string(e) } // DataSourceListResponse is a list response payload. type DataSourceListResponse []DataSourceItem -// ErrorCode Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational. +// ErrorCode Flashduty error code enum. Every failed API response sets `error.code` to one of these stable wire strings. HTTP status is informational — the authoritative signal is the enum value. type ErrorCode string const ( @@ -148,6 +148,9 @@ type RuleNameMessageListResponse []NameMessage // RuleStatusResponse is a list response payload. type RuleStatusResponse []AlertRuleStatus +// RUMDataQueryResponse is a map response payload. +type RUMDataQueryResponse map[string]RUMDataQueryOutput + // SLSLogstoresResponse is a list response payload. type SLSLogstoresResponse []string @@ -457,13 +460,23 @@ type AlertEventItem struct { // AlertEventListRequest is generated from the Flashduty OpenAPI schema. type AlertEventListRequest struct { - // Alert ID (ObjectID hex string). + ListOptions + // Alert ID (MongoDB ObjectID). AlertID string `json:"alert_id,omitempty" toon:"alert_id,omitempty"` + // When true, return events oldest-first. Defaults to newest-first. + Asc bool `json:"asc,omitempty" toon:"asc,omitempty"` } // AlertEventListResponse is generated from the Flashduty OpenAPI schema. type AlertEventListResponse struct { + // Whether another page is available. + HasNextPage bool `json:"has_next_page" toon:"has_next_page"` + // Raw alert events in the requested order. Items []AlertEventItem `json:"items" toon:"items"` + // Cursor to pass as `search_after_ctx` for the next page. + SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"` + // Total matching event count. + Total int64 `json:"total" toon:"total"` } // AlertFeedRequest is generated from the Flashduty OpenAPI schema. @@ -529,7 +542,7 @@ type AlertInfo struct { EndTime Timestamp `json:"end_time" toon:"end_time"` // Total number of raw events merged into this alert. EventCnt int64 `json:"event_cnt" toon:"event_cnt"` - // Raw alert events, populated when the caller opts in. + // Raw alert event preview, populated only when requested. Capped at the 20 newest events per alert. Events []AlertEventItem `json:"events" toon:"events"` // Whether this alert has ever been silenced. EverMuted bool `json:"ever_muted" toon:"ever_muted"` @@ -2524,6 +2537,14 @@ type ExportedStatusPageSubscriberItem struct { Recipient string `json:"recipient" toon:"recipient"` } +// FacetCountItem is generated from the Flashduty OpenAPI schema. +type FacetCountItem struct { + // Number of events with this facet value in the time range. + Count int64 `json:"count" toon:"count"` + // The facet value. Type matches the field's `value_type`. + FacetValue any `json:"facet_value" toon:"facet_value"` +} + // FeedDetailAlertClose is generated from the Flashduty OpenAPI schema. type FeedDetailAlertClose struct{} @@ -3514,7 +3535,7 @@ type ListIncidentAlertsRequest struct { ListOptions // Incident ID (MongoDB ObjectID). IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"` - // When true, include raw alert events in each alert item. + // When true, include at most the 20 newest raw events in each alert item as a preview. IncludeEvents bool `json:"include_events,omitempty" toon:"include_events,omitempty"` // When true return only active alerts (Critical/Warning/Info); when false return only recovered alerts (Ok). Omit to include all. IsActive *bool `json:"is_active,omitempty" toon:"is_active,omitempty"` @@ -5170,7 +5191,8 @@ type RUMApplicationCreateRequest struct { // Application name. 1–40 characters. ApplicationName string `json:"application_name,omitempty" toon:"application_name,omitempty"` // Restrict access to team members only. - IsPrivate bool `json:"is_private,omitempty" toon:"is_private,omitempty"` + IsPrivate bool `json:"is_private,omitempty" toon:"is_private,omitempty"` + Links RUMApplicationLinks `json:"links,omitempty" toon:"links,omitempty"` // Do not infer geographic location. NoGeo bool `json:"no_geo,omitempty" toon:"no_geo,omitempty"` // Do not collect IP addresses. @@ -5225,7 +5247,8 @@ type RUMApplicationItem struct { // Creator member ID. CreatedBy int64 `json:"created_by" toon:"created_by"` // If `true`, the application is only accessible to team members. - IsPrivate bool `json:"is_private" toon:"is_private"` + IsPrivate bool `json:"is_private" toon:"is_private"` + Links RUMApplicationLinks `json:"links" toon:"links"` // If `true`, geographic location is not inferred from IP. NoGeo bool `json:"no_geo" toon:"no_geo"` // If `true`, IP addresses are not collected. @@ -5243,6 +5266,32 @@ type RUMApplicationItem struct { UpdatedBy int64 `json:"updated_by" toon:"updated_by"` } +// RUMApplicationLink is generated from the Flashduty OpenAPI schema. +type RUMApplicationLink struct { + // Whether this external system link is enabled. + Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"` + // RUM event types where this external system link is shown. + EventTypes []string `json:"event_types,omitempty" toon:"event_types,omitempty"` + // Display color for the link icon. + IconColor string `json:"icon_color,omitempty" toon:"icon_color,omitempty"` + // Short text shown in the link icon. + IconText string `json:"icon_text,omitempty" toon:"icon_text,omitempty"` + // Stable client-side identifier for this external system. + ID string `json:"id,omitempty" toon:"id,omitempty"` + // Display name of the external system. + Name string `json:"name,omitempty" toon:"name,omitempty"` + // HTTP or HTTPS URL template. `${var}` tokens are resolved from the RUM event context. + URL string `json:"url,omitempty" toon:"url,omitempty"` +} + +// RUMApplicationLinks is generated from the Flashduty OpenAPI schema. +type RUMApplicationLinks struct { + // Whether external link integration is enabled. + Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"` + // External systems whose URL templates can be opened from matching RUM events. + Systems []RUMApplicationLink `json:"systems,omitempty" toon:"systems,omitempty"` +} + // RUMApplicationListRequest is generated from the Flashduty OpenAPI schema. type RUMApplicationListRequest struct { ListOptions @@ -5281,13 +5330,182 @@ type RUMApplicationUpdateRequest struct { // Application ID to update. ApplicationID string `json:"application_id,omitempty" toon:"application_id,omitempty"` // New application name. - ApplicationName *string `json:"application_name,omitempty" toon:"application_name,omitempty"` - IsPrivate *bool `json:"is_private,omitempty" toon:"is_private,omitempty"` - NoGeo *bool `json:"no_geo,omitempty" toon:"no_geo,omitempty"` - NoIP *bool `json:"no_ip,omitempty" toon:"no_ip,omitempty"` - TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"` + ApplicationName string `json:"application_name,omitempty" toon:"application_name,omitempty"` + IsPrivate bool `json:"is_private,omitempty" toon:"is_private,omitempty"` + Links RUMApplicationLinks `json:"links,omitempty" toon:"links,omitempty"` + NoGeo bool `json:"no_geo,omitempty" toon:"no_geo,omitempty"` + NoIP bool `json:"no_ip,omitempty" toon:"no_ip,omitempty"` + TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"` Tracing RUMApplicationTracing `json:"tracing,omitempty" toon:"tracing,omitempty"` - Type *string `json:"type,omitempty" toon:"type,omitempty"` + Type string `json:"type,omitempty" toon:"type,omitempty"` +} + +// RUMDataAggregateFunction is generated from the Flashduty OpenAPI schema. +type RUMDataAggregateFunction struct { + // Column index used by the aggregate. + ColumnIndex int64 `json:"column_index" toon:"column_index"` + // Column name used by the aggregate. + ColumnName string `json:"column_name" toon:"column_name"` + // Aggregate function type. + Type string `json:"type" toon:"type"` +} + +// RUMDataFieldMeta is generated from the Flashduty OpenAPI schema. +type RUMDataFieldMeta struct { + // Column name. + Name string `json:"name" toon:"name"` + // Whether values in this column may be null. + Nullable bool `json:"nullable" toon:"nullable"` + // Backend database type name for this column. + Type string `json:"type" toon:"type"` +} + +// RUMDataQueryDefinition is generated from the Flashduty OpenAPI schema. +type RUMDataQueryDefinition struct { + // When true, asks the query engine to avoid sampling when possible. + DisableSampling bool `json:"disable_sampling,omitempty" toon:"disable_sampling,omitempty"` + // Optional RUM DQL filter expression used together with SQL validation. + Dql string `json:"dql,omitempty" toon:"dql,omitempty"` + // Output format. `table` returns rows; `time_series` returns bucketed time-series rows. + Format string `json:"format,omitempty" toon:"format,omitempty"` + // Client-supplied query ID. The same value is used as the key in the response object. + ID string `json:"id,omitempty" toon:"id,omitempty"` + // Time bucket interval in seconds for `time_series` queries. + Interval int64 `json:"interval,omitempty" toon:"interval,omitempty"` + // Maximum number of points for `time_series` queries. + MaxPoints int64 `json:"max_points,omitempty" toon:"max_points,omitempty"` + // Opaque cursor returned by a previous table query for continuing pagination. + SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"` + // RUM SQL query to execute. + Sql string `json:"sql,omitempty" toon:"sql,omitempty"` + // IANA time zone name used when evaluating time functions, such as `Asia/Shanghai`. + TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"` +} + +// RUMDataQueryOutput is generated from the Flashduty OpenAPI schema. +type RUMDataQueryOutput struct { + Data RUMDataQueryResult `json:"data" toon:"data"` + Error any `json:"error" toon:"error"` +} + +// RUMDataQueryRequest is generated from the Flashduty OpenAPI schema. +type RUMDataQueryRequest struct { + // End of the query window, Unix epoch milliseconds. Maximum 31-day span. + EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"` + // Queries to execute concurrently. 1 to 10 queries are allowed. + Queries []RUMDataQueryDefinition `json:"queries,omitempty" toon:"queries,omitempty"` + // Start of the query window, Unix epoch milliseconds. + StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"` +} + +// RUMDataQueryResult is generated from the Flashduty OpenAPI schema. +type RUMDataQueryResult struct { + // Column metadata for the values matrix. + Fields []RUMDataFieldMeta `json:"fields" toon:"fields"` + // Effective time bucket interval in seconds for time-series queries. + Interval int64 `json:"interval" toon:"interval"` + Sampling RUMDataSamplingDecision `json:"sampling" toon:"sampling"` + // Opaque cursor for continuing paginated table queries. + SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"` + // Rows returned by the query. Each row aligns with `fields` by index. + Values [][]any `json:"values" toon:"values"` +} + +// RUMDataSamplingDecision is generated from the Flashduty OpenAPI schema. +type RUMDataSamplingDecision struct { + // Aggregate functions affected by sampling. + AggregateFuncs []RUMDataAggregateFunction `json:"aggregate_funcs" toon:"aggregate_funcs"` + // Whether sampling was applied. + Enabled bool `json:"enabled" toon:"enabled"` + // Multiplier used to scale sampled counts back to estimated full counts. + ScaleFactor float64 `json:"scale_factor" toon:"scale_factor"` + // Storage tablets selected for the sampled query. + SelectedTablets []string `json:"selected_tablets" toon:"selected_tablets"` +} + +// RUMFacetCountRequest is generated from the Flashduty OpenAPI schema. +type RUMFacetCountRequest struct { + // RUM DQL filter expression applied before counting. + Dql string `json:"dql,omitempty" toon:"dql,omitempty"` + // End of the time range, Unix epoch milliseconds. Maximum 31-day span. + EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"` + // The field key to count value distribution for. + FacetKey string `json:"facet_key,omitempty" toon:"facet_key,omitempty"` + // When set, filter events where `facet_key` equals this value before counting. Accepts string, number, or boolean. + FacetValue any `json:"facet_value,omitempty" toon:"facet_value,omitempty"` + // Maximum number of top values to return. Default 100, maximum 100. + Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"` + // RUM data scope to query. + Scope string `json:"scope,omitempty" toon:"scope,omitempty"` + // SQL WHERE clause (no SELECT) for additional filtering. + Sql string `json:"sql,omitempty" toon:"sql,omitempty"` + // Start of the time range, Unix epoch milliseconds. + StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"` +} + +// RUMFacetCountResponse is generated from the Flashduty OpenAPI schema. +type RUMFacetCountResponse struct { + Items []FacetCountItem `json:"items" toon:"items"` +} + +// RUMFacetListRequest is generated from the Flashduty OpenAPI schema. +type RUMFacetListRequest struct { + // When true, return only facet-enabled fields. When false or omitted, return all fields. + IsFacet bool `json:"is_facet,omitempty" toon:"is_facet,omitempty"` + // Filter by RUM data scopes. Valid values: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`. + Scopes []string `json:"scopes,omitempty" toon:"scopes,omitempty"` +} + +// RUMFacetListResponse is generated from the Flashduty OpenAPI schema. +type RUMFacetListResponse struct { + Items []RUMFieldItem `json:"items" toon:"items"` +} + +// RUMFieldItem is generated from the Flashduty OpenAPI schema. +type RUMFieldItem struct { + // Account ID. 0 for built-in fields. + AccountID int64 `json:"account_id" toon:"account_id"` + // Description of what this field captures. + Description string `json:"description" toon:"description"` + // True if this is a custom field that can be edited by the user. + EditAble bool `json:"edit_able" toon:"edit_able"` + // Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values. + EnumValues []any `json:"enum_values" toon:"enum_values"` + // Unique field key, e.g. `error.type`. + FieldKey string `json:"field_key" toon:"field_key"` + // Human-readable field name. + FieldName string `json:"field_name" toon:"field_name"` + // Display group for this field. + Group string `json:"group" toon:"group"` + // True if value distribution counting is supported for this field. + IsFacet bool `json:"is_facet" toon:"is_facet"` + // True if this field can be used in DQL/SQL queries. + Queryable bool `json:"queryable" toon:"queryable"` + // RUM scopes this field appears in. + Scopes []string `json:"scopes" toon:"scopes"` + // Display type in the analytics UI. + ShowType string `json:"show_type" toon:"show_type"` + // Field status, e.g. `active`. + Status string `json:"status" toon:"status"` + // Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields. + UnitFamily string `json:"unit_family" toon:"unit_family"` + // Specific measurement unit, e.g. `millisecond`, `byte`. + UnitName string `json:"unit_name" toon:"unit_name"` + // Data type of the field value. + ValueType string `json:"value_type" toon:"value_type"` +} + +// RUMFieldListRequest is generated from the Flashduty OpenAPI schema. +type RUMFieldListRequest struct { + // When true, return only facet-enabled fields. When false or omitted, return all fields. + IsFacet bool `json:"is_facet,omitempty" toon:"is_facet,omitempty"` + // Filter by RUM data scopes. Valid values: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`. + Scopes []string `json:"scopes,omitempty" toon:"scopes,omitempty"` +} + +// RUMFieldListResponse is generated from the Flashduty OpenAPI schema. +type RUMFieldListResponse struct { + Items []RUMFieldItem `json:"items" toon:"items"` } // RUMIssueIDRequest is generated from the Flashduty OpenAPI schema. @@ -6013,6 +6231,61 @@ type SnoozeIncidentRequest struct { Minutes int64 `json:"minutes,omitempty" toon:"minutes,omitempty"` } +// SourcemapBinaryImage is generated from the Flashduty OpenAPI schema. +type SourcemapBinaryImage struct { + // CPU architecture for this binary image. + Arch string `json:"arch,omitempty" toon:"arch,omitempty"` + // Whether this binary belongs to the operating system. + IsSystem bool `json:"is_system,omitempty" toon:"is_system,omitempty"` + // Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer. + LoadAddress any `json:"load_address,omitempty" toon:"load_address,omitempty"` + // Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer. + MaxAddress any `json:"max_address,omitempty" toon:"max_address,omitempty"` + // Binary image name. + Name string `json:"name,omitempty" toon:"name,omitempty"` + // Build UUID identifying the binary or dSYM. + Uuid string `json:"uuid,omitempty" toon:"uuid,omitempty"` +} + +// SourcemapCodeSnippet is generated from the Flashduty OpenAPI schema. +type SourcemapCodeSnippet struct { + // Source code on that line. + Code string `json:"code" toon:"code"` + // Source line number. + Line int64 `json:"line" toon:"line"` +} + +// SourcemapEnrichedFrame is generated from the Flashduty OpenAPI schema. +type SourcemapEnrichedFrame struct { + // iOS or native memory address. + Address string `json:"address" toon:"address"` + // Android Java/Kotlin class name. + ClassName string `json:"class_name" toon:"class_name"` + // Source-code snippets around this frame. + CodeSnippets []SourcemapCodeSnippet `json:"code_snippets" toon:"code_snippets"` + // Column number for JavaScript or Flutter frames. + Column int64 `json:"column" toon:"column"` + // Whether the frame was successfully symbolicated or deobfuscated. + Converted bool `json:"converted" toon:"converted"` + // Source file, URL, or module path. + File string `json:"file" toon:"file"` + // Function or method name. + Function string `json:"function" toon:"function"` + // Line number. + Line int64 `json:"line" toon:"line"` + // Android Java/Kotlin method name without class prefix. + MethodName string `json:"method_name" toon:"method_name"` + // iOS Swift/Objective-C module name. + Module string `json:"module" toon:"module"` + // Unity IL native address. + NativeAddress string `json:"native_address" toon:"native_address"` + // Symbol offset from function start. + Offset int64 `json:"offset" toon:"offset"` + OriginalFrame SourcemapStackFrame `json:"original_frame" toon:"original_frame"` + // Whether the frame is from third-party or system libraries. + ThirdParty bool `json:"third_party" toon:"third_party"` +} + // SourcemapItem is generated from the Flashduty OpenAPI schema. type SourcemapItem struct { // Upload timestamp, Unix epoch seconds. @@ -6069,6 +6342,61 @@ type SourcemapListResponse struct { Total int64 `json:"total" toon:"total"` } +// SourcemapStackEnrichRequest is generated from the Flashduty OpenAPI schema. +type SourcemapStackEnrichRequest struct { + // Android NDK architecture such as `arm`, `arm64`, `x86`, or `x64`. + Arch string `json:"arch,omitempty" toon:"arch,omitempty"` + // Loaded binary images from an iOS crash report. + BinaryImages []SourcemapBinaryImage `json:"binary_images,omitempty" toon:"binary_images,omitempty"` + // Android build ID for Gradle plugin 1.13.0 and later. + BuildID string `json:"build_id,omitempty" toon:"build_id,omitempty"` + // Number of nearby meaningful source lines to return around converted frames. + Near int64 `json:"near,omitempty" toon:"near,omitempty"` + // Skip cached enrich results. Intended for debugging. + NoCache bool `json:"no_cache,omitempty" toon:"no_cache,omitempty"` + // Application or service name used when the sourcemap was uploaded. + Service string `json:"service,omitempty" toon:"service,omitempty"` + // Android error source type. Use `ndk` with `arch` for native symbolication. + SourceType string `json:"source_type,omitempty" toon:"source_type,omitempty"` + // Raw stack trace to parse and enrich. + Stack string `json:"stack,omitempty" toon:"stack,omitempty"` + // Source platform. Defaults to `browser` when omitted. + Type string `json:"type,omitempty" toon:"type,omitempty"` + // Android build variant used by older Gradle plugin versions. + Variant string `json:"variant,omitempty" toon:"variant,omitempty"` + // Application version used when the sourcemap was uploaded. + Version string `json:"version,omitempty" toon:"version,omitempty"` +} + +// SourcemapStackEnrichResponse is generated from the Flashduty OpenAPI schema. +type SourcemapStackEnrichResponse struct { + Frames []SourcemapEnrichedFrame `json:"frames" toon:"frames"` +} + +// SourcemapStackFrame is generated from the Flashduty OpenAPI schema. +type SourcemapStackFrame struct { + // iOS or native memory address. + Address string `json:"address" toon:"address"` + // Android Java/Kotlin class name. + ClassName string `json:"class_name" toon:"class_name"` + // Column number for JavaScript or Flutter frames. + Column int64 `json:"column" toon:"column"` + // Source file, URL, or module path. + File string `json:"file" toon:"file"` + // Function or method name. + Function string `json:"function" toon:"function"` + // Line number. + Line int64 `json:"line" toon:"line"` + // Android Java/Kotlin method name without class prefix. + MethodName string `json:"method_name" toon:"method_name"` + // iOS Swift/Objective-C module name. + Module string `json:"module" toon:"module"` + // Unity IL native address. + NativeAddress string `json:"native_address" toon:"native_address"` + // Symbol offset from function start. + Offset int64 `json:"offset" toon:"offset"` +} + // StatusPageChangeCreateResponse is generated from the Flashduty OpenAPI schema. type StatusPageChangeCreateResponse struct { // Newly created event ID. diff --git a/openapi/openapi.en.json b/openapi/openapi.en.json index d32cb4d..a5a248c 100644 --- a/openapi/openapi.en.json +++ b/openapi/openapi.en.json @@ -73,18 +73,6 @@ "name": "Monitors/Rule sets", "description": "Manage shared rule sets (rulesets) in the Monitors rule repository. Rulesets can be shared publicly or within an account." }, - { - "name": "RUM/Applications", - "description": "Manage Real User Monitoring (RUM) applications." - }, - { - "name": "RUM/Issues", - "description": "Query and manage RUM error tracking issues and preset severity rules." - }, - { - "name": "RUM/Sourcemaps", - "description": "Manage and query RUM sourcemap files for browser, Android, and iOS error symbolication." - }, { "name": "Platform/Members", "description": "" @@ -135,6 +123,26 @@ }, { "name": "AI SRE/Automations" + }, + { + "name": "RUM/Applications", + "description": "Manage Real User Monitoring (RUM) applications." + }, + { + "name": "RUM/Data query", + "description": "Run RUM analytics queries over event data." + }, + { + "name": "RUM/Issues", + "description": "Query and manage RUM error tracking issues and preset severity rules." + }, + { + "name": "RUM/Facets", + "description": "Query RUM facet fields and their value distributions for building analytics filters." + }, + { + "name": "RUM/Sourcemaps", + "description": "Manage and query RUM sourcemap files for browser, Android, and iOS error symbolication." } ], "paths": { @@ -597,7 +605,7 @@ "On-call/Incidents" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Incidents Read** (`on-call`) |\n\n## Usage\n\n- Set `include_events=true` only when you need a preview of each alert's raw events.\n- Event previews are capped at the 20 newest events per alert. Use `POST /alert/event/list` for a full paginated event history.\n- `event_cnt` still reports the total number of raw events merged into each alert.", "href": "/en/api-reference/on-call/incidents/incident-alert-list", "metadata": { "sidebarTitle": "List alerts of incident" @@ -666,7 +674,20 @@ "images": null, "data_source_name": "FlashMonit", "data_source_type": "monit.alert", - "data_source_ref_id": "a_2451002751131" + "data_source_ref_id": "a_2451002751131", + "events": [ + { + "event_id": "69da451df77b1b51f40e83df", + "alert_id": "69da451df77b1b51f40e83de", + "title": "CPU usage > 90%", + "event_severity": "Critical", + "event_status": "Critical", + "event_time": 1712650000, + "labels": { + "host": "web-01" + } + } + ] } ] } @@ -698,7 +719,8 @@ "incident_id": "69da451ef77b1b51f40e83ee", "is_active": true, "limit": 100, - "p": 1 + "p": 1, + "include_events": true } } } @@ -6060,12 +6082,12 @@ "post": { "operationId": "alert-read-event-list", "summary": "List events for an alert", - "description": "Return all raw events that have been ingested into a specific alert, in chronological order.", + "description": "Return raw events for an alert with cursor or page-number pagination.", "tags": [ "On-call/Alerts" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Each alert accumulates raw events from the integration. This endpoint exposes the raw event history for a given alert.", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Channels Read** (`on-call`) |\n\n## Usage\n\n- Results are newest-first by default. Set `asc=true` to read events oldest-first.\n- Use `limit` with `search_after_ctx` from the previous response to fetch the next page.\n- Classic page-number pagination is also supported with `p`, but `p * limit` must stay within 10,000 records.\n- Each alert can accumulate a large raw event history; prefer cursor pagination for hot alerts.", "href": "/en/api-reference/on-call/alerts/alert-read-event-list", "metadata": { "sidebarTitle": "List events for an alert" @@ -6094,6 +6116,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 57, + "has_next_page": true, + "search_after_ctx": "663a1b2c3d4e5f6789abc001", "items": [ { "event_id": "663a1b2c3d4e5f6789abc001", @@ -6133,7 +6158,8 @@ "$ref": "#/components/schemas/AlertEventListRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef" + "alert_id": "663a1b2c3d4e5f6789abcdef", + "limit": 20 } } } @@ -15612,19 +15638,19 @@ } } }, - "/rum/application/list": { + "/rum/facet/count": { "post": { - "operationId": "rum-application-read-list", - "summary": "List applications", - "description": "Return a paginated list of RUM applications accessible to the current user.", + "operationId": "rum-read-facet-count", + "summary": "Count facet value distribution", + "description": "Return the top N values for a facet field within a time range, sorted by occurrence count descending.", "tags": [ - "RUM/Applications" + "RUM/Facets" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `is_my_team` to filter applications belonging to the current user's teams.\n- Default page size is 20, maximum is 100.\n- `orderby` accepts `created_at` or `updated_at`.", - "href": "/en/api-reference/rum/applications/rum-application-read-list", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `POST /rum/facet/list` to discover available `facet_key` values for each scope.\n- The `scope` must be one of: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`.\n- Pass `dql` to further filter events before counting. DQL syntax follows the RUM query language.\n- Pass `sql` with a WHERE-clause only (no SELECT) for SQL-style filtering.\n- Default limit is 100; maximum is 100.\n- Time range is required (`start_time` / `end_time` in Unix epoch **milliseconds**). Maximum span is 31 days.", + "href": "/en/api-reference/rum/facets/rum-read-facet-count", "metadata": { - "sidebarTitle": "List applications" + "sidebarTitle": "Count facet value distribution" } }, "responses": { @@ -15641,7 +15667,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationListResponse" + "$ref": "#/components/schemas/RumFacetCountResponse" } } } @@ -15650,65 +15676,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "has_next_page": true, - "total": 7, "items": [ { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 + "facet_value": "TypeError", + "count": 1523 }, { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 + "facet_value": "ReferenceError", + "count": 342 + }, + { + "facet_value": "SyntaxError", + "count": 89 } ] } @@ -15734,32 +15713,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationListRequest" + "$ref": "#/components/schemas/RumFacetCountRequest" }, "example": { - "p": 1, - "limit": 20, - "query": "", - "is_my_team": false + "scope": "error", + "facet_key": "error.type", + "start_time": 1712620800000, + "end_time": 1712707200000, + "limit": 10 } } } } } }, - "/rum/application/info": { + "/rum/application/webhook/test": { "post": { - "operationId": "rum-application-read-info", - "summary": "Get application detail", - "description": "Retrieve full details of a single RUM application by `application_id`.", + "operationId": "rum-application-webhook-test", + "summary": "Test application webhook", + "description": "Send a sample RUM alert event to verify an application's webhook URL.", "tags": [ "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/rum/applications/rum-application-read-info", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- The endpoint validates the URL before sending the sample event.\n- A failed delivery still returns HTTP 200 with `ok=false` and the delivery error in `message`.", + "href": "/en/api-reference/rum/applications/rum-application-webhook-test", "metadata": { - "sidebarTitle": "Get application detail" + "sidebarTitle": "Test application webhook" } }, "responses": { @@ -15776,7 +15756,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationItem" + "$ref": "#/components/schemas/RumWebhookTestResponse" } } } @@ -15785,32 +15765,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 + "ok": true, + "status_code": 200, + "message": "ok" } } } @@ -15822,6 +15779,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -15834,29 +15794,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RumWebhookTestRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o" + "application_id": "rum-app-prod", + "webhook_url": "https://hooks.example.com/rum-alerts" } } } } } }, - "/rum/application/infos": { + "/rum/issue/info": { "post": { - "operationId": "rum-application-read-infos", - "summary": "Batch get applications", - "description": "Retrieve details for multiple RUM applications by their IDs in one request.", + "operationId": "rum-issue-read-info", + "summary": "Get issue detail", + "description": "Retrieve full details of a single issue by `issue_id`.", "tags": [ - "RUM/Applications" + "RUM/Issues" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Maximum 200 IDs per request.", - "href": "/en/api-reference/rum/applications/rum-application-read-infos", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", + "href": "/en/api-reference/rum/issues/rum-issue-read-info", "metadata": { - "sidebarTitle": "Batch get applications" + "sidebarTitle": "Get issue detail" } }, "responses": { @@ -15873,7 +15834,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationInfosResponse" + "$ref": "#/components/schemas/RumIssueItem" } } } @@ -15882,65 +15843,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 - }, - { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - } - ] + "team_id": 2477033058131, + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 752, + "session_count": 381, + "is_crash": false, + "age": 5078684, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1770883154944, + "updated_at": 1775961914595, + "first_seen": { + "timestamp": 1770883154944, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775961839090, + "version": "1.0.0" + }, + "error": { + "message": "Script error.", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "code.exception", + "reason": "The error message 'Script error.' typically indicates an unhandled exception in JavaScript.", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" } } } @@ -15964,32 +15902,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationInfosRequest" + "$ref": "#/components/schemas/RumIssueIDRequest" }, "example": { - "application_ids": [ - "eWbr4xk3ZRnLabRa6unqwD", - "WoyQQ3BohkdtPivubEvE8o" - ] + "issue_id": "NHEacQHi2DhXqobr9qPQz9" } } } } } }, - "/rum/application/create": { + "/rum/application/list": { "post": { - "operationId": "rum-application-write-create", - "summary": "Create application", - "description": "Create a new RUM application. Returns the generated `application_id` and `client_token`.", + "operationId": "rum-application-read-list", + "summary": "List applications", + "description": "Return a paginated list of RUM applications accessible to the current user.", "tags": [ "RUM/Applications" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- `type` must be one of: `browser`, `ios`, `android`, `react-native`, `flutter`, `kotlin-multiplatform`, `roku`, `unity`.\n- `client_token` is auto-generated and used to initialize the RUM SDK.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/applications/rum-application-write-create", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use `is_my_team` to filter applications belonging to the current user's teams.\n- Default page size is 20, maximum is 100.\n- `orderby` accepts `created_at` or `updated_at`.", + "href": "/en/api-reference/rum/applications/rum-application-read-list", "metadata": { - "sidebarTitle": "Create application" + "sidebarTitle": "List applications" } }, "responses": { @@ -16006,7 +15941,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationCreateResponse" + "$ref": "#/components/schemas/RumApplicationListResponse" } } } @@ -16015,9 +15950,88 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA", - "application_name": "My Web App", - "client_token": "e090078724855a4ca168c3884880dfbc131" + "has_next_page": true, + "total": 7, + "items": [ + { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + }, + { + "account_id": 2451002751131, + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711, + "links": { + "enabled": false, + "systems": [] + } + } + ] } } } @@ -16041,32 +16055,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationCreateRequest" + "$ref": "#/components/schemas/RumApplicationListRequest" }, "example": { - "application_name": "My Web App", - "type": "browser", - "team_id": 2477033058131, - "is_private": false + "p": 1, + "limit": 20, + "query": "", + "is_my_team": false } } } } } }, - "/rum/application/update": { + "/rum/facet/list": { "post": { - "operationId": "rum-application-write-update", - "summary": "Update application", - "description": "Update an existing RUM application. All fields except `application_id` are optional — only provided fields are updated.", + "operationId": "rum-read-facet-list", + "summary": "List RUM facet fields", + "description": "Return all available RUM field definitions, optionally filtered by scope and facet status.", "tags": [ - "RUM/Applications" + "RUM/Facets" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/applications/rum-application-write-update", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Use the returned `field_key` values as `facet_key` in `POST /rum/facet/count`.\n- Valid `scopes` are: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`.\n- Set `is_facet: true` to return only facet-enabled fields (those that support value distribution queries).", + "href": "/en/api-reference/rum/facets/rum-read-facet-list", "metadata": { - "sidebarTitle": "Update application" + "sidebarTitle": "List RUM facet fields" } }, "responses": { @@ -16083,7 +16097,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RumFacetListResponse" } } } @@ -16091,7 +16105,29 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 0, + "field_key": "error.type", + "field_name": "Error type", + "group": "Error", + "description": "The type of the error.", + "value_type": "string", + "show_type": "list", + "unit_family": "", + "unit_name": "", + "edit_able": false, + "is_facet": true, + "enum_values": [], + "scopes": [ + "error" + ], + "status": "active", + "queryable": true + } + ] + } } } } @@ -16114,36 +16150,132 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationUpdateRequest" + "$ref": "#/components/schemas/RumFacetListRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "My Web App v2", - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 + "scopes": [ + "error" + ], + "is_facet": true + } + } + } + } + } + }, + "/sourcemap/stack/enrich": { + "post": { + "operationId": "sourcemap-read-stack-enrich", + "summary": "Enrich a stack trace", + "description": "Symbolicate or deobfuscate a browser, Android, iOS, Mini Program, or HarmonyOS stack trace.", + "tags": [ + "RUM/Sourcemaps" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `type` defaults to `browser` when omitted for backward compatibility.\n- Set `near` from 1 to 20 to include source-code snippets around converted frames.\n- For Android NDK native crashes, provide `arch` and `source_type: ndk` so the backend routes to native symbolication.\n- For iOS crash stacks, pass `binary_images` so addresses can be relocated against the uploaded dSYM files.\n- `no_cache` is intended for debugging and bypasses cached enrich results.", + "href": "/en/api-reference/rum/sourcemaps/sourcemap-read-stack-enrich", + "metadata": { + "sidebarTitle": "Enrich a stack trace" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SourcemapStackEnrichResponse" + } + } + } ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "frames": [ + { + "function": "renderCheckout", + "file": "src/pages/checkout.tsx", + "line": 42, + "column": 17, + "converted": true, + "code_snippets": [ + { + "line": 41, + "code": "const cart = props.cart;" + }, + { + "line": 42, + "code": "return cart.items.map(renderItem);" + } + ], + "original_frame": { + "function": "render", + "file": "https://cdn.example.com/app.min.js", + "line": 1, + "column": 2345 + } + } + ] + } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SourcemapStackEnrichRequest" + }, + "example": { + "type": "browser", + "service": "my-web-app", + "version": "1.0.0", + "stack": "TypeError: Cannot read properties of undefined\n at render (https://cdn.example.com/app.min.js:1:2345)", + "near": 3 + } + } } } } }, - "/rum/application/delete": { + "/rum/data/query": { "post": { - "operationId": "rum-application-write-delete", - "summary": "Delete application", - "description": "Delete a RUM application by `application_id`.", + "operationId": "rum-read-data-query", + "summary": "Query RUM data", + "description": "Run one or more SQL-style RUM data queries over a bounded time range.", "tags": [ - "RUM/Applications" + "RUM/Data query" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/applications/rum-application-write-delete", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Send 1 to 10 queries in one request; each query `id` becomes a key in the response object.\n- `start_time` and `end_time` are required Unix epoch milliseconds. The maximum time range is 31 days.\n- Use `format: table` for tabular results, or `format: time_series` for bucketed time-series results.\n- For `time_series`, `interval` defaults to 3600 seconds and `max_points` defaults to 1226 when omitted.\n- `search_after_ctx` is returned by paginated table queries and can be sent back to continue scanning.", + "href": "/en/api-reference/rum/data-query/rum-read-data-query", "metadata": { - "sidebarTitle": "Delete application" + "sidebarTitle": "Query RUM data" } }, "responses": { @@ -16160,7 +16292,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RumDataQueryResponse" } } } @@ -16168,7 +16300,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "errors_by_type": { + "data": { + "fields": [ + { + "name": "error.type", + "type": "String", + "nullable": false + }, + { + "name": "errors", + "type": "UInt64", + "nullable": false + } + ], + "values": [ + [ + "TypeError", + 1523 + ], + [ + "ReferenceError", + 342 + ] + ] + } + } + } } } } @@ -16191,10 +16350,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RumDataQueryRequest" }, "example": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA" + "start_time": 1712620800000, + "end_time": 1712707200000, + "queries": [ + { + "id": "errors_by_type", + "sql": "SELECT error.type, count(*) AS errors FROM error GROUP BY error.type ORDER BY errors DESC LIMIT 10", + "format": "table", + "time_zone": "Asia/Shanghai" + } + ] } } } @@ -16362,19 +16530,339 @@ } } }, - "/rum/issue/info": { + "/rum/issue/update": { "post": { - "operationId": "rum-issue-read-info", - "summary": "Get issue detail", - "description": "Retrieve full details of a single issue by `issue_id`.", + "operationId": "rum-issue-write-update", + "summary": "Update issue", + "description": "Update the status or suspected cause of an issue.", "tags": [ "RUM/Issues" ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `status` valid values: `for_review`, `reviewed`, `ignored`, `resolved`.\n- `suspected_cause` valid values: `api.failed_request`, `network.error`, `code.exception`, `code.invalid_object_access`, `code.invalid_argument`, `unknown`.\n- Setting `status` to `resolved` also stamps `resolved_at` and `resolved_by` on the issue; moving a resolved issue back to another status clears them.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/issues/rum-issue-write-update", + "metadata": { + "sidebarTitle": "Update issue" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumIssueUpdateRequest" + }, + "example": { + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "status": "resolved" + } + } + } + } + } + }, + "/rum/application/infos": { + "post": { + "operationId": "rum-application-read-infos", + "summary": "Batch get applications", + "description": "Retrieve details for multiple RUM applications by their IDs in one request.", + "tags": [ + "RUM/Applications" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Maximum 200 IDs per request.", + "href": "/en/api-reference/rum/applications/rum-application-read-infos", + "metadata": { + "sidebarTitle": "Batch get applications" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/RumApplicationInfosResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "account_id": 2451002751131, + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711, + "links": { + "enabled": false, + "systems": [] + } + }, + { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationInfosRequest" + }, + "example": { + "application_ids": [ + "eWbr4xk3ZRnLabRa6unqwD", + "WoyQQ3BohkdtPivubEvE8o" + ] + } + } + } + } + } + }, + "/rum/field/list": { + "post": { + "operationId": "rum-read-field-list", + "summary": "List RUM fields", + "description": "Return RUM field definitions, optionally filtered by scope and facet status.", + "tags": [ + "RUM/Facets" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- This is the current field-model route for discovering RUM fields.\n- Use returned `field_key` values in RUM data queries and facet-count requests.\n- Set `is_facet: true` to return only fields that support value distribution queries.", + "href": "/en/api-reference/rum/facets/rum-read-field-list", + "metadata": { + "sidebarTitle": "List RUM fields" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/RumFieldListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "account_id": 0, + "field_key": "error.type", + "field_name": "Error type", + "group": "Error", + "description": "The type of the error.", + "value_type": "string", + "show_type": "list", + "unit_family": "", + "unit_name": "", + "edit_able": false, + "is_facet": true, + "enum_values": [], + "scopes": [ + "error" + ], + "status": "active", + "queryable": true + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumFieldListRequest" + }, + "example": { + "scopes": [ + "error" + ], + "is_facet": false + } + } + } + } + } + }, + "/rum/application/info": { + "post": { + "operationId": "rum-application-read-info", + "summary": "Get application detail", + "description": "Retrieve full details of a single RUM application by `application_id`.", + "tags": [ + "RUM/Applications" + ], "x-mint": { "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |", - "href": "/en/api-reference/rum/issues/rum-issue-read-info", + "href": "/en/api-reference/rum/applications/rum-application-read-info", "metadata": { - "sidebarTitle": "Get issue detail" + "sidebarTitle": "Get application detail" } }, "responses": { @@ -16391,7 +16879,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumIssueItem" + "$ref": "#/components/schemas/RumApplicationItem" } } } @@ -16400,42 +16888,193 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", "team_id": 2477033058131, - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 752, - "session_count": 381, - "is_crash": false, - "age": 5078684, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1770883154944, - "updated_at": 1775961914595, - "first_seen": { - "timestamp": 1770883154944, - "version": "1.0.0" + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 }, - "last_seen": { - "timestamp": 1775961839090, - "version": "1.0.0" + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" }, - "error": { - "message": "Script error.", - "type": "Error" + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationIDRequest" + }, + "example": { + "application_id": "WoyQQ3BohkdtPivubEvE8o" + } + } + } + } + } + }, + "/rum/application/delete": { + "post": { + "operationId": "rum-application-write-delete", + "summary": "Delete application", + "description": "Delete a RUM application by `application_id`.", + "tags": [ + "RUM/Applications" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/applications/rum-application-write-delete", + "metadata": { + "sidebarTitle": "Delete application" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" }, - "suspected_cause": { - "source": "auto", - "value": "code.exception", - "reason": "The error message 'Script error.' typically indicates an unhandled exception in JavaScript.", - "person_id": 0 + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationIDRequest" + }, + "example": { + "application_id": "qLpu24Dz4CAzWsESPbJYWA" + } + } + } + } + } + }, + "/rum/application/create": { + "post": { + "operationId": "rum-application-write-create", + "summary": "Create application", + "description": "Create a new RUM application. Returns the generated `application_id` and `client_token`.", + "tags": [ + "RUM/Applications" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- `type` must be one of: `browser`, `ios`, `android`, `react-native`, `flutter`, `kotlin-multiplatform`, `roku`, `unity`.\n- `links.systems[].url` must start with `http` or `https`; `${var}` tokens are resolved from RUM event context.\n- `links.systems[].event_types` accepts: `crash`, `error`, `view`, `action`, `resource`, `session`, `all`.\n- `client_token` is auto-generated and used to initialize the RUM SDK.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/applications/rum-application-write-create", + "metadata": { + "sidebarTitle": "Create application" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" }, - "versions": [ - "1.0.0" - ], - "severity": "Info" + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/RumApplicationCreateResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "application_id": "qLpu24Dz4CAzWsESPbJYWA", + "application_name": "My Web App", + "client_token": "e090078724855a4ca168c3884880dfbc131" } } } @@ -16459,83 +17098,126 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueIDRequest" + "$ref": "#/components/schemas/RumApplicationCreateRequest" + }, + "example": { + "application_name": "My Web App", + "type": "browser", + "team_id": 2477033058131, + "is_private": false, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + } + } + } + } + } + }, + "/rum/application/update": { + "post": { + "operationId": "rum-application-write-update", + "summary": "Update application", + "description": "Update an existing RUM application. All fields except `application_id` are optional — only provided fields are updated.", + "tags": [ + "RUM/Applications" + ], + "x-mint": { + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- `links.systems[].url` must start with `http` or `https`; `${var}` tokens are resolved from RUM event context.\n- `links.systems[].event_types` accepts: `crash`, `error`, `view`, `action`, `resource`, `session`, `all`.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", + "href": "/en/api-reference/rum/applications/rum-application-write-update", + "metadata": { + "sidebarTitle": "Update application" + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationUpdateRequest" }, "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9" - } - } - } - } - } - }, - "/rum/issue/update": { - "post": { - "operationId": "rum-issue-write-update", - "summary": "Update issue", - "description": "Update the status or suspected cause of an issue.", - "tags": [ - "RUM/Issues" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- `status` valid values: `for_review`, `reviewed`, `ignored`, `resolved`.\n- `suspected_cause` valid values: `api.failed_request`, `network.error`, `code.exception`, `code.invalid_object_access`, `code.invalid_argument`, `unknown`.\n- Setting `status` to `resolved` also stamps `resolved_at` and `resolved_by` on the issue; moving a resolved issue back to another status clears them.\n- Every call is recorded in the account audit log. Don't put secrets in request fields.", - "href": "/en/api-reference/rum/issues/rum-issue-write-update", - "metadata": { - "sidebarTitle": "Update issue" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "My Web App v2", + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 ] }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] } } } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RumIssueUpdateRequest" - }, - "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "status": "resolved" - } - } } } } @@ -23548,81 +24230,6 @@ } } }, - "/rum/application/webhook/test": { - "post": { - "operationId": "rum-application-webhook-test", - "summary": "Test application webhook", - "description": "Send a sample RUM alert event to verify an application's webhook URL.", - "tags": [ - "RUM/Applications" - ], - "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Applications Manage** (`rum`) |\n\n## Usage\n\n- The endpoint validates the URL before sending the sample event.\n- A failed delivery still returns HTTP 200 with `ok=false` and the delivery error in `message`.", - "href": "/en/api-reference/rum/applications/rum-application-webhook-test", - "metadata": { - "sidebarTitle": "Test application webhook" - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/RumWebhookTestResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "ok": true, - "status_code": 200, - "message": "ok" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RumWebhookTestRequest" - }, - "example": { - "application_id": "rum-app-prod", - "webhook_url": "https://hooks.example.com/rum-alerts" - } - } - } - } - } - }, "/status-page/info": { "get": { "operationId": "statusPageInfo", @@ -25426,7 +26033,7 @@ "schemas": { "ErrorCode": { "type": "string", - "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.", + "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these stable wire strings. HTTP status is informational — the authoritative signal is the enum value.\n\n| Code | HTTP | Meaning |\n|---|---|---|\n| `OK` | 200 | Reserved — not returned on real errors. |\n| `InvalidParameter` | 400 | A required parameter is missing or failed validation. |\n| `BadRequest` | 400 | Generic 400 used when no more specific code fits. |\n| `InvalidContentType` | 400 | The `Content-Type` header is not `application/json`. |\n| `ResourceNotFound` | 400 | The referenced resource does not exist. Note: returned as HTTP 400, not 404 (historical choice). |\n| `NoLicense` | 400 | The feature is license-gated and no active license was found. |\n| `ReferenceExist` | 400 | Deletion blocked — other entities still reference this resource. |\n| `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |\n| `BalanceNotEnough` | 402 | Billing-gated operation with insufficient account balance. |\n| `AccessDenied` | 403 | Authenticated but lacking the permission required for this operation. |\n| `RouteNotFound` | 404 | The request URL path is not a known route. |\n| `MethodNotAllowed` | 405 | The HTTP method is not allowed on this otherwise-known path. |\n| `UndonedOrderExist` | 409 | An outstanding billing order blocks this new one. Wait and retry. |\n| `RequestLocked` | 423 | Operation temporarily locked due to repeated failures. |\n| `EntityTooLarge` | 413 | Request body exceeds the configured max size. |\n| `RequestTooFrequently` | 429 | Rate limit hit — API-global, per-account, or per-integration. |\n| `RequestVerifyRequired` | 428 | Second-factor verification required but not supplied. |\n| `DangerousOperation` | 428 | High-risk operation requires MFA verification. |\n| `InternalError` | 500 | Unhandled server-side error. Include `request_id` in the bug report. |\n| `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try again later. |", "enum": [ "OK", "InvalidParameter", @@ -25448,7 +26055,30 @@ "DangerousOperation", "InternalError", "ServiceUnavailable" - ] + ], + "x-enumDescriptions": { + "OK": "Reserved — not returned on real errors.", + "InvalidParameter": "A required parameter is missing or failed validation.", + "BadRequest": "Generic 400 used when no more specific code fits.", + "InvalidContentType": "The `Content-Type` header is not `application/json`.", + "ResourceNotFound": "The referenced resource does not exist. Note: returned as HTTP 400, not 404 (historical choice).", + "NoLicense": "The feature is license-gated and no active license was found.", + "ReferenceExist": "Deletion blocked — other entities still reference this resource.", + "Unauthorized": "`app_key` is missing, invalid, or expired.", + "BalanceNotEnough": "Billing-gated operation with insufficient account balance.", + "AccessDenied": "Authenticated but lacking the permission required for this operation.", + "RouteNotFound": "The request URL path is not a known route.", + "MethodNotAllowed": "The HTTP method is not allowed on this otherwise-known path.", + "UndonedOrderExist": "An outstanding billing order blocks this new one. Wait and retry.", + "RequestLocked": "Operation temporarily locked due to repeated failures.", + "EntityTooLarge": "Request body exceeds the configured max size.", + "RequestTooFrequently": "Rate limit hit — API-global, per-account, or per-integration.", + "RequestVerifyRequired": "Second-factor verification required but not supplied.", + "DangerousOperation": "High-risk operation requires MFA verification.", + "InternalError": "Unhandled server-side error. Include `request_id` in the bug report.", + "ServiceUnavailable": "A backend dependency is unavailable. Try again later." + }, + "example": "InvalidParameter" }, "DutyError": { "type": "object", @@ -25459,7 +26089,8 @@ }, "message": { "type": "string", - "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request." + "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request.", + "example": "The specified parameter template_id is not valid." } }, "required": [ @@ -26114,7 +26745,7 @@ "items": { "$ref": "#/components/schemas/AlertEventItem" }, - "description": "Raw alert events, populated when the caller opts in." + "description": "Raw alert event preview, populated only when requested. Capped at the 20 newest events per alert." }, "event_cnt": { "type": "integer", @@ -26739,7 +27370,7 @@ }, "include_events": { "type": "boolean", - "description": "When true, include raw alert events in each alert item." + "description": "When true, include at most the 20 newest raw events in each alert item as a preview." }, "is_active": { "type": [ @@ -31421,18 +32052,63 @@ "properties": { "alert_id": { "type": "string", - "description": "Alert ID (ObjectID hex string)." + "pattern": "^[0-9a-fA-F]{24}$", + "description": "Alert ID (MongoDB ObjectID)." + }, + "asc": { + "type": "boolean", + "default": false, + "description": "When true, return events oldest-first. Defaults to newest-first." + }, + "limit": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 100, + "default": 20, + "description": "Page size. Defaults to 20 and cannot exceed 100." + }, + "p": { + "type": "integer", + "format": "int64", + "minimum": 0, + "default": 1, + "description": "Page number starting at 1. Used when `search_after_ctx` is omitted." + }, + "search_after_ctx": { + "type": "string", + "pattern": "^[0-9a-fA-F]{24}$", + "description": "Cursor returned by the previous page. When supplied, cursor pagination is used instead of page-number pagination." } } }, "AlertEventListResponse": { "type": "object", + "required": [ + "items", + "total", + "has_next_page" + ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/AlertEventItem" - } + }, + "description": "Raw alert events in the requested order." + }, + "total": { + "type": "integer", + "format": "int64", + "description": "Total matching event count." + }, + "has_next_page": { + "type": "boolean", + "description": "Whether another page is available." + }, + "search_after_ctx": { + "type": "string", + "description": "Cursor to pass as `search_after_ctx` for the next page." } } }, @@ -38582,6 +39258,79 @@ } } }, + "RumApplicationLink": { + "type": "object", + "description": "External system link rendered on matching RUM event detail pages.", + "required": [ + "name", + "url", + "event_types" + ], + "properties": { + "id": { + "type": "string", + "description": "Stable client-side identifier for this external system." + }, + "name": { + "type": "string", + "description": "Display name of the external system." + }, + "icon_text": { + "type": "string", + "description": "Short text shown in the link icon." + }, + "icon_color": { + "type": "string", + "description": "Display color for the link icon." + }, + "url": { + "type": "string", + "format": "uri", + "description": "HTTP or HTTPS URL template. `${var}` tokens are resolved from the RUM event context." + }, + "event_types": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "enum": [ + "crash", + "error", + "view", + "action", + "resource", + "session", + "all" + ] + }, + "description": "RUM event types where this external system link is shown." + }, + "enabled": { + "type": "boolean", + "description": "Whether this external system link is enabled." + } + } + }, + "RumApplicationLinks": { + "type": "object", + "description": "External link integration settings for the application.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether external link integration is enabled." + }, + "systems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/RumApplicationLink" + }, + "description": "External systems whose URL templates can be opened from matching RUM events." + } + } + }, "RumApplicationTracing": { "type": "object", "description": "APM tracing integration settings.", @@ -38662,6 +39411,9 @@ "tracing": { "$ref": "#/components/schemas/RumApplicationTracing" }, + "links": { + "$ref": "#/components/schemas/RumApplicationLinks" + }, "status": { "type": "string", "enum": [ @@ -38801,6 +39553,9 @@ }, "tracing": { "$ref": "#/components/schemas/RumApplicationTracing" + }, + "links": { + "$ref": "#/components/schemas/RumApplicationLinks" } } }, @@ -38834,17 +39589,11 @@ "description": "Application ID to update." }, "application_name": { - "type": [ - "string", - "null" - ], + "type": "string", "description": "New application name." }, "type": { - "type": [ - "string", - "null" - ], + "type": "string", "enum": [ "browser", "ios", @@ -38857,35 +39606,26 @@ ] }, "team_id": { - "type": [ - "integer", - "null" - ], + "type": "integer", "format": "int64" }, "is_private": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "no_ip": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "no_geo": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "alerting": { "$ref": "#/components/schemas/RumApplicationAlerting" }, "tracing": { "$ref": "#/components/schemas/RumApplicationTracing" + }, + "links": { + "$ref": "#/components/schemas/RumApplicationLinks" } } }, @@ -45442,6 +46182,729 @@ "trigger_kind", "status" ] + }, + "FacetCountItem": { + "type": "object", + "description": "A facet value and its occurrence count.", + "required": [ + "facet_value", + "count" + ], + "properties": { + "facet_value": { + "description": "The facet value. Type matches the field's `value_type`." + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Number of events with this facet value in the time range.", + "example": 1523 + } + } + }, + "RumDataAggregateFunction": { + "type": "object", + "description": "Aggregate function metadata used by the sampling engine.", + "required": [ + "type", + "column_name", + "column_index" + ], + "properties": { + "type": { + "type": "string", + "description": "Aggregate function type." + }, + "column_name": { + "type": "string", + "description": "Column name used by the aggregate." + }, + "column_index": { + "type": "integer", + "description": "Column index used by the aggregate." + } + } + }, + "RumDataFieldMeta": { + "type": "object", + "description": "Metadata for one returned column.", + "required": [ + "name", + "type", + "nullable" + ], + "properties": { + "name": { + "type": "string", + "description": "Column name." + }, + "type": { + "type": "string", + "description": "Backend database type name for this column." + }, + "nullable": { + "type": "boolean", + "description": "Whether values in this column may be null." + } + } + }, + "RumDataQueryDefinition": { + "type": "object", + "description": "One RUM data query definition.", + "required": [ + "id", + "sql", + "format" + ], + "properties": { + "id": { + "type": "string", + "maxLength": 64, + "description": "Client-supplied query ID. The same value is used as the key in the response object." + }, + "sql": { + "type": "string", + "description": "RUM SQL query to execute." + }, + "dql": { + "type": "string", + "description": "Optional RUM DQL filter expression used together with SQL validation." + }, + "format": { + "type": "string", + "enum": [ + "time_series", + "table" + ], + "description": "Output format. `table` returns rows; `time_series` returns bucketed time-series rows." + }, + "interval": { + "type": "integer", + "format": "int64", + "exclusiveMinimum": 0, + "default": 3600, + "description": "Time bucket interval in seconds for `time_series` queries." + }, + "max_points": { + "type": "integer", + "format": "int64", + "exclusiveMinimum": 0, + "default": 1226, + "description": "Maximum number of points for `time_series` queries." + }, + "time_zone": { + "type": "string", + "description": "IANA time zone name used when evaluating time functions, such as `Asia/Shanghai`." + }, + "search_after_ctx": { + "type": "string", + "description": "Opaque cursor returned by a previous table query for continuing pagination." + }, + "disable_sampling": { + "type": "boolean", + "description": "When true, asks the query engine to avoid sampling when possible." + } + } + }, + "RumDataQueryOutput": { + "type": "object", + "description": "Result for one query. Failed subqueries populate `error`; successful ones populate `data`.", + "properties": { + "error": { + "$ref": "#/components/schemas/DutyError" + }, + "data": { + "$ref": "#/components/schemas/RumDataQueryResult" + } + } + }, + "RumDataQueryRequest": { + "type": "object", + "description": "Batch of RUM data queries over a bounded time range.", + "required": [ + "start_time", + "end_time", + "queries" + ], + "properties": { + "start_time": { + "type": "integer", + "format": "int64", + "description": "Start of the query window, Unix epoch milliseconds.", + "example": 1712620800000 + }, + "end_time": { + "type": "integer", + "format": "int64", + "description": "End of the query window, Unix epoch milliseconds. Maximum 31-day span.", + "example": 1712707200000 + }, + "queries": { + "type": "array", + "description": "Queries to execute concurrently. 1 to 10 queries are allowed.", + "minItems": 1, + "maxItems": 10, + "items": { + "$ref": "#/components/schemas/RumDataQueryDefinition" + } + } + } + }, + "RumDataQueryResponse": { + "type": "object", + "description": "Map from request query ID to that query's result or error.", + "additionalProperties": { + "$ref": "#/components/schemas/RumDataQueryOutput" + } + }, + "RumDataQueryResult": { + "type": "object", + "description": "Rows and metadata returned by one RUM data query.", + "required": [ + "fields", + "values" + ], + "properties": { + "search_after_ctx": { + "type": "string", + "description": "Opaque cursor for continuing paginated table queries." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumDataFieldMeta" + }, + "description": "Column metadata for the values matrix." + }, + "values": { + "type": "array", + "description": "Rows returned by the query. Each row aligns with `fields` by index.", + "items": { + "type": "array", + "items": {} + } + }, + "interval": { + "type": "integer", + "format": "int64", + "description": "Effective time bucket interval in seconds for time-series queries." + }, + "sampling": { + "$ref": "#/components/schemas/RumDataSamplingDecision" + } + } + }, + "RumDataSamplingDecision": { + "type": "object", + "description": "Sampling metadata when the query engine uses sampled data.", + "required": [ + "enabled", + "scale_factor" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether sampling was applied." + }, + "scale_factor": { + "type": "number", + "description": "Multiplier used to scale sampled counts back to estimated full counts." + }, + "selected_tablets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Storage tablets selected for the sampled query." + }, + "aggregate_funcs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumDataAggregateFunction" + }, + "description": "Aggregate functions affected by sampling." + } + } + }, + "RumFacetCountRequest": { + "type": "object", + "description": "Parameters for counting facet value distribution.", + "required": [ + "scope", + "facet_key", + "start_time", + "end_time" + ], + "properties": { + "scope": { + "type": "string", + "description": "RUM data scope to query.", + "enum": [ + "session", + "view", + "action", + "error", + "resource", + "long_task", + "vital", + "issue", + "sourcemap" + ] + }, + "facet_key": { + "type": "string", + "description": "The field key to count value distribution for." + }, + "facet_value": { + "description": "When set, filter events where `facet_key` equals this value before counting. Accepts string, number, or boolean." + }, + "start_time": { + "type": "integer", + "format": "int64", + "description": "Start of the time range, Unix epoch milliseconds.", + "example": 1712620800000 + }, + "end_time": { + "type": "integer", + "format": "int64", + "description": "End of the time range, Unix epoch milliseconds. Maximum 31-day span.", + "example": 1712707200000 + }, + "dql": { + "type": "string", + "description": "RUM DQL filter expression applied before counting." + }, + "sql": { + "type": "string", + "description": "SQL WHERE clause (no SELECT) for additional filtering." + }, + "limit": { + "type": "integer", + "description": "Maximum number of top values to return. Default 100, maximum 100.", + "maximum": 100, + "default": 100 + } + } + }, + "RumFacetCountResponse": { + "type": "object", + "description": "Top N facet values sorted by count descending.", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetCountItem" + } + } + } + }, + "RumFacetListRequest": { + "type": "object", + "description": "Filter parameters for listing RUM field definitions.", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter by RUM data scopes. Valid values: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`." + }, + "is_facet": { + "type": "boolean", + "description": "When true, return only facet-enabled fields. When false or omitted, return all fields." + } + } + }, + "RumFacetListResponse": { + "type": "object", + "description": "List of RUM field definitions.", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumFieldItem" + } + } + } + }, + "RumFieldItem": { + "type": "object", + "description": "A RUM field definition.", + "required": [ + "account_id", + "field_key", + "field_name", + "group", + "description", + "value_type", + "show_type", + "unit_family", + "unit_name", + "edit_able", + "is_facet", + "enum_values", + "scopes", + "status", + "queryable" + ], + "properties": { + "account_id": { + "type": "integer", + "format": "int64", + "description": "Account ID. 0 for built-in fields." + }, + "field_key": { + "type": "string", + "description": "Unique field key, e.g. `error.type`." + }, + "field_name": { + "type": "string", + "description": "Human-readable field name." + }, + "group": { + "type": "string", + "description": "Display group for this field." + }, + "description": { + "type": "string", + "description": "Description of what this field captures." + }, + "value_type": { + "type": "string", + "description": "Data type of the field value.", + "enum": [ + "string", + "number", + "boolean", + "array", + "array", + "array" + ] + }, + "show_type": { + "type": "string", + "description": "Display type in the analytics UI.", + "enum": [ + "list", + "range" + ] + }, + "unit_family": { + "type": "string", + "description": "Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields." + }, + "unit_name": { + "type": "string", + "description": "Specific measurement unit, e.g. `millisecond`, `byte`." + }, + "edit_able": { + "type": "boolean", + "description": "True if this is a custom field that can be edited by the user." + }, + "is_facet": { + "type": "boolean", + "description": "True if value distribution counting is supported for this field." + }, + "enum_values": { + "type": "array", + "description": "Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "RUM scopes this field appears in." + }, + "status": { + "type": "string", + "description": "Field status, e.g. `active`." + }, + "queryable": { + "type": "boolean", + "description": "True if this field can be used in DQL/SQL queries." + } + } + }, + "RumFieldListRequest": { + "type": "object", + "description": "Filter parameters for listing RUM field definitions.", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter by RUM data scopes. Valid values: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`." + }, + "is_facet": { + "type": "boolean", + "description": "When true, return only facet-enabled fields. When false or omitted, return all fields." + } + } + }, + "RumFieldListResponse": { + "type": "object", + "description": "List of RUM field definitions.", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumFieldItem" + } + } + } + }, + "SourcemapBinaryImage": { + "type": "object", + "description": "Loaded binary image from a crash report.", + "required": [ + "uuid", + "name", + "is_system" + ], + "properties": { + "uuid": { + "type": "string", + "description": "Build UUID identifying the binary or dSYM." + }, + "name": { + "type": "string", + "description": "Binary image name." + }, + "is_system": { + "type": "boolean", + "description": "Whether this binary belongs to the operating system." + }, + "load_address": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ], + "description": "Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer." + }, + "max_address": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ], + "description": "Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer." + }, + "arch": { + "type": "string", + "description": "CPU architecture for this binary image." + } + } + }, + "SourcemapCodeSnippet": { + "type": "object", + "description": "One source-code line returned around an enriched frame.", + "required": [ + "line", + "code" + ], + "properties": { + "line": { + "type": "integer", + "description": "Source line number." + }, + "code": { + "type": "string", + "description": "Source code on that line." + } + } + }, + "SourcemapEnrichedFrame": { + "allOf": [ + { + "$ref": "#/components/schemas/SourcemapStackFrame" + }, + { + "type": "object", + "required": [ + "converted" + ], + "properties": { + "converted": { + "type": "boolean", + "description": "Whether the frame was successfully symbolicated or deobfuscated." + }, + "code_snippets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SourcemapCodeSnippet" + }, + "description": "Source-code snippets around this frame." + }, + "original_frame": { + "$ref": "#/components/schemas/SourcemapStackFrame" + }, + "third_party": { + "type": "boolean", + "description": "Whether the frame is from third-party or system libraries." + } + } + } + ] + }, + "SourcemapStackEnrichRequest": { + "type": "object", + "description": "Stack trace enrichment request.", + "required": [ + "service", + "version" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "browser", + "android", + "ios", + "miniprogram", + "harmony" + ], + "description": "Source platform. Defaults to `browser` when omitted." + }, + "service": { + "type": "string", + "description": "Application or service name used when the sourcemap was uploaded." + }, + "version": { + "type": "string", + "description": "Application version used when the sourcemap was uploaded." + }, + "stack": { + "type": "string", + "description": "Raw stack trace to parse and enrich." + }, + "near": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "Number of nearby meaningful source lines to return around converted frames." + }, + "no_cache": { + "type": "boolean", + "description": "Skip cached enrich results. Intended for debugging." + }, + "build_id": { + "type": "string", + "description": "Android build ID for Gradle plugin 1.13.0 and later." + }, + "variant": { + "type": "string", + "description": "Android build variant used by older Gradle plugin versions." + }, + "arch": { + "type": "string", + "description": "Android NDK architecture such as `arm`, `arm64`, `x86`, or `x64`." + }, + "source_type": { + "type": "string", + "description": "Android error source type. Use `ndk` with `arch` for native symbolication." + }, + "binary_images": { + "type": "array", + "description": "Loaded binary images from an iOS crash report.", + "items": { + "$ref": "#/components/schemas/SourcemapBinaryImage" + } + } + } + }, + "SourcemapStackEnrichResponse": { + "type": "object", + "description": "Enriched stack frames.", + "required": [ + "frames" + ], + "properties": { + "frames": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SourcemapEnrichedFrame" + } + } + } + }, + "SourcemapStackFrame": { + "type": "object", + "description": "Parsed stack frame fields shared across platforms.", + "properties": { + "function": { + "type": "string", + "description": "Function or method name." + }, + "file": { + "type": "string", + "description": "Source file, URL, or module path." + }, + "line": { + "type": "integer", + "description": "Line number." + }, + "column": { + "type": "integer", + "description": "Column number for JavaScript or Flutter frames." + }, + "class_name": { + "type": "string", + "description": "Android Java/Kotlin class name." + }, + "method_name": { + "type": "string", + "description": "Android Java/Kotlin method name without class prefix." + }, + "module": { + "type": "string", + "description": "iOS Swift/Objective-C module name." + }, + "address": { + "type": "string", + "description": "iOS or native memory address." + }, + "offset": { + "type": "integer", + "description": "Symbol offset from function start." + }, + "native_address": { + "type": "string", + "description": "Unity IL native address." + } + } } } } diff --git a/openapi/openapi.zh.json b/openapi/openapi.zh.json index 5a26bdf..818be08 100644 --- a/openapi/openapi.zh.json +++ b/openapi/openapi.zh.json @@ -73,18 +73,6 @@ "name": "Monitors/规则集", "description": "管理 Monitors 规则仓库中的共享规则集,规则集可在账户内或公开共享。" }, - { - "name": "RUM/应用管理", - "description": "管理前端性能监控(RUM)应用。" - }, - { - "name": "RUM/RUM 问题跟踪", - "description": "查询和管理 RUM 异常追踪 Issue 及预设严重性规则。" - }, - { - "name": "RUM/RUM Sourcemap", - "description": "管理和查询用于 Browser、Android、iOS 错误符号化的 RUM Sourcemap 文件。" - }, { "name": "平台/成员管理", "description": "" @@ -135,6 +123,26 @@ }, { "name": "AI SRE/Automations" + }, + { + "name": "RUM/应用管理", + "description": "管理前端性能监控(RUM)应用。" + }, + { + "name": "RUM/RUM 数据查询", + "description": "对 RUM 事件数据执行分析查询。" + }, + { + "name": "RUM/RUM 问题跟踪", + "description": "查询和管理 RUM 异常追踪 Issue 及预设严重性规则。" + }, + { + "name": "RUM/RUM 自定义字段", + "description": "查询 RUM 自定义字段及其值分布,用于构建分析过滤条件。" + }, + { + "name": "RUM/RUM Sourcemap", + "description": "管理和查询用于 Browser、Android、iOS 错误符号化的 RUM Sourcemap 文件。" } ], "paths": { @@ -597,7 +605,7 @@ "On-call/故障管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **故障查看**(`on-call`) |\n\n## 使用说明\n\n- 仅在需要预览每条告警的原始事件时设置 `include_events=true`。\n- 事件预览最多返回每条告警最新的 20 条事件;完整事件历史请使用 `POST /alert/event/list` 分页查询。\n- `event_cnt` 仍表示合并到每条告警的原始事件总数。", "href": "/zh/api-reference/on-call/incidents/incident-alert-list", "metadata": { "sidebarTitle": "查询故障关联告警" @@ -666,7 +674,20 @@ "images": null, "data_source_name": "FlashMonit", "data_source_type": "monit.alert", - "data_source_ref_id": "a_2451002751131" + "data_source_ref_id": "a_2451002751131", + "events": [ + { + "event_id": "69da451df77b1b51f40e83df", + "alert_id": "69da451df77b1b51f40e83de", + "title": "CPU 使用率 > 90%", + "event_severity": "Critical", + "event_status": "Critical", + "event_time": 1712650000, + "labels": { + "host": "web-01" + } + } + ] } ] } @@ -698,7 +719,8 @@ "incident_id": "69da451ef77b1b51f40e83ee", "is_active": true, "limit": 100, - "p": 1 + "p": 1, + "include_events": true } } } @@ -6060,12 +6082,12 @@ "post": { "operationId": "alert-read-event-list", "summary": "查询告警事件列表", - "description": "返回特定告警收到的所有原始事件,按时间顺序排列。", + "description": "通过游标或页码分页返回指定告警的原始事件。", "tags": [ "On-call/告警管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 每条告警会从集成持续接收原始事件,此接口展示指定告警的原始事件历史。", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **协作空间查看**(`on-call`) |\n\n## 使用说明\n\n- 默认按最新事件优先返回;设置 `asc=true` 可按最早事件优先读取。\n- 使用上次响应中的 `search_after_ctx` 搭配 `limit` 获取下一页。\n- 也支持通过 `p` 使用页码分页,但 `p * limit` 必须在 10,000 条以内。\n- 单条告警可能累积大量原始事件,热点告警建议优先使用游标分页。", "href": "/zh/api-reference/on-call/alerts/alert-read-event-list", "metadata": { "sidebarTitle": "查询告警事件列表" @@ -6094,6 +6116,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "total": 57, + "has_next_page": true, + "search_after_ctx": "663a1b2c3d4e5f6789abc001", "items": [ { "event_id": "663a1b2c3d4e5f6789abc001", @@ -6133,7 +6158,8 @@ "$ref": "#/components/schemas/AlertEventListRequest" }, "example": { - "alert_id": "663a1b2c3d4e5f6789abcdef" + "alert_id": "663a1b2c3d4e5f6789abcdef", + "limit": 20 } } } @@ -15604,19 +15630,19 @@ } } }, - "/rum/application/list": { + "/rum/facet/count": { "post": { - "operationId": "rum-application-read-list", - "summary": "查询应用列表", - "description": "返回当前用户可访问的 RUM 应用分页列表。", + "operationId": "rum-read-facet-count", + "summary": "查询分值分布", + "description": "按出现次数降序返回指定时间范围内某个分面字段的 Top N 值及其计数。", "tags": [ - "RUM/应用管理" + "RUM/RUM 自定义字段" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `is_my_team` 可过滤当前用户所在团队的应用。\n- 默认每页 20 条,最大 100 条。\n- `orderby` 支持 `created_at` 或 `updated_at`。", - "href": "/zh/api-reference/rum/applications/rum-application-read-list", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `POST /rum/facet/list` 发现每个 scope 下可用的 `facet_key` 值。\n- `scope` 必须是以下之一:`session`、`view`、`action`、`error`、`resource`、`long_task`、`vital`、`issue`、`sourcemap`。\n- 传入 `dql` 可在统计前进一步过滤事件,DQL 语法遵循 RUM 查询语言。\n- 传入 `sql` 可使用仅含 WHERE 子句(无 SELECT)的 SQL 风格过滤。\n- 默认 limit 为 100,最大 100。\n- 时间范围必填(`start_time` / `end_time` 为 Unix 毫秒时间戳),最大跨度 31 天。", + "href": "/zh/api-reference/rum/facets/rum-read-facet-count", "metadata": { - "sidebarTitle": "查询应用列表" + "sidebarTitle": "查询分值分布" } }, "responses": { @@ -15633,7 +15659,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationListResponse" + "$ref": "#/components/schemas/RumFacetCountResponse" } } } @@ -15642,65 +15668,18 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "has_next_page": true, - "total": 7, "items": [ { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 + "facet_value": "TypeError", + "count": 1523 }, { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 + "facet_value": "ReferenceError", + "count": 342 + }, + { + "facet_value": "SyntaxError", + "count": 89 } ] } @@ -15726,32 +15705,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationListRequest" + "$ref": "#/components/schemas/RumFacetCountRequest" }, "example": { - "p": 1, - "limit": 20, - "query": "", - "is_my_team": false + "scope": "error", + "facet_key": "error.type", + "start_time": 1712620800000, + "end_time": 1712707200000, + "limit": 10 } } } } } }, - "/rum/application/info": { + "/rum/application/webhook/test": { "post": { - "operationId": "rum-application-read-info", - "summary": "查看应用详情", - "description": "通过 `application_id` 获取单个 RUM 应用的完整信息。", + "operationId": "rum-application-webhook-test", + "summary": "测试应用 Webhook", + "description": "发送一条 RUM 告警样例事件,用于验证应用的 Webhook URL。", "tags": [ "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/rum/applications/rum-application-read-info", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 接口会先校验 URL,再发送样例事件。\n- 投递失败时仍返回 HTTP 200,但 `ok=false`,错误原因在 `message` 中。", + "href": "/zh/api-reference/rum/applications/rum-application-webhook-test", "metadata": { - "sidebarTitle": "查看应用详情" + "sidebarTitle": "测试应用 Webhook" } }, "responses": { @@ -15768,7 +15748,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationItem" + "$ref": "#/components/schemas/RumWebhookTestResponse" } } } @@ -15777,32 +15757,9 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 + "ok": true, + "status_code": 200, + "message": "ok" } } } @@ -15814,6 +15771,9 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, "429": { "$ref": "#/components/responses/TooManyRequests" }, @@ -15826,29 +15786,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RumWebhookTestRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o" + "application_id": "rum-app-prod", + "webhook_url": "https://hooks.example.com/rum-alerts" } } } } } }, - "/rum/application/infos": { + "/rum/issue/info": { "post": { - "operationId": "rum-application-read-infos", - "summary": "批量查询应用详情", - "description": "通过 ID 列表批量获取多个 RUM 应用的详情。", + "operationId": "rum-issue-read-info", + "summary": "查看 Issue 详情", + "description": "通过 `issue_id` 获取单个 Issue 的完整信息。", "tags": [ - "RUM/应用管理" + "RUM/RUM 问题跟踪" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 每次请求最多传入 200 个 ID。", - "href": "/zh/api-reference/rum/applications/rum-application-read-infos", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", + "href": "/zh/api-reference/rum/issues/rum-issue-read-info", "metadata": { - "sidebarTitle": "批量查询应用详情" + "sidebarTitle": "查看 Issue 详情" } }, "responses": { @@ -15865,7 +15826,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationInfosResponse" + "$ref": "#/components/schemas/RumIssueItem" } } } @@ -15874,65 +15835,42 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "items": [ - { - "account_id": 2451002751131, - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "type": "browser", - "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", - "team_id": 2477033058131, - "is_private": false, - "no_ip": false, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 5962711836131, - 5967875767131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": true, - "open_type": "popup", - "endpoint": "https://www.tracing.com/${trace_id}" - }, - "status": "enabled", - "created_by": 2476444212131, - "updated_by": 3122470302131, - "created_at": 1742958482000, - "updated_at": 1772096392711 - }, - { - "account_id": 2451002751131, - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "flashcat-rum", - "type": "browser", - "client_token": "a3cea433a8685a398cdfd68f54a45e06131", - "team_id": 2477033058131, - "is_private": true, - "no_ip": true, - "no_geo": false, - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 - ], - "integration_id": 4759595678131 - }, - "tracing": { - "enabled": false, - "open_type": "", - "endpoint": "" - }, - "status": "enabled", - "created_by": 4441703362131, - "updated_by": 3790925372131, - "created_at": 1746673831462, - "updated_at": 1773398630657 - } - ] + "team_id": 2477033058131, + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "service": "fd-console", + "status": "for_review", + "error_count": 752, + "session_count": 381, + "is_crash": false, + "age": 5078684, + "resolved_at": 0, + "resolved_by": 0, + "created_at": 1770883154944, + "updated_at": 1775961914595, + "first_seen": { + "timestamp": 1770883154944, + "version": "1.0.0" + }, + "last_seen": { + "timestamp": 1775961839090, + "version": "1.0.0" + }, + "error": { + "message": "Script error.", + "type": "Error" + }, + "suspected_cause": { + "source": "auto", + "value": "code.exception", + "reason": "错误信息 'Script error.' 通常表示 JavaScript 中的未处理异常。", + "person_id": 0 + }, + "versions": [ + "1.0.0" + ], + "severity": "Info" } } } @@ -15956,32 +15894,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationInfosRequest" + "$ref": "#/components/schemas/RumIssueIDRequest" }, "example": { - "application_ids": [ - "eWbr4xk3ZRnLabRa6unqwD", - "WoyQQ3BohkdtPivubEvE8o" - ] + "issue_id": "NHEacQHi2DhXqobr9qPQz9" } } } } } }, - "/rum/application/create": { + "/rum/application/list": { "post": { - "operationId": "rum-application-write-create", - "summary": "创建应用", - "description": "创建新的 RUM 应用,返回生成的 `application_id` 和 `client_token`。", + "operationId": "rum-application-read-list", + "summary": "查询应用列表", + "description": "返回当前用户可访问的 RUM 应用分页列表。", "tags": [ "RUM/应用管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- `type` 须为以下之一:`browser`、`ios`、`android`、`react-native`、`flutter`、`kotlin-multiplatform`、`roku`、`unity`。\n- `client_token` 自动生成,用于初始化 RUM SDK。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/applications/rum-application-write-create", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `is_my_team` 可过滤当前用户所在团队的应用。\n- 默认每页 20 条,最大 100 条。\n- `orderby` 支持 `created_at` 或 `updated_at`。", + "href": "/zh/api-reference/rum/applications/rum-application-read-list", "metadata": { - "sidebarTitle": "创建应用" + "sidebarTitle": "查询应用列表" } }, "responses": { @@ -15998,7 +15933,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumApplicationCreateResponse" + "$ref": "#/components/schemas/RumApplicationListResponse" } } } @@ -16007,9 +15942,88 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA", - "application_name": "我的 Web 应用", - "client_token": "e090078724855a4ca168c3884880dfbc131" + "has_next_page": true, + "total": 7, + "items": [ + { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + }, + { + "account_id": 2451002751131, + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711, + "links": { + "enabled": false, + "systems": [] + } + } + ] } } } @@ -16033,32 +16047,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationCreateRequest" + "$ref": "#/components/schemas/RumApplicationListRequest" }, "example": { - "application_name": "我的 Web 应用", - "type": "browser", - "team_id": 2477033058131, - "is_private": false + "p": 1, + "limit": 20, + "query": "", + "is_my_team": false } } } } } }, - "/rum/application/update": { + "/rum/facet/list": { "post": { - "operationId": "rum-application-write-update", - "summary": "更新应用", - "description": "更新已有 RUM 应用,除 `application_id` 外均为可选,仅更新提供的字段。", + "operationId": "rum-read-facet-list", + "summary": "查询分面列表", + "description": "返回所有可用的 RUM 字段定义,可按 scope 和是否为分面字段过滤。", "tags": [ - "RUM/应用管理" + "RUM/RUM 自定义字段" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/applications/rum-application-write-update", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用返回的 `field_key` 作为 `POST /rum/facet/count` 的 `facet_key` 参数。\n- 合法的 `scopes` 值为:`session`、`view`、`action`、`error`、`resource`、`long_task`、`vital`、`issue`、`sourcemap`。\n- 设置 `is_facet: true` 只返回支持分面查询的字段(即支持值分布统计的字段)。", + "href": "/zh/api-reference/rum/facets/rum-read-facet-list", "metadata": { - "sidebarTitle": "更新应用" + "sidebarTitle": "查询分面列表" } }, "responses": { @@ -16075,7 +16089,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RumFacetListResponse" } } } @@ -16083,7 +16097,29 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "items": [ + { + "account_id": 0, + "field_key": "error.type", + "field_name": "Error type", + "group": "Error", + "description": "错误类型。", + "value_type": "string", + "show_type": "list", + "unit_family": "", + "unit_name": "", + "edit_able": false, + "is_facet": true, + "enum_values": [], + "scopes": [ + "error" + ], + "status": "active", + "queryable": true + } + ] + } } } } @@ -16106,36 +16142,132 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationUpdateRequest" + "$ref": "#/components/schemas/RumFacetListRequest" }, "example": { - "application_id": "WoyQQ3BohkdtPivubEvE8o", - "application_name": "我的 Web 应用 v2", - "alerting": { - "enabled": true, - "channel_ids": [ - 2490121812131 + "scopes": [ + "error" + ], + "is_facet": true + } + } + } + } + } + }, + "/sourcemap/stack/enrich": { + "post": { + "operationId": "sourcemap-read-stack-enrich", + "summary": "丰富错误栈信息", + "description": "对 Browser、Android、iOS、小程序或 HarmonyOS 错误栈进行符号化或反混淆。", + "tags": [ + "RUM/RUM Sourcemap" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 为兼容旧调用,省略 `type` 时默认按 `browser` 处理。\n- 设置 1 到 20 之间的 `near` 可在转换后的栈帧附近返回源码片段。\n- Android NDK native 崩溃需传入 `arch` 和 `source_type: ndk`,后端会路由到 native 符号化逻辑。\n- iOS 崩溃栈需传入 `binary_images`,以便按上传的 dSYM 文件重定位地址。\n- `no_cache` 主要用于调试,会绕过已缓存的 enrich 结果。", + "href": "/zh/api-reference/rum/sourcemaps/sourcemap-read-stack-enrich", + "metadata": { + "sidebarTitle": "丰富错误栈信息" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SourcemapStackEnrichResponse" + } + } + } ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "frames": [ + { + "function": "renderCheckout", + "file": "src/pages/checkout.tsx", + "line": 42, + "column": 17, + "converted": true, + "code_snippets": [ + { + "line": 41, + "code": "const cart = props.cart;" + }, + { + "line": 42, + "code": "return cart.items.map(renderItem);" + } + ], + "original_frame": { + "function": "render", + "file": "https://cdn.example.com/app.min.js", + "line": 1, + "column": 2345 + } + } + ] + } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SourcemapStackEnrichRequest" + }, + "example": { + "type": "browser", + "service": "my-web-app", + "version": "1.0.0", + "stack": "TypeError: Cannot read properties of undefined\n at render (https://cdn.example.com/app.min.js:1:2345)", + "near": 3 + } + } } } } }, - "/rum/application/delete": { + "/rum/data/query": { "post": { - "operationId": "rum-application-write-delete", - "summary": "删除应用", - "description": "通过 `application_id` 删除 RUM 应用。", + "operationId": "rum-read-data-query", + "summary": "查询 RUM 数据", + "description": "在指定时间范围内执行一个或多个 SQL 风格的 RUM 数据查询。", "tags": [ - "RUM/应用管理" + "RUM/RUM 数据查询" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/applications/rum-application-write-delete", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 单次请求可提交 1 到 10 个查询;每个查询的 `id` 会成为响应对象中的 key。\n- `start_time` 和 `end_time` 必填,均为 Unix 毫秒时间戳;最大时间范围为 31 天。\n- 使用 `format: table` 返回表格结果,使用 `format: time_series` 返回按时间桶聚合的时序结果。\n- 当 `format: time_series` 时,省略 `interval` 会默认使用 3600 秒,省略 `max_points` 会默认使用 1226。\n- 分页表格查询会返回 `search_after_ctx`,继续扫描时可原样传回。", + "href": "/zh/api-reference/rum/data-query/rum-read-data-query", "metadata": { - "sidebarTitle": "删除应用" + "sidebarTitle": "查询 RUM 数据" } }, "responses": { @@ -16152,7 +16284,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/EmptyResponse" + "$ref": "#/components/schemas/RumDataQueryResponse" } } } @@ -16160,7 +16292,34 @@ }, "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "data": { + "errors_by_type": { + "data": { + "fields": [ + { + "name": "error.type", + "type": "String", + "nullable": false + }, + { + "name": "errors", + "type": "UInt64", + "nullable": false + } + ], + "values": [ + [ + "TypeError", + 1523 + ], + [ + "ReferenceError", + 342 + ] + ] + } + } + } } } } @@ -16183,10 +16342,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumApplicationIDRequest" + "$ref": "#/components/schemas/RumDataQueryRequest" }, "example": { - "application_id": "qLpu24Dz4CAzWsESPbJYWA" + "start_time": 1712620800000, + "end_time": 1712707200000, + "queries": [ + { + "id": "errors_by_type", + "sql": "SELECT error.type, count(*) AS errors FROM error GROUP BY error.type ORDER BY errors DESC LIMIT 10", + "format": "table", + "time_zone": "Asia/Shanghai" + } + ] } } } @@ -16354,19 +16522,339 @@ } } }, - "/rum/issue/info": { + "/rum/issue/update": { "post": { - "operationId": "rum-issue-read-info", - "summary": "查看 Issue 详情", - "description": "通过 `issue_id` 获取单个 Issue 的完整信息。", + "operationId": "rum-issue-write-update", + "summary": "更新 Issue", + "description": "更新 Issue 的状态或疑似原因。", "tags": [ "RUM/RUM 问题跟踪" ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `status` 可选值:`for_review`、`reviewed`、`ignored`、`resolved`。\n- `suspected_cause` 可选值:`api.failed_request`、`network.error`、`code.exception`、`code.invalid_object_access`、`code.invalid_argument`、`unknown`。\n- 将 `status` 设为 `resolved` 会同时记录 `resolved_at` 和 `resolved_by`;从 resolved 切回其他状态则会清空这两个字段。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/issues/rum-issue-write-update", + "metadata": { + "sidebarTitle": "更新 Issue" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumIssueUpdateRequest" + }, + "example": { + "issue_id": "NHEacQHi2DhXqobr9qPQz9", + "status": "resolved" + } + } + } + } + } + }, + "/rum/application/infos": { + "post": { + "operationId": "rum-application-read-infos", + "summary": "批量查询应用详情", + "description": "通过 ID 列表批量获取多个 RUM 应用的详情。", + "tags": [ + "RUM/应用管理" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 每次请求最多传入 200 个 ID。", + "href": "/zh/api-reference/rum/applications/rum-application-read-infos", + "metadata": { + "sidebarTitle": "批量查询应用详情" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/RumApplicationInfosResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "account_id": 2451002751131, + "application_id": "eWbr4xk3ZRnLabRa6unqwD", + "application_name": "Flashduty DEV", + "type": "browser", + "client_token": "ce8d1be90fc6534f89ce36ebf526765e131", + "team_id": 2477033058131, + "is_private": false, + "no_ip": false, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 5962711836131, + 5967875767131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": true, + "open_type": "popup", + "endpoint": "https://www.tracing.com/${trace_id}" + }, + "status": "enabled", + "created_by": 2476444212131, + "updated_by": 3122470302131, + "created_at": 1742958482000, + "updated_at": 1772096392711, + "links": { + "enabled": false, + "systems": [] + } + }, + { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", + "team_id": 2477033058131, + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 + }, + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" + }, + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationInfosRequest" + }, + "example": { + "application_ids": [ + "eWbr4xk3ZRnLabRa6unqwD", + "WoyQQ3BohkdtPivubEvE8o" + ] + } + } + } + } + } + }, + "/rum/field/list": { + "post": { + "operationId": "rum-read-field-list", + "summary": "查询字段列表", + "description": "返回 RUM 字段定义,可按 scope 和是否为分面字段过滤。", + "tags": [ + "RUM/RUM 自定义字段" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 这是当前字段模型下用于发现 RUM 字段的路由。\n- 返回的 `field_key` 可用于 RUM 数据查询和分面值统计请求。\n- 设置 `is_facet: true` 只返回支持值分布统计的字段。", + "href": "/zh/api-reference/rum/facets/rum-read-field-list", + "metadata": { + "sidebarTitle": "查询字段列表" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/RumFieldListResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "items": [ + { + "account_id": 0, + "field_key": "error.type", + "field_name": "Error type", + "group": "Error", + "description": "错误类型。", + "value_type": "string", + "show_type": "list", + "unit_family": "", + "unit_name": "", + "edit_able": false, + "is_facet": true, + "enum_values": [], + "scopes": [ + "error" + ], + "status": "active", + "queryable": true + } + ] + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumFieldListRequest" + }, + "example": { + "scopes": [ + "error" + ], + "is_facet": false + } + } + } + } + } + }, + "/rum/application/info": { + "post": { + "operationId": "rum-application-read-info", + "summary": "查看应用详情", + "description": "通过 `application_id` 获取单个 RUM 应用的完整信息。", + "tags": [ + "RUM/应用管理" + ], "x-mint": { "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |", - "href": "/zh/api-reference/rum/issues/rum-issue-read-info", + "href": "/zh/api-reference/rum/applications/rum-application-read-info", "metadata": { - "sidebarTitle": "查看 Issue 详情" + "sidebarTitle": "查看应用详情" } }, "responses": { @@ -16383,7 +16871,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/RumIssueItem" + "$ref": "#/components/schemas/RumApplicationItem" } } } @@ -16392,42 +16880,193 @@ "example": { "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", "data": { + "account_id": 2451002751131, + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "flashcat-rum", + "type": "browser", + "client_token": "a3cea433a8685a398cdfd68f54a45e06131", "team_id": 2477033058131, - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "application_id": "eWbr4xk3ZRnLabRa6unqwD", - "application_name": "Flashduty DEV", - "service": "fd-console", - "status": "for_review", - "error_count": 752, - "session_count": 381, - "is_crash": false, - "age": 5078684, - "resolved_at": 0, - "resolved_by": 0, - "created_at": 1770883154944, - "updated_at": 1775961914595, - "first_seen": { - "timestamp": 1770883154944, - "version": "1.0.0" + "is_private": true, + "no_ip": true, + "no_geo": false, + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 + ], + "integration_id": 4759595678131 }, - "last_seen": { - "timestamp": 1775961839090, - "version": "1.0.0" + "tracing": { + "enabled": false, + "open_type": "", + "endpoint": "" }, - "error": { - "message": "Script error.", - "type": "Error" + "status": "enabled", + "created_by": 4441703362131, + "updated_by": 3790925372131, + "created_at": 1746673831462, + "updated_at": 1773398630657, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationIDRequest" + }, + "example": { + "application_id": "WoyQQ3BohkdtPivubEvE8o" + } + } + } + } + } + }, + "/rum/application/delete": { + "post": { + "operationId": "rum-application-write-delete", + "summary": "删除应用", + "description": "通过 `application_id` 删除 RUM 应用。", + "tags": [ + "RUM/应用管理" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/applications/rum-application-write-delete", + "metadata": { + "sidebarTitle": "删除应用" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" }, - "suspected_cause": { - "source": "auto", - "value": "code.exception", - "reason": "错误信息 'Script error.' 通常表示 JavaScript 中的未处理异常。", - "person_id": 0 + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationIDRequest" + }, + "example": { + "application_id": "qLpu24Dz4CAzWsESPbJYWA" + } + } + } + } + } + }, + "/rum/application/create": { + "post": { + "operationId": "rum-application-write-create", + "summary": "创建应用", + "description": "创建新的 RUM 应用,返回生成的 `application_id` 和 `client_token`。", + "tags": [ + "RUM/应用管理" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- `type` 须为以下之一:`browser`、`ios`、`android`、`react-native`、`flutter`、`kotlin-multiplatform`、`roku`、`unity`。\n- `links.systems[].url` 必须以 `http` 或 `https` 开头;`${var}` 变量会根据 RUM 事件上下文解析。\n- `links.systems[].event_types` 支持:`crash`、`error`、`view`、`action`、`resource`、`session`、`all`。\n- `client_token` 自动生成,用于初始化 RUM SDK。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/applications/rum-application-write-create", + "metadata": { + "sidebarTitle": "创建应用" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" }, - "versions": [ - "1.0.0" - ], - "severity": "Info" + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/RumApplicationCreateResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": { + "application_id": "qLpu24Dz4CAzWsESPbJYWA", + "application_name": "我的 Web 应用", + "client_token": "e090078724855a4ca168c3884880dfbc131" } } } @@ -16451,83 +17090,126 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RumIssueIDRequest" + "$ref": "#/components/schemas/RumApplicationCreateRequest" + }, + "example": { + "application_name": "我的 Web 应用", + "type": "browser", + "team_id": 2477033058131, + "is_private": false, + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] + } + } + } + } + } + } + }, + "/rum/application/update": { + "post": { + "operationId": "rum-application-write-update", + "summary": "更新应用", + "description": "更新已有 RUM 应用,除 `application_id` 外均为可选,仅更新提供的字段。", + "tags": [ + "RUM/应用管理" + ], + "x-mint": { + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- `links.systems[].url` 必须以 `http` 或 `https` 开头;`${var}` 变量会根据 RUM 事件上下文解析。\n- `links.systems[].event_types` 支持:`crash`、`error`、`view`、`action`、`resource`、`session`、`all`。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", + "href": "/zh/api-reference/rum/applications/rum-application-write-update", + "metadata": { + "sidebarTitle": "更新应用" + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/SuccessEnvelope" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/EmptyResponse" + } + } + } + ] + }, + "example": { + "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", + "data": {} + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "500": { + "$ref": "#/components/responses/ServerError" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RumApplicationUpdateRequest" }, "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9" - } - } - } - } - } - }, - "/rum/issue/update": { - "post": { - "operationId": "rum-issue-write-update", - "summary": "更新 Issue", - "description": "更新 Issue 的状态或疑似原因。", - "tags": [ - "RUM/RUM 问题跟踪" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- `status` 可选值:`for_review`、`reviewed`、`ignored`、`resolved`。\n- `suspected_cause` 可选值:`api.failed_request`、`network.error`、`code.exception`、`code.invalid_object_access`、`code.invalid_argument`、`unknown`。\n- 将 `status` 设为 `resolved` 会同时记录 `resolved_at` 和 `resolved_by`;从 resolved 切回其他状态则会清空这两个字段。\n- 每次调用都会记录到账户审计日志,请不要把敏感信息放在请求字段中。", - "href": "/zh/api-reference/rum/issues/rum-issue-write-update", - "metadata": { - "sidebarTitle": "更新 Issue" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/EmptyResponse" - } - } - } + "application_id": "WoyQQ3BohkdtPivubEvE8o", + "application_name": "我的 Web 应用 v2", + "alerting": { + "enabled": true, + "channel_ids": [ + 2490121812131 ] }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": {} + "links": { + "enabled": true, + "systems": [ + { + "id": "s3-crash-logs", + "name": "S3 Crash Logs", + "icon_text": "S3", + "icon_color": "#0F766E", + "url": "https://s3.example.com/logs?app=${application_id}&trace=${trace_id}", + "event_types": [ + "crash", + "error" + ], + "enabled": true + } + ] } } } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RumIssueUpdateRequest" - }, - "example": { - "issue_id": "NHEacQHi2DhXqobr9qPQz9", - "status": "resolved" - } - } } } } @@ -23540,81 +24222,6 @@ } } }, - "/rum/application/webhook/test": { - "post": { - "operationId": "rum-application-webhook-test", - "summary": "测试应用 Webhook", - "description": "发送一条 RUM 告警样例事件,用于验证应用的 Webhook URL。", - "tags": [ - "RUM/应用管理" - ], - "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **应用管理**(`rum`) |\n\n## 使用说明\n\n- 接口会先校验 URL,再发送样例事件。\n- 投递失败时仍返回 HTTP 200,但 `ok=false`,错误原因在 `message` 中。", - "href": "/zh/api-reference/rum/applications/rum-application-webhook-test", - "metadata": { - "sidebarTitle": "测试应用 Webhook" - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/SuccessEnvelope" - }, - { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/RumWebhookTestResponse" - } - } - } - ] - }, - "example": { - "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4", - "data": { - "ok": true, - "status_code": 200, - "message": "ok" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests" - }, - "500": { - "$ref": "#/components/responses/ServerError" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RumWebhookTestRequest" - }, - "example": { - "application_id": "rum-app-prod", - "webhook_url": "https://hooks.example.com/rum-alerts" - } - } - } - } - } - }, "/status-page/info": { "get": { "operationId": "statusPageInfo", @@ -25418,7 +26025,7 @@ "schemas": { "ErrorCode": { "type": "string", - "description": "Flashduty error code enum. Every failed API response sets `error.code` to one of these values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.", + "description": "Flashduty 错误码枚举。每个失败响应的 `error.code` 都是下列稳定值之一,HTTP 状态码仅作参考。\n\n| 错误码 | HTTP | 含义 |\n|---|---|---|\n| `OK` | 200 | 保留值,正常错误响应不会返回。 |\n| `InvalidParameter` | 400 | 必填参数缺失或未通过校验。 |\n| `BadRequest` | 400 | 通用的 400 错误,通常是请求本身不合法。 |\n| `InvalidContentType` | 400 | 请求头 `Content-Type` 不是 `application/json`。 |\n| `ResourceNotFound` | 400 | 目标资源不存在。注意 HTTP 状态码是 400 而非 404(历史设计)。 |\n| `NoLicense` | 400 | 功能需要有效授权,但未找到可用的 license。 |\n| `ReferenceExist` | 400 | 该资源仍被其他实体引用,无法删除。 |\n| `Unauthorized` | 401 | `app_key` 缺失、无效或已过期。 |\n| `BalanceNotEnough` | 402 | 账户余额不足,无法执行需要计费的操作。 |\n| `AccessDenied` | 403 | 身份认证通过,但 RBAC 权限不足以执行该操作。 |\n| `RouteNotFound` | 404 | 请求的 URL 路径不是已知路由。 |\n| `MethodNotAllowed` | 405 | 当前路径不接受所使用的 HTTP 方法。 |\n| `UndonedOrderExist` | 409 | 账户存在未完成的订单,请稍后重试。 |\n| `RequestLocked` | 423 | 因连续失败被临时锁定。 |\n| `EntityTooLarge` | 413 | 请求体超过允许的最大长度。 |\n| `RequestTooFrequently` | 429 | 命中限流(全局、账户级或集成级)。 |\n| `RequestVerifyRequired` | 428 | 操作需要二次验证码,但未提供。 |\n| `DangerousOperation` | 428 | 危险操作,需要进行 MFA 验证。 |\n| `InternalError` | 500 | 服务端未预期错误。反馈问题请附上 `request_id`。 |\n| `ServiceUnavailable` | 503 | 后端依赖不可用,请稍后重试。 |", "enum": [ "OK", "InvalidParameter", @@ -25440,18 +26047,42 @@ "DangerousOperation", "InternalError", "ServiceUnavailable" - ] + ], + "x-enumDescriptions": { + "OK": "保留值,正常错误响应不会返回。", + "InvalidParameter": "必填参数缺失或未通过校验。", + "BadRequest": "通用的 400 错误,通常是请求本身不合法。", + "InvalidContentType": "请求头 `Content-Type` 不是 `application/json`。", + "ResourceNotFound": "目标资源不存在。注意 HTTP 状态码是 400 而非 404(历史设计)。", + "NoLicense": "功能需要有效授权,但未找到可用的 license。", + "ReferenceExist": "该资源仍被其他实体引用,无法删除。", + "Unauthorized": "`app_key` 缺失、无效或已过期。", + "BalanceNotEnough": "账户余额不足,无法执行需要计费的操作。", + "AccessDenied": "身份认证通过,但 RBAC 权限不足以执行该操作。", + "RouteNotFound": "请求的 URL 路径不是已知路由。", + "MethodNotAllowed": "当前路径不接受所使用的 HTTP 方法。", + "UndonedOrderExist": "账户存在未完成的订单,请稍后重试。", + "RequestLocked": "因连续失败被临时锁定。", + "EntityTooLarge": "请求体超过允许的最大长度。", + "RequestTooFrequently": "命中限流(全局、账户级或集成级)。", + "RequestVerifyRequired": "操作需要二次验证码,但未提供。", + "DangerousOperation": "危险操作,需要进行 MFA 验证。", + "InternalError": "服务端未预期错误。反馈问题请附上 `request_id`。", + "ServiceUnavailable": "后端依赖不可用,请稍后重试。" + }, + "example": "InvalidParameter" }, "DutyError": { "type": "object", - "description": "Error payload inside the response envelope. Present only on non-2xx responses.", + "description": "响应结构中的错误 payload,仅在非 2xx 响应时出现。", "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "type": "string", - "description": "Human-readable error message, localized by the caller's Accept-Language. May contain field names, IDs, or other context from the failing request." + "description": "用户可读的错误描述,语言会跟随调用方的 Accept-Language。可能包含字段名、ID 等请求上下文。", + "example": "The specified parameter template_id is not valid." } }, "required": [ @@ -25479,7 +26110,7 @@ }, "ErrorResponse": { "type": "object", - "description": "Response envelope for errors. `error` is required; `data` is absent.", + "description": "错误响应结构。`error` 必填,`data` 不存在。", "properties": { "request_id": { "type": "string", @@ -26106,7 +26737,7 @@ "items": { "$ref": "#/components/schemas/AlertEventItem" }, - "description": "原始告警事件,调用方显式请求时返回。" + "description": "原始告警事件预览,仅在调用方请求时返回;每条告警最多返回最新 20 条。" }, "event_cnt": { "type": "integer", @@ -26730,7 +27361,7 @@ }, "include_events": { "type": "boolean", - "description": "true 时返回每条告警下的原始事件。" + "description": "为 true 时,在每条告警中最多返回最新 20 条原始事件作为预览。" }, "is_active": { "type": [ @@ -31412,18 +32043,63 @@ "properties": { "alert_id": { "type": "string", - "description": "告警 ID(ObjectID 十六进制字符串)。" + "pattern": "^[0-9a-fA-F]{24}$", + "description": "告警 ID(MongoDB ObjectID)。" + }, + "asc": { + "type": "boolean", + "default": false, + "description": "为 true 时按最早事件优先返回;默认按最新事件优先返回。" + }, + "limit": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 100, + "default": 20, + "description": "分页大小,默认 20,最大 100。" + }, + "p": { + "type": "integer", + "format": "int64", + "minimum": 0, + "default": 1, + "description": "页码,从 1 开始;未传 `search_after_ctx` 时生效。" + }, + "search_after_ctx": { + "type": "string", + "pattern": "^[0-9a-fA-F]{24}$", + "description": "上一页响应返回的游标;传入后使用游标分页而非页码分页。" } } }, "AlertEventListResponse": { "type": "object", + "required": [ + "items", + "total", + "has_next_page" + ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/AlertEventItem" - } + }, + "description": "按请求顺序返回的原始告警事件。" + }, + "total": { + "type": "integer", + "format": "int64", + "description": "命中的事件总数。" + }, + "has_next_page": { + "type": "boolean", + "description": "是否还有下一页。" + }, + "search_after_ctx": { + "type": "string", + "description": "下一页请求可作为 `search_after_ctx` 传入的游标。" } } }, @@ -38573,6 +39249,79 @@ } } }, + "RumApplicationLink": { + "type": "object", + "description": "在匹配的 RUM 事件详情页展示的外部系统链接。", + "required": [ + "name", + "url", + "event_types" + ], + "properties": { + "id": { + "type": "string", + "description": "外部系统的稳定客户端标识。" + }, + "name": { + "type": "string", + "description": "外部系统显示名称。" + }, + "icon_text": { + "type": "string", + "description": "链接图标中显示的短文本。" + }, + "icon_color": { + "type": "string", + "description": "链接图标显示颜色。" + }, + "url": { + "type": "string", + "format": "uri", + "description": "HTTP 或 HTTPS URL 模板,`${var}` 变量会根据 RUM 事件上下文解析。" + }, + "event_types": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "enum": [ + "crash", + "error", + "view", + "action", + "resource", + "session", + "all" + ] + }, + "description": "展示该外部系统链接的 RUM 事件类型。" + }, + "enabled": { + "type": "boolean", + "description": "是否启用该外部系统链接。" + } + } + }, + "RumApplicationLinks": { + "type": "object", + "description": "应用的外部链接集成配置。", + "properties": { + "enabled": { + "type": "boolean", + "description": "是否启用外部链接集成。" + }, + "systems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/RumApplicationLink" + }, + "description": "可从匹配 RUM 事件打开的外部系统 URL 模板列表。" + } + } + }, "RumApplicationTracing": { "type": "object", "description": "APM 链路追踪集成配置。", @@ -38653,6 +39402,9 @@ "tracing": { "$ref": "#/components/schemas/RumApplicationTracing" }, + "links": { + "$ref": "#/components/schemas/RumApplicationLinks" + }, "status": { "type": "string", "enum": [ @@ -38792,6 +39544,9 @@ }, "tracing": { "$ref": "#/components/schemas/RumApplicationTracing" + }, + "links": { + "$ref": "#/components/schemas/RumApplicationLinks" } } }, @@ -38825,17 +39580,11 @@ "description": "要更新的应用 ID。" }, "application_name": { - "type": [ - "string", - "null" - ], + "type": "string", "description": "新的应用名称。" }, "type": { - "type": [ - "string", - "null" - ], + "type": "string", "enum": [ "browser", "ios", @@ -38848,35 +39597,26 @@ ] }, "team_id": { - "type": [ - "integer", - "null" - ], + "type": "integer", "format": "int64" }, "is_private": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "no_ip": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "no_geo": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "alerting": { "$ref": "#/components/schemas/RumApplicationAlerting" }, "tracing": { "$ref": "#/components/schemas/RumApplicationTracing" + }, + "links": { + "$ref": "#/components/schemas/RumApplicationLinks" } } }, @@ -44426,7 +45166,7 @@ }, "RumWebhookTestRequest": { "type": "object", - "description": "发送 RUM 告警测试 Webhook 的参数。", + "description": "发送 RUM 告警样例 Webhook 的参数。", "required": [ "application_id", "webhook_url" @@ -44439,7 +45179,7 @@ "webhook_url": { "type": "string", "format": "uri", - "description": "接收测试告警事件的 Webhook URL。" + "description": "接收样例告警事件的 Webhook URL。" } } }, @@ -44454,11 +45194,11 @@ "properties": { "ok": { "type": "boolean", - "description": "Webhook 端点是否接受了测试事件。" + "description": "Webhook 端点是否接受了样例事件。" }, "status_code": { "type": "integer", - "description": "Webhook 端点返回的 HTTP 状态码;未收到响应时为 0。" + "description": "Webhook 端点返回的 HTTP 状态码。未收到响应时为 0。" }, "message": { "type": "string", @@ -45433,6 +46173,729 @@ "trigger_kind", "status" ] + }, + "FacetCountItem": { + "type": "object", + "description": "一个分面值及其出现次数。", + "required": [ + "facet_value", + "count" + ], + "properties": { + "facet_value": { + "description": "分面值,类型与字段的 `value_type` 一致。" + }, + "count": { + "type": "integer", + "format": "int64", + "description": "该时间范围内具有此分面值的事件数量。", + "example": 1523 + } + } + }, + "RumDataAggregateFunction": { + "type": "object", + "description": "采样引擎使用的聚合函数元信息。", + "required": [ + "type", + "column_name", + "column_index" + ], + "properties": { + "type": { + "type": "string", + "description": "聚合函数类型。" + }, + "column_name": { + "type": "string", + "description": "聚合函数使用的列名。" + }, + "column_index": { + "type": "integer", + "description": "聚合函数使用的列下标。" + } + } + }, + "RumDataFieldMeta": { + "type": "object", + "description": "单个返回列的元信息。", + "required": [ + "name", + "type", + "nullable" + ], + "properties": { + "name": { + "type": "string", + "description": "列名。" + }, + "type": { + "type": "string", + "description": "该列的后端数据库类型名称。" + }, + "nullable": { + "type": "boolean", + "description": "该列的值是否可能为 null。" + } + } + }, + "RumDataQueryDefinition": { + "type": "object", + "description": "单个 RUM 数据查询定义。", + "required": [ + "id", + "sql", + "format" + ], + "properties": { + "id": { + "type": "string", + "maxLength": 64, + "description": "调用方提供的查询 ID;响应对象会使用同一值作为 key。" + }, + "sql": { + "type": "string", + "description": "要执行的 RUM SQL 查询。" + }, + "dql": { + "type": "string", + "description": "可选的 RUM DQL 过滤表达式,会和 SQL 校验一起使用。" + }, + "format": { + "type": "string", + "enum": [ + "time_series", + "table" + ], + "description": "输出格式。`table` 返回行数据;`time_series` 返回按时间桶聚合的时序数据。" + }, + "interval": { + "type": "integer", + "format": "int64", + "exclusiveMinimum": 0, + "default": 3600, + "description": "`time_series` 查询的时间桶间隔,单位秒。" + }, + "max_points": { + "type": "integer", + "format": "int64", + "exclusiveMinimum": 0, + "default": 1226, + "description": "`time_series` 查询最多返回的点数。" + }, + "time_zone": { + "type": "string", + "description": "计算时间函数时使用的 IANA 时区名称,例如 `Asia/Shanghai`。" + }, + "search_after_ctx": { + "type": "string", + "description": "上一次表格查询返回的不透明游标,用于继续分页。" + }, + "disable_sampling": { + "type": "boolean", + "description": "为 true 时,请求查询引擎尽可能避免采样。" + } + } + }, + "RumDataQueryOutput": { + "type": "object", + "description": "单个查询的结果。失败的子查询填充 `error`;成功的子查询填充 `data`。", + "properties": { + "error": { + "$ref": "#/components/schemas/DutyError" + }, + "data": { + "$ref": "#/components/schemas/RumDataQueryResult" + } + } + }, + "RumDataQueryRequest": { + "type": "object", + "description": "指定时间范围内的一组 RUM 数据查询。", + "required": [ + "start_time", + "end_time", + "queries" + ], + "properties": { + "start_time": { + "type": "integer", + "format": "int64", + "description": "查询窗口起始时间,Unix 毫秒时间戳。", + "example": 1712620800000 + }, + "end_time": { + "type": "integer", + "format": "int64", + "description": "查询窗口结束时间,Unix 毫秒时间戳。最大跨度 31 天。", + "example": 1712707200000 + }, + "queries": { + "type": "array", + "description": "并发执行的查询列表,允许 1 到 10 个。", + "minItems": 1, + "maxItems": 10, + "items": { + "$ref": "#/components/schemas/RumDataQueryDefinition" + } + } + } + }, + "RumDataQueryResponse": { + "type": "object", + "description": "从请求中的查询 ID 到该查询结果或错误的映射。", + "additionalProperties": { + "$ref": "#/components/schemas/RumDataQueryOutput" + } + }, + "RumDataQueryResult": { + "type": "object", + "description": "单个 RUM 数据查询返回的行数据和元信息。", + "required": [ + "fields", + "values" + ], + "properties": { + "search_after_ctx": { + "type": "string", + "description": "用于继续表格查询分页的不透明游标。" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumDataFieldMeta" + }, + "description": "返回值矩阵的列元信息。" + }, + "values": { + "type": "array", + "description": "查询返回的行数据。每一行按下标与 `fields` 对齐。", + "items": { + "type": "array", + "items": {} + } + }, + "interval": { + "type": "integer", + "format": "int64", + "description": "时序查询实际使用的时间桶间隔,单位秒。" + }, + "sampling": { + "$ref": "#/components/schemas/RumDataSamplingDecision" + } + } + }, + "RumDataSamplingDecision": { + "type": "object", + "description": "查询引擎使用采样数据时返回的采样元信息。", + "required": [ + "enabled", + "scale_factor" + ], + "properties": { + "enabled": { + "type": "boolean", + "description": "是否应用了采样。" + }, + "scale_factor": { + "type": "number", + "description": "将采样计数放大为全量估算值时使用的倍率。" + }, + "selected_tablets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "采样查询选中的存储 tablet。" + }, + "aggregate_funcs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumDataAggregateFunction" + }, + "description": "受采样影响的聚合函数。" + } + } + }, + "RumFacetCountRequest": { + "type": "object", + "description": "分面值分布统计的请求参数。", + "required": [ + "scope", + "facet_key", + "start_time", + "end_time" + ], + "properties": { + "scope": { + "type": "string", + "description": "要查询的 RUM 数据 scope。", + "enum": [ + "session", + "view", + "action", + "error", + "resource", + "long_task", + "vital", + "issue", + "sourcemap" + ] + }, + "facet_key": { + "type": "string", + "description": "要统计值分布的字段键。" + }, + "facet_value": { + "description": "设置后,统计前会先过滤 `facet_key` 等于该值的事件。接受字符串、数字或布尔值。" + }, + "start_time": { + "type": "integer", + "format": "int64", + "description": "时间范围起始,Unix 毫秒时间戳。", + "example": 1712620800000 + }, + "end_time": { + "type": "integer", + "format": "int64", + "description": "时间范围结束,Unix 毫秒时间戳。最大跨度 31 天。", + "example": 1712707200000 + }, + "dql": { + "type": "string", + "description": "统计前应用的 RUM DQL 过滤表达式。" + }, + "sql": { + "type": "string", + "description": "仅含 WHERE 子句(无 SELECT)的 SQL 附加过滤条件。" + }, + "limit": { + "type": "integer", + "description": "返回的最大 Top N 值数量。默认 100,最大 100。", + "maximum": 100, + "default": 100 + } + } + }, + "RumFacetCountResponse": { + "type": "object", + "description": "按计数降序排列的 Top N 分面值。", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetCountItem" + } + } + } + }, + "RumFacetListRequest": { + "type": "object", + "description": "RUM 字段定义列表的过滤参数。", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "按 RUM 数据 scope 过滤。合法值:`session`、`view`、`action`、`error`、`resource`、`long_task`、`vital`、`issue`、`sourcemap`。" + }, + "is_facet": { + "type": "boolean", + "description": "为 true 时只返回支持分面查询的字段;为 false 或不传时返回所有字段。" + } + } + }, + "RumFacetListResponse": { + "type": "object", + "description": "RUM 字段定义列表。", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumFieldItem" + } + } + } + }, + "RumFieldItem": { + "type": "object", + "description": "一条 RUM 字段定义。", + "required": [ + "account_id", + "field_key", + "field_name", + "group", + "description", + "value_type", + "show_type", + "unit_family", + "unit_name", + "edit_able", + "is_facet", + "enum_values", + "scopes", + "status", + "queryable" + ], + "properties": { + "account_id": { + "type": "integer", + "format": "int64", + "description": "账户 ID。内置字段为 0。" + }, + "field_key": { + "type": "string", + "description": "唯一字段键,如 `error.type`。" + }, + "field_name": { + "type": "string", + "description": "人类可读的字段名称。" + }, + "group": { + "type": "string", + "description": "字段的展示分组。" + }, + "description": { + "type": "string", + "description": "该字段捕获内容的描述。" + }, + "value_type": { + "type": "string", + "description": "字段值的数据类型。", + "enum": [ + "string", + "number", + "boolean", + "array", + "array", + "array" + ] + }, + "show_type": { + "type": "string", + "description": "在分析 UI 中的展示类型。", + "enum": [ + "list", + "range" + ] + }, + "unit_family": { + "type": "string", + "description": "计量单位族,如 `time`、`bytes`。无量纲字段为空。" + }, + "unit_name": { + "type": "string", + "description": "具体计量单位,如 `millisecond`、`byte`。" + }, + "edit_able": { + "type": "boolean", + "description": "是否为用户可编辑的自定义字段。" + }, + "is_facet": { + "type": "boolean", + "description": "是否支持值分布统计查询。" + }, + "enum_values": { + "type": "array", + "description": "该字段的预定义枚举值。元素类型与 `value_type` 对应:字符串类型为 `string`,数字类型为 `number`,布尔类型为 `boolean`。无固定值集合时为空数组。", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "该字段所属的 RUM scope 列表。" + }, + "status": { + "type": "string", + "description": "字段状态,如 `active`。" + }, + "queryable": { + "type": "boolean", + "description": "是否可在 DQL/SQL 查询中使用。" + } + } + }, + "RumFieldListRequest": { + "type": "object", + "description": "RUM 字段定义列表的过滤参数。", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "按 RUM 数据 scope 过滤。合法值:`session`、`view`、`action`、`error`、`resource`、`long_task`、`vital`、`issue`、`sourcemap`。" + }, + "is_facet": { + "type": "boolean", + "description": "为 true 时只返回支持分面查询的字段;为 false 或不传时返回所有字段。" + } + } + }, + "RumFieldListResponse": { + "type": "object", + "description": "RUM 字段定义列表。", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RumFieldItem" + } + } + } + }, + "SourcemapBinaryImage": { + "type": "object", + "description": "崩溃报告中的已加载 binary image。", + "required": [ + "uuid", + "name", + "is_system" + ], + "properties": { + "uuid": { + "type": "string", + "description": "标识 binary 或 dSYM 的 build UUID。" + }, + "name": { + "type": "string", + "description": "Binary image 名称。" + }, + "is_system": { + "type": "boolean", + "description": "是否为操作系统自带 binary。" + }, + "load_address": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ], + "description": "运行时地址。接受 `0x100000000` 这样的十六进制字符串,也接受十进制整数。" + }, + "max_address": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ], + "description": "运行时地址。接受 `0x100000000` 这样的十六进制字符串,也接受十进制整数。" + }, + "arch": { + "type": "string", + "description": "该 binary image 的 CPU 架构。" + } + } + }, + "SourcemapCodeSnippet": { + "type": "object", + "description": "enrich 后栈帧附近的一行源码。", + "required": [ + "line", + "code" + ], + "properties": { + "line": { + "type": "integer", + "description": "源码行号。" + }, + "code": { + "type": "string", + "description": "该行源码内容。" + } + } + }, + "SourcemapEnrichedFrame": { + "allOf": [ + { + "$ref": "#/components/schemas/SourcemapStackFrame" + }, + { + "type": "object", + "required": [ + "converted" + ], + "properties": { + "converted": { + "type": "boolean", + "description": "该栈帧是否成功符号化或反混淆。" + }, + "code_snippets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SourcemapCodeSnippet" + }, + "description": "该栈帧附近的源码片段。" + }, + "original_frame": { + "$ref": "#/components/schemas/SourcemapStackFrame" + }, + "third_party": { + "type": "boolean", + "description": "该栈帧是否来自第三方或系统库。" + } + } + } + ] + }, + "SourcemapStackEnrichRequest": { + "type": "object", + "description": "错误栈 enrich 请求。", + "required": [ + "service", + "version" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "browser", + "android", + "ios", + "miniprogram", + "harmony" + ], + "description": "来源平台。省略时默认按 `browser` 处理。" + }, + "service": { + "type": "string", + "description": "上传 Sourcemap 时使用的应用或服务名称。" + }, + "version": { + "type": "string", + "description": "上传 Sourcemap 时使用的应用版本。" + }, + "stack": { + "type": "string", + "description": "待解析和 enrich 的原始错误栈。" + }, + "near": { + "type": "integer", + "minimum": 1, + "maximum": 20, + "description": "在转换后的栈帧附近返回的有效源码行数。" + }, + "no_cache": { + "type": "boolean", + "description": "跳过缓存的 enrich 结果,主要用于调试。" + }, + "build_id": { + "type": "string", + "description": "Gradle 插件 1.13.0 及以后版本使用的 Android build ID。" + }, + "variant": { + "type": "string", + "description": "旧版 Gradle 插件使用的 Android build variant。" + }, + "arch": { + "type": "string", + "description": "Android NDK 架构,例如 `arm`、`arm64`、`x86` 或 `x64`。" + }, + "source_type": { + "type": "string", + "description": "Android 错误来源类型;native 符号化时配合 `arch` 传入 `ndk`。" + }, + "binary_images": { + "type": "array", + "description": "iOS 崩溃报告中的已加载 binary image 列表。", + "items": { + "$ref": "#/components/schemas/SourcemapBinaryImage" + } + } + } + }, + "SourcemapStackEnrichResponse": { + "type": "object", + "description": "enrich 后的错误栈帧。", + "required": [ + "frames" + ], + "properties": { + "frames": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SourcemapEnrichedFrame" + } + } + } + }, + "SourcemapStackFrame": { + "type": "object", + "description": "跨平台通用的已解析栈帧字段。", + "properties": { + "function": { + "type": "string", + "description": "函数或方法名称。" + }, + "file": { + "type": "string", + "description": "源文件、URL 或模块路径。" + }, + "line": { + "type": "integer", + "description": "行号。" + }, + "column": { + "type": "integer", + "description": "JavaScript 或 Flutter 栈帧中的列号。" + }, + "class_name": { + "type": "string", + "description": "Android Java/Kotlin 类名。" + }, + "method_name": { + "type": "string", + "description": "不带类名前缀的 Android Java/Kotlin 方法名。" + }, + "module": { + "type": "string", + "description": "iOS Swift/Objective-C 模块名。" + }, + "address": { + "type": "string", + "description": "iOS 或 native 内存地址。" + }, + "offset": { + "type": "integer", + "description": "相对函数起始位置的符号偏移。" + }, + "native_address": { + "type": "string", + "description": "Unity IL native 地址。" + } + } } } } diff --git a/roundtrip_gen_test.go b/roundtrip_gen_test.go index c9341c0..9e42aa4 100644 --- a/roundtrip_gen_test.go +++ b/roundtrip_gen_test.go @@ -137,6 +137,10 @@ var exampleDataDecoders = map[string]func(json.RawMessage) error{ "POST /rum/application/infos": func(d json.RawMessage) error { var v RUMApplicationInfosResponse; return json.Unmarshal(d, &v) }, "POST /rum/application/list": func(d json.RawMessage) error { var v RUMApplicationListResponse; return json.Unmarshal(d, &v) }, "POST /rum/application/webhook/test": func(d json.RawMessage) error { var v RUMWebhookTestResponse; return json.Unmarshal(d, &v) }, + "POST /rum/data/query": func(d json.RawMessage) error { var v RUMDataQueryResponse; return json.Unmarshal(d, &v) }, + "POST /rum/facet/count": func(d json.RawMessage) error { var v RUMFacetCountResponse; return json.Unmarshal(d, &v) }, + "POST /rum/facet/list": func(d json.RawMessage) error { var v RUMFacetListResponse; return json.Unmarshal(d, &v) }, + "POST /rum/field/list": func(d json.RawMessage) error { var v RUMFieldListResponse; return json.Unmarshal(d, &v) }, "POST /rum/issue/info": func(d json.RawMessage) error { var v RUMIssueItem; return json.Unmarshal(d, &v) }, "POST /rum/issue/list": func(d json.RawMessage) error { var v RUMIssueListResponse; return json.Unmarshal(d, &v) }, "POST /safari/a2a-agent/create": func(d json.RawMessage) error { var v A2aAgentCreateResponse; return json.Unmarshal(d, &v) }, @@ -177,6 +181,7 @@ var exampleDataDecoders = map[string]func(json.RawMessage) error{ "POST /schedule/preview": func(d json.RawMessage) error { var v ScheduleItem; return json.Unmarshal(d, &v) }, "POST /schedule/self": func(d json.RawMessage) error { var v ScheduleSelfResponse; return json.Unmarshal(d, &v) }, "POST /sourcemap/list": func(d json.RawMessage) error { var v SourcemapListResponse; return json.Unmarshal(d, &v) }, + "POST /sourcemap/stack/enrich": func(d json.RawMessage) error { var v SourcemapStackEnrichResponse; return json.Unmarshal(d, &v) }, "POST /status-page/change/create": func(d json.RawMessage) error { var v StatusPageChangeCreateResponse; return json.Unmarshal(d, &v) }, "POST /status-page/change/timeline/create": func(d json.RawMessage) error { var v StatusPageChangeTimelineCreateResponse diff --git a/services_gen.go b/services_gen.go index caa7f27..e216f2a 100644 --- a/services_gen.go +++ b/services_gen.go @@ -36,6 +36,8 @@ type genServices struct { RolesPermissions *RolesPermissionsService Teams *TeamsService Applications *ApplicationsService + DataQuery *DataQueryService + Facets *FacetsService Issues *IssuesService Sourcemaps *SourcemapsService } @@ -71,6 +73,8 @@ func (c *Client) initServices() { c.RolesPermissions = (*RolesPermissionsService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Applications = (*ApplicationsService)(&c.common) + c.DataQuery = (*DataQueryService)(&c.common) + c.Facets = (*FacetsService)(&c.common) c.Issues = (*IssuesService)(&c.common) c.Sourcemaps = (*SourcemapsService)(&c.common) } diff --git a/sourcemaps.go b/sourcemaps.go index d803e74..c640cf8 100644 --- a/sourcemaps.go +++ b/sourcemaps.go @@ -20,3 +20,17 @@ func (s *SourcemapsService) List(ctx context.Context, req *SourcemapListRequest) } return out, resp, nil } + +// Enrich a stack trace. +// +// Symbolicate or deobfuscate a browser, Android, iOS, Mini Program, or HarmonyOS stack trace. +// +// API: POST /sourcemap/stack/enrich (sourcemap-read-stack-enrich). +func (s *SourcemapsService) StackEnrich(ctx context.Context, req *SourcemapStackEnrichRequest) (*SourcemapStackEnrichResponse, *Response, error) { + out := new(SourcemapStackEnrichResponse) + resp, err := s.client.do(ctx, "/sourcemap/stack/enrich", req, out) + if err != nil { + return nil, resp, err + } + return out, resp, nil +}