@daocloud-proto/insight 0.12.3 → 0.13.1

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.
@@ -6,6 +6,12 @@
6
6
 
7
7
  import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
8
 
9
+ export enum CleanRuleType {
10
+ Clean_All = "Clean_All",
11
+ Clean_Unmatched = "Clean_Unmatched",
12
+ Clean_Specific = "Clean_Specific",
13
+ }
14
+
9
15
  export enum RuleSource {
10
16
  RULE_SOURCE_UNSPECIFIED = "RULE_SOURCE_UNSPECIFIED",
11
17
  METRIC_TPL = "METRIC_TPL",
@@ -146,12 +152,23 @@ export type UpdateRuleRequest = {
146
152
  annotation?: Annotation
147
153
  }
148
154
 
155
+ export type CleanRuleRequest = {
156
+ cleanType?: CleanRuleType
157
+ id?: string[]
158
+ }
159
+
160
+ export type CleanRuleResponse = {
161
+ result?: string
162
+ }
163
+
149
164
  export type ListAlertsRequest = {
150
165
  resolved?: boolean
151
166
  name?: string
152
167
  clusterName?: string
153
168
  namespace?: string
154
169
  severity?: Severity
170
+ targetType?: TargetType
171
+ targetName?: string
155
172
  page?: number
156
173
  pageSize?: number
157
174
  sorts?: string[]
@@ -286,4 +303,12 @@ export type TemplateBody = {
286
303
  wecom?: string
287
304
  dingtalk?: string
288
305
  webhook?: string
306
+ }
307
+
308
+ export type AlertHistoryRetentionPeriod = {
309
+ retentionTime?: number
310
+ }
311
+
312
+ export type CleanAlertHistoryResponse = {
313
+ num?: string
289
314
  }
@@ -97,6 +97,9 @@ export class Alert {
97
97
  static DeleteRule(req: InsightIoApiInsightV1alpha1Alert.RuleID, initReq?: fm.InitReq): Promise<empty> {
98
98
  return fm.fetchReq<InsightIoApiInsightV1alpha1Alert.RuleID, empty>(`/apis/insight.io/v1alpha1/alert/rules/${req["id"]}`, {...initReq, method: "DELETE"})
99
99
  }
100
+ static CleanRules(req: InsightIoApiInsightV1alpha1Alert.CleanRuleRequest, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Alert.CleanRuleResponse> {
101
+ return fm.fetchReq<InsightIoApiInsightV1alpha1Alert.CleanRuleRequest, InsightIoApiInsightV1alpha1Alert.CleanRuleResponse>(`/apis/insight.io/v1alpha1/alert/rules/clean`, {...initReq, method: "PUT", body: JSON.stringify(req)})
102
+ }
100
103
  static ListAlerts(req: InsightIoApiInsightV1alpha1Alert.ListAlertsRequest, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Alert.ListAlertsResponse> {
101
104
  return fm.fetchReq<InsightIoApiInsightV1alpha1Alert.ListAlertsRequest, InsightIoApiInsightV1alpha1Alert.ListAlertsResponse>(`/apis/insight.io/v1alpha1/alert/alerts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
102
105
  }
@@ -106,6 +109,15 @@ export class Alert {
106
109
  static AlertHook(req: InsightIoApiInsightV1alpha1Alert.AMHookRequest, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Alert.AMHookRequest> {
107
110
  return fm.fetchReq<InsightIoApiInsightV1alpha1Alert.AMHookRequest, InsightIoApiInsightV1alpha1Alert.AMHookRequest>(`/apis/insight.io/v1alpha1/alert/hook`, {...initReq, method: "POST", body: JSON.stringify(req)})
108
111
  }
112
+ static GetAlertHistoryRetentionPeriod(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Alert.AlertHistoryRetentionPeriod> {
113
+ return fm.fetchReq<empty, InsightIoApiInsightV1alpha1Alert.AlertHistoryRetentionPeriod>(`/apis/insight.io/v1alpha1/alert/history/retentionperiod?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
114
+ }
115
+ static UpdateAlertHistoryRetentionPeriod(req: InsightIoApiInsightV1alpha1Alert.AlertHistoryRetentionPeriod, initReq?: fm.InitReq): Promise<empty> {
116
+ return fm.fetchReq<InsightIoApiInsightV1alpha1Alert.AlertHistoryRetentionPeriod, empty>(`/apis/insight.io/v1alpha1/alert/history/retentionperiod`, {...initReq, method: "PUT", body: JSON.stringify(req)})
117
+ }
118
+ static CleanAlertHistory(req: empty, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Alert.CleanAlertHistoryResponse> {
119
+ return fm.fetchReq<empty, InsightIoApiInsightV1alpha1Alert.CleanAlertHistoryResponse>(`/apis/insight.io/v1alpha1/alert/history/clean`, {...initReq, method: "PUT"})
120
+ }
109
121
  static ListReceivers(req: InsightIoApiInsightV1alpha1Notify.ListReceiversRequest, initReq?: fm.InitReq): Promise<InsightIoApiInsightV1alpha1Notify.ListReceiverResponse> {
110
122
  return fm.fetchReq<InsightIoApiInsightV1alpha1Notify.ListReceiversRequest, InsightIoApiInsightV1alpha1Notify.ListReceiverResponse>(`/apis/insight.io/v1alpha1/alert/receivers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
111
123
  }
@@ -253,8 +265,17 @@ export class Resource {
253
265
  static GetService(req: InsightIoApiResourceV1alpha1Service.GetServiceRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Service.Service> {
254
266
  return fm.fetchReq<InsightIoApiResourceV1alpha1Service.GetServiceRequest, InsightIoApiResourceV1alpha1Service.Service>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/services/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
255
267
  }
268
+ static GetAgentSummary(req: InsightIoApiResourceV1alpha1Cluster.GetAgentSummaryRequest, initReq?: fm.InitReq): Promise<InsightIoApiResourceV1alpha1Cluster.AgentSummary> {
269
+ return fm.fetchReq<InsightIoApiResourceV1alpha1Cluster.GetAgentSummaryRequest, InsightIoApiResourceV1alpha1Cluster.AgentSummary>(`/apis/insight.io/v1alpha1/clusters/${req["cluster"]}/agent?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
270
+ }
256
271
  }
257
272
  export class Tracing {
273
+ static ListServiceNames(req: InsightIoApiTracingV1alpha1Tracing.ListServiceNamesRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Tracing.GetServiceNamesResponse> {
274
+ return fm.fetchReq<InsightIoApiTracingV1alpha1Tracing.ListServiceNamesRequest, InsightIoApiTracingV1alpha1Tracing.GetServiceNamesResponse>(`/apis/insight.io/v1alpha1/traces/clusters/${req["clusterName"]}/service-names?${fm.renderURLSearchParams(req, ["clusterName"])}`, {...initReq, method: "GET"})
275
+ }
276
+ static GetServices(req: InsightIoApiSpan_metricV1alpha1Span_metric.GetServicesRequest, initReq?: fm.InitReq): Promise<InsightIoApiSpan_metricV1alpha1Span_metric.GetServicesResponse> {
277
+ return fm.fetchReq<InsightIoApiSpan_metricV1alpha1Span_metric.GetServicesRequest, InsightIoApiSpan_metricV1alpha1Span_metric.GetServicesResponse>(`/apis/insight.io/v1alpha1/traces/clusters/${req["clusterName"]}/services?${fm.renderURLSearchParams(req, ["clusterName"])}`, {...initReq, method: "GET"})
278
+ }
258
279
  static QueryOperations(req: InsightIoApiTracingV1alpha1Tracing.QueryBaseRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Tracing.OperationsQueryResponse> {
259
280
  return fm.fetchReq<InsightIoApiTracingV1alpha1Tracing.QueryBaseRequest, InsightIoApiTracingV1alpha1Tracing.OperationsQueryResponse>(`/apis/insight.io/v1alpha1/traces/operations?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
260
281
  }
@@ -4,6 +4,15 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
8
+ type OneOf<T> =
9
+ | { [k in keyof T]?: undefined }
10
+ | (
11
+ keyof T extends infer K ?
12
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
13
+ : never)
14
+ : never);
15
+
7
16
  export enum requestStatus {
8
17
  STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
9
18
  SUCCESS = "SUCCESS",
@@ -25,15 +34,18 @@ export type samplePair = {
25
34
  value?: string
26
35
  }
27
36
 
28
- export type PrometheusQueryRequest = {
29
- cluster?: string
37
+
38
+ type BasePrometheusQueryRequest = {
30
39
  namespace?: string
31
40
  query?: string
32
41
  time?: string
33
42
  }
34
43
 
35
- export type PrometheusQueryRangeRequest = {
36
- cluster?: string
44
+ export type PrometheusQueryRequest = BasePrometheusQueryRequest
45
+ & OneOf<{ cluster: string; clusterName: string }>
46
+
47
+
48
+ type BasePrometheusQueryRangeRequest = {
37
49
  namespace?: string
38
50
  query?: string
39
51
  start?: string
@@ -41,6 +53,9 @@ export type PrometheusQueryRangeRequest = {
41
53
  step?: number
42
54
  }
43
55
 
56
+ export type PrometheusQueryRangeRequest = BasePrometheusQueryRangeRequest
57
+ & OneOf<{ cluster: string; clusterName: string }>
58
+
44
59
  export type PrometheusQueryResult = {
45
60
  vector?: Sample[]
46
61
  }
@@ -59,12 +74,15 @@ export type BatchQueryRequestParam = {
59
74
  time?: string
60
75
  }
61
76
 
62
- export type MatchLabel = {
63
- cluster?: string
77
+
78
+ type BaseMatchLabel = {
64
79
  namespace?: string
65
80
  extraLabel?: {[key: string]: string}
66
81
  }
67
82
 
83
+ export type MatchLabel = BaseMatchLabel
84
+ & OneOf<{ cluster: string; clusterName: string }>
85
+
68
86
  export type BatchQueryRequest = {
69
87
  param?: BatchQueryRequestParam
70
88
  matchLabel?: MatchLabel
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.12.3",
3
+ "version":"0.13.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
+ import * as InsightIoApiResourceV1alpha1Pod from "./pod.pb"
8
9
  import * as InsightIoApiResourceV1alpha1Type from "./type.pb"
9
10
 
10
11
  export enum ClusterPhase {
@@ -113,4 +114,17 @@ export type ListNamespacesResponse = {
113
114
  export type Namespace = {
114
115
  name?: string
115
116
  role?: Role
117
+ }
118
+
119
+ export type GetAgentSummaryRequest = {
120
+ cluster?: string
121
+ }
122
+
123
+ export type AgentSummary = {
124
+ insightAgentState?: insightAgentState
125
+ agentModuleStatus?: agentModuleStatus
126
+ }
127
+
128
+ export type agentModuleStatus = {
129
+ pods?: InsightIoApiResourceV1alpha1Pod.Pod[]
116
130
  }
@@ -27,7 +27,6 @@ export type ListServicesRequest = {
27
27
  name?: string
28
28
  page?: number
29
29
  pageSize?: number
30
- tracingEnabled?: boolean
31
30
  }
32
31
 
33
32
  export type ListServicesResponse = {
@@ -5,9 +5,19 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiMetricV1alpha1Metric from "../../metric/v1alpha1/metric.pb"
8
+ import * as InsightIoApiTypeV1alpha1Page from "../../type/v1alpha1/page.pb"
8
9
  import * as InsightIoApiSpan_metricV1alpha1Otelspankind from "./otelspankind.pb"
9
- export type MetricsQueryBaseRequest = {
10
- cluster?: string
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
+ type BaseMetricsQueryBaseRequest = {
11
21
  namespace?: string
12
22
  instanceName?: string
13
23
  extensionFilters?: string
@@ -20,8 +30,11 @@ export type MetricsQueryBaseRequest = {
20
30
  spanKinds?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
21
31
  }
22
32
 
23
- export type GetApdexRequest = {
24
- cluster?: string
33
+ export type MetricsQueryBaseRequest = BaseMetricsQueryBaseRequest
34
+ & OneOf<{ cluster: string; clusterName: string }>
35
+
36
+
37
+ type BaseGetApdexRequest = {
25
38
  namespace?: string
26
39
  name?: string
27
40
  apdexThreshold?: string
@@ -30,8 +43,12 @@ export type GetApdexRequest = {
30
43
  extensionFilters?: string
31
44
  }
32
45
 
46
+ export type GetApdexRequest = BaseGetApdexRequest
47
+ & OneOf<{ cluster: string; clusterName: string }>
48
+
33
49
  export type MetricsWithOperation = {
34
50
  operationName?: string
51
+ spanKind?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind
35
52
  metricGroups?: MetricsGroup[]
36
53
  }
37
54
 
@@ -58,4 +75,29 @@ export type GetServiceDetailResponse = {
58
75
 
59
76
  export type GetOperationDetailResponse = {
60
77
  metrics?: MetricsWithOperation[]
78
+ }
79
+
80
+ export type GetServicesRequest = {
81
+ namespace?: string
82
+ extensionFilters?: string
83
+ endTime?: string
84
+ lookback?: string
85
+ spanKinds?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
86
+ page?: number
87
+ pageSize?: number
88
+ sort?: string
89
+ clusterName?: string
90
+ }
91
+
92
+ export type ServiceItem = {
93
+ serviceName?: string
94
+ namespace?: string
95
+ reqRate?: number
96
+ repLatency?: number
97
+ errorRate?: number
98
+ }
99
+
100
+ export type GetServicesResponse = {
101
+ items?: ServiceItem[]
102
+ pagination?: InsightIoApiTypeV1alpha1Page.Pagination
61
103
  }
@@ -5,6 +5,15 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiTracingV1alpha1Model from "./model.pb"
8
+
9
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
+ type OneOf<T> =
11
+ | { [k in keyof T]?: undefined }
12
+ | (
13
+ keyof T extends infer K ?
14
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
15
+ : never)
16
+ : never);
8
17
  export type TracesResponseChunk = {
9
18
  traces?: InsightIoApiTracingV1alpha1Model.Trace[]
10
19
  }
@@ -13,7 +22,8 @@ export type SpansResponseChunk = {
13
22
  spans?: InsightIoApiTracingV1alpha1Model.Span[]
14
23
  }
15
24
 
16
- export type TraceQueryParameters = {
25
+
26
+ type BaseTraceQueryParameters = {
17
27
  serviceName?: string
18
28
  operationName?: string
19
29
  tags?: {[key: string]: string}
@@ -22,27 +32,12 @@ export type TraceQueryParameters = {
22
32
  durationMin?: string
23
33
  durationMax?: string
24
34
  limit?: number
25
- cluster?: string
26
35
  namespace?: string
27
36
  }
28
37
 
38
+ export type TraceQueryParameters = BaseTraceQueryParameters
39
+ & OneOf<{ cluster: string; clusterName: string }>
40
+
29
41
  export type FindTracesRequest = {
30
42
  query?: TraceQueryParameters
31
- }
32
-
33
- export type GetOperationsRequest = {
34
- service?: string
35
- spanKind?: string
36
- }
37
-
38
- export type Operation = {
39
- name?: string
40
- spanKind?: string
41
- }
42
-
43
- export type GetServicesRequest = {
44
- }
45
-
46
- export type GetServicesResponse = {
47
- services?: string[]
48
43
  }
@@ -3,24 +3,63 @@
3
3
  /*
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
- export type QueryBaseRequest = {
7
- cluster?: string
6
+
7
+ import * as InsightIoApiSpan_metricV1alpha1Otelspankind from "../../span_metric/v1alpha1/otelspankind.pb"
8
+
9
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
+ type OneOf<T> =
11
+ | { [k in keyof T]?: undefined }
12
+ | (
13
+ keyof T extends infer K ?
14
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
15
+ : never)
16
+ : never);
17
+
18
+ type BaseQueryBaseRequest = {
8
19
  namespace?: string
9
20
  serviceName?: string
21
+ spanKind?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
22
+ start?: string
23
+ end?: string
10
24
  }
11
25
 
26
+ export type QueryBaseRequest = BaseQueryBaseRequest
27
+ & OneOf<{ cluster: string; clusterName: string }>
28
+
12
29
  export type BatchQueryBaseRequest = {
13
30
  cluster?: string
14
31
  namespace?: string
15
32
  serviceName?: string[]
16
33
  }
17
34
 
35
+ export type Operation = {
36
+ operation?: string
37
+ spanKind?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind
38
+ callsTotal?: number
39
+ }
40
+
18
41
  export type OperationsQueryResponse = {
19
- operations?: string[]
42
+ operations?: Operation[]
20
43
  }
21
44
 
22
- export type TraceRequestById = {
45
+
46
+ type BaseTraceRequestById = {
23
47
  traceId?: string
24
- cluster?: string
25
48
  namespace?: string
49
+ }
50
+
51
+ export type TraceRequestById = BaseTraceRequestById
52
+ & OneOf<{ cluster: string; clusterName: string }>
53
+
54
+ export type ListServiceNamesRequest = {
55
+ clusterName?: string
56
+ namespace?: string
57
+ serviceName?: string
58
+ spanKind?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
59
+ start?: string
60
+ end?: string
61
+ }
62
+
63
+ export type GetServiceNamesResponse = {
64
+ services?: string[]
26
65
  }