@daocloud-proto/insight 0.39.2 → 0.40.0-10-gf489b59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,15 @@ export enum ValidateGroupCode {
27
27
  ERR_RULE_DESCRIPTION = "ERR_RULE_DESCRIPTION",
28
28
  }
29
29
 
30
+ export enum NotifyStatusStatus {
31
+ unknown = "unknown",
32
+ success = "success",
33
+ partial_success = "partial_success",
34
+ fail = "fail",
35
+ silenced = "silenced",
36
+ not_configured = "not_configured",
37
+ }
38
+
30
39
  export type ID = {
31
40
  id?: string
32
41
  }
@@ -265,6 +274,12 @@ export type AlertSummary = {
265
274
  lastSent?: string
266
275
  builtin?: boolean
267
276
  status?: InsightIoApiAlertV1alpha1Type.AlertStatus
277
+ notifyStatus?: NotifyStatus
278
+ }
279
+
280
+ export type NotifyStatus = {
281
+ status?: NotifyStatusStatus
282
+ messages?: {[key: string]: string}
268
283
  }
269
284
 
270
285
  export type GetAlertRequest = {
@@ -292,6 +307,7 @@ export type Alert = {
292
307
  startAt?: string
293
308
  updateAt?: string
294
309
  lastSent?: string
310
+ notifyStatus?: NotifyStatus
295
311
  }
296
312
 
297
313
  export type CountAlertRequest = {
@@ -12,6 +12,7 @@ export enum FeatureGateIDEnum {
12
12
  LOG_ALERT = "LOG_ALERT",
13
13
  NET_FLOW = "NET_FLOW",
14
14
  EVENT = "EVENT",
15
+ SLOW_SQL = "SLOW_SQL",
15
16
  }
16
17
 
17
18
  export type FeatureGateID = {
@@ -27,6 +27,7 @@ import * as InsightIoApiResourceV1alpha1Service from "../../resource/v1alpha1/se
27
27
  import * as InsightIoApiResourceV1alpha1Workload from "../../resource/v1alpha1/workload.pb"
28
28
  import * as InsightIoApiSpan_metricV1alpha1Span_metric from "../../span_metric/v1alpha1/span_metric.pb"
29
29
  import * as InsightIoApiTracingV1alpha1Query from "../../tracing/v1alpha1/query.pb"
30
+ import * as InsightIoApiTracingV1alpha1Statement_analysis from "../../tracing/v1alpha1/statement_analysis.pb"
30
31
  import * as InsightIoApiTracingV1alpha1Tracing from "../../tracing/v1alpha1/tracing.pb"
31
32
  import * as InsightIoApiUserV1alpha1User from "../../user/v1alpha1/user.pb"
32
33
 
@@ -74,6 +75,7 @@ export type GlobalConfig = {
74
75
  latencyThresholds?: number[]
75
76
  errorRateThresholds?: number[]
76
77
  alertHistoryRetentionTime?: number
78
+ slowSqlThreshold?: number
77
79
  }
78
80
 
79
81
  export type userinfo = {
@@ -458,6 +460,18 @@ export class Tracing {
458
460
  static GetTagValues(req: InsightIoApiTracingV1alpha1Tracing.GetTagValuesRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Tracing.GetTagValuesResponse> {
459
461
  return fm.fetchReq<InsightIoApiTracingV1alpha1Tracing.GetTagValuesRequest, InsightIoApiTracingV1alpha1Tracing.GetTagValuesResponse>(`/apis/insight.io/v1alpha1/traces/tags/${req["name"]}/values?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
460
462
  }
463
+ static QueryMetadata(req: InsightIoApiTracingV1alpha1Statement_analysis.MetadataRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Statement_analysis.MetadataResponse> {
464
+ return fm.fetchReq<InsightIoApiTracingV1alpha1Statement_analysis.MetadataRequest, InsightIoApiTracingV1alpha1Statement_analysis.MetadataResponse>(`/apis/insight.io/v1alpha1/traces/slow-sql/clusters/${req["clusterName"]}/type/${req["type"]}/metadata`, {...initReq, method: "POST", body: JSON.stringify(req)})
465
+ }
466
+ static StatementHistogram(req: InsightIoApiTracingV1alpha1Statement_analysis.StatementRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Statement_analysis.StatementHistogramResponse> {
467
+ return fm.fetchReq<InsightIoApiTracingV1alpha1Statement_analysis.StatementRequest, InsightIoApiTracingV1alpha1Statement_analysis.StatementHistogramResponse>(`/apis/insight.io/v1alpha1/traces/slow-sql/clusters/${req["clusterName"]}/statement/histogram`, {...initReq, method: "POST", body: JSON.stringify(req)})
468
+ }
469
+ static StatementTopK(req: InsightIoApiTracingV1alpha1Statement_analysis.StatementRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Statement_analysis.StatementTopKResponse> {
470
+ return fm.fetchReq<InsightIoApiTracingV1alpha1Statement_analysis.StatementRequest, InsightIoApiTracingV1alpha1Statement_analysis.StatementTopKResponse>(`/apis/insight.io/v1alpha1/traces/slow-sql/clusters/${req["clusterName"]}/statement/topk`, {...initReq, method: "POST", body: JSON.stringify(req)})
471
+ }
472
+ static GetSlowSQLSpans(req: InsightIoApiTracingV1alpha1Statement_analysis.SpansRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Statement_analysis.SpansResponse> {
473
+ return fm.fetchReq<InsightIoApiTracingV1alpha1Statement_analysis.SpansRequest, InsightIoApiTracingV1alpha1Statement_analysis.SpansResponse>(`/apis/insight.io/v1alpha1/traces/slow-sql/clusters/${req["clusterName"]}/spans`, {...initReq, method: "POST", body: JSON.stringify(req)})
474
+ }
461
475
  }
462
476
  export class ServiceGraph {
463
477
  static GetGraph(req: InsightIoApiGraphV1alpha1Graph.BaseGraphQuery, initReq?: fm.InitReq): Promise<InsightIoApiGraphV1alpha1Graph.Graph> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.39.2",
3
+ "version":"0.40.0-10-gf489b59",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,127 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as InsightIoApiGraphV1alpha1Graph from "../../graph/v1alpha1/graph.pb"
8
+ import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
9
+ import * as InsightIoApiTracingV1alpha1Model from "./model.pb"
10
+
11
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
12
+ type OneOf<T> =
13
+ | { [k in keyof T]?: undefined }
14
+ | (
15
+ keyof T extends infer K ?
16
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
17
+ : never)
18
+ : never);
19
+
20
+ export enum FilterField {
21
+ SERVICE_NAME = "SERVICE_NAME",
22
+ DATABASE_ADDRESS = "DATABASE_ADDRESS",
23
+ DATABASE_SYSTEM = "DATABASE_SYSTEM",
24
+ SQL_STATEMENT = "SQL_STATEMENT",
25
+ SOURCE_POD = "SOURCE_POD",
26
+ STATUS_ERROR = "STATUS_ERROR",
27
+ DURATION = "DURATION",
28
+ }
29
+
30
+ export enum MetadataRequestQueryType {
31
+ DATABASE_ADDRESS = "DATABASE_ADDRESS",
32
+ DATABASE_SYSTEM = "DATABASE_SYSTEM",
33
+ SQL_STATEMENT = "SQL_STATEMENT",
34
+ }
35
+
36
+
37
+ type BaseOperatorClause = {
38
+ field?: FilterField
39
+ operation?: InsightIoApiGraphV1alpha1Graph.FilterOperator
40
+ }
41
+
42
+ export type OperatorClause = BaseOperatorClause
43
+ & OneOf<{ stringValue: string; floatValue: number; boolValue: boolean }>
44
+
45
+ export type MetadataRequest = {
46
+ clusterName?: string
47
+ namespace?: string
48
+ type?: MetadataRequestQueryType
49
+ clauses?: OperatorClause[]
50
+ startTime?: string
51
+ endTime?: string
52
+ limit?: number
53
+ }
54
+
55
+ export type MetadataResponse = {
56
+ items?: string[]
57
+ }
58
+
59
+ export type StatementRequest = {
60
+ clusterName?: string
61
+ namespace?: string
62
+ clauses?: OperatorClause[]
63
+ sort?: string
64
+ startTime?: string
65
+ endTime?: string
66
+ interval?: string
67
+ topN?: string
68
+ }
69
+
70
+ export type BucketHistogram = {
71
+ timestamp?: string
72
+ value?: number
73
+ }
74
+
75
+ export type StatementHistogramResponse = {
76
+ total?: BucketHistogram[]
77
+ duration?: BucketHistogram[]
78
+ errors?: BucketHistogram[]
79
+ errorRate?: BucketHistogram[]
80
+ sourcePods?: SourcePod[]
81
+ }
82
+
83
+ export type SourcePod = {
84
+ name?: string
85
+ count?: string
86
+ }
87
+
88
+ export type TopKItem = {
89
+ address?: string
90
+ system?: string
91
+ sourceCluster?: string
92
+ sourceNamespace?: string
93
+ sourceService?: string
94
+ statement?: string
95
+ totalCount?: string
96
+ avgDuration?: string
97
+ errorRate?: string
98
+ }
99
+
100
+ export type StatementTopKResponse = {
101
+ items?: TopKItem[]
102
+ }
103
+
104
+ export type SpansRequest = {
105
+ clusterName?: string
106
+ namespace?: string
107
+ clauses?: OperatorClause[]
108
+ sort?: string
109
+ startTime?: string
110
+ endTime?: string
111
+ page?: number
112
+ pageSize?: number
113
+ }
114
+
115
+ export type SQLSpan = {
116
+ sourcePod?: string
117
+ startTime?: string
118
+ status?: InsightIoApiTracingV1alpha1Model.TraceStatus
119
+ duration?: string
120
+ traceId?: string
121
+ spanId?: string
122
+ }
123
+
124
+ export type SpansResponse = {
125
+ items?: SQLSpan[]
126
+ pagination?: InsightIoApiTypeV1alpha1Page.Pagination
127
+ }