Skip to content

Commit

Permalink
fix:修复可观测性中请求时延图的指标异常 (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
qdsordinarydream authored Oct 9, 2023
1 parent 6834505 commit c3b6b0f
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions web/src/polaris/monitor/registryMonitor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ export const getQueryMap = {
name: '均值',
query:
interfaceName && podName
? `avg(client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `avg(client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `avg(client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `avg(client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `avg(client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `avg(client_rq_timeout) or on() vector(0)`,
? `avg(client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `avg(client_rq_timeout_avg) or on() vector(0)`,
boardFunction: AvgReduceFunction,
unit: 'ms',
minStep: 60,
Expand All @@ -130,12 +130,12 @@ export const getQueryMap = {
name: '最大值',
query:
interfaceName && podName
? `max(client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `max(client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `max(client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `max(client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `max(client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `max(client_rq_timeout) or on() vector(0)`,
? `max(client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `max(client_rq_timeout_avg) or on() vector(0)`,
boardFunction: MaxReduceFunction,
unit: 'ms',
minStep: 60,
Expand All @@ -145,12 +145,12 @@ export const getQueryMap = {
name: '最小值',
query:
interfaceName && podName
? `min(client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `min(client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `min(client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `min(client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `min(client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `min(client_rq_timeout) or on() vector(0)`,
? `min(client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `min(client_rq_timeout_avg) or on() vector(0)`,
boardFunction: MinReduceFunction,
unit: 'ms',
minStep: 60,
Expand All @@ -160,25 +160,25 @@ export const getQueryMap = {
name: 'P99',
query:
interfaceName && podName
? `quantile(0.99, client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `quantile(0.99, client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `quantile(0.99, client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `quantile(0.99, client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `quantile(0.99, client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.99, client_rq_timeout) or on() vector(0)`,
? `quantile(0.99, client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.99, client_rq_timeout_avg) or on() vector(0)`,
asyncBoardFunction: async () => {
const res = await getMonitorData({
start,
end,
step: interval,
query:
interfaceName && podName
? `quantile(0.99, client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `quantile(0.99, client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `quantile(0.99, client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `quantile(0.99, client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `quantile(0.99, client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.99, client_rq_timeout) or on() vector(0)`,
? `quantile(0.99, client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.99, client_rq_timeout_avg) or on() vector(0)`,
})
const point = res?.[0]?.values?.[0]
if (!point) return '-'
Expand All @@ -193,25 +193,25 @@ export const getQueryMap = {
name: 'P95',
query:
interfaceName && podName
? `quantile(0.95, client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `quantile(0.95, client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `quantile(0.95, client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `quantile(0.95, client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `quantile(0.95, client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.95, client_rq_timeout) or on() vector(0)`,
? `quantile(0.95, client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.95, client_rq_timeout_avg) or on() vector(0)`,
asyncBoardFunction: async () => {
const res = await getMonitorData({
start,
end,
step: interval,
query:
interfaceName && podName
? `quantile(0.95, client_rq_timeout{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
? `quantile(0.95, client_rq_timeout_avg{api=~"${interfaceName}",polaris_server_instance="${podName}"}) or on() vector(0)`
: interfaceName
? `quantile(0.95, client_rq_timeout{api=~"${interfaceName}"}) or on() vector(0)`
? `quantile(0.95, client_rq_timeout_avg{api=~"${interfaceName}"}) or on() vector(0)`
: podName
? `quantile(0.95, client_rq_timeout{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.95, client_rq_timeout) or on() vector(0)`,
? `quantile(0.95, client_rq_timeout_avg{polaris_server_instance="${podName}"}) or on() vector(0)`
: `quantile(0.95, client_rq_timeout_avg) or on() vector(0)`,
})
const point = res?.[0]?.values?.[0]
if (!point) return '-'
Expand Down

0 comments on commit c3b6b0f

Please sign in to comment.