This is an automated email from the ASF dual-hosted git repository.

guoweijie pushed a commit to branch release-1.17
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.17 by this push:
     new 1e0b58aa8d9 [FLINK-31541][ui] encode request params to support special 
characters in metrics name.
1e0b58aa8d9 is described below

commit 1e0b58aa8d962469fa9dd7b470037aeaece43500
Author: Weihua Hu <huweihua....@gmail.com>
AuthorDate: Thu Mar 23 12:55:42 2023 +0800

    [FLINK-31541][ui] encode request params to support special characters in 
metrics name.
    
    This closes #22243
    
    (cherry picked from commit de27786eba56ce37c14f413eb8d7ba404eab50e1)
---
 .../src/app/services/job-manager.service.ts          | 20 +++++++++++---------
 .../src/app/services/metrics.service.ts              |  7 +++++--
 .../src/app/services/task-manager.service.ts         |  4 +++-
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git 
a/flink-runtime-web/web-dashboard/src/app/services/job-manager.service.ts 
b/flink-runtime-web/web-dashboard/src/app/services/job-manager.service.ts
index f99a48bd956..32d809304d0 100644
--- a/flink-runtime-web/web-dashboard/src/app/services/job-manager.service.ts
+++ b/flink-runtime-web/web-dashboard/src/app/services/job-manager.service.ts
@@ -97,15 +97,17 @@ export class JobManagerService {
 
   loadMetrics(listOfMetricName: string[]): Observable<MetricMap> {
     const metricName = listOfMetricName.join(',');
-    return 
this.httpClient.get<JobMetric[]>(`${this.configService.BASE_URL}/jobmanager/metrics?get=${metricName}`).pipe(
-      map(arr => {
-        const result: MetricMap = {};
-        arr.forEach(item => {
-          result[item.id] = parseInt(item.value, 10);
-        });
-        return result;
-      })
-    );
+    return this.httpClient
+      .get<JobMetric[]>(`${this.configService.BASE_URL}/jobmanager/metrics`, { 
params: { get: metricName } })
+      .pipe(
+        map(arr => {
+          const result: MetricMap = {};
+          arr.forEach(item => {
+            result[item.id] = parseInt(item.value, 10);
+          });
+          return result;
+        })
+      );
   }
 
   loadHistoryServerConfig(jobId: string): Observable<ClusterConfiguration[]> {
diff --git 
a/flink-runtime-web/web-dashboard/src/app/services/metrics.service.ts 
b/flink-runtime-web/web-dashboard/src/app/services/metrics.service.ts
index 5d98ce4bfb0..e6e475b1517 100644
--- a/flink-runtime-web/web-dashboard/src/app/services/metrics.service.ts
+++ b/flink-runtime-web/web-dashboard/src/app/services/metrics.service.ts
@@ -54,7 +54,9 @@ export class MetricsService {
   public loadMetrics(jobId: string, vertexId: string, listOfMetricName: 
string[]): Observable<MetricMapWithTimestamp> {
     const metricName = listOfMetricName.join(',');
     return this.httpClient
-      
.get<JobMetric[]>(`${this.configService.BASE_URL}/jobs/${jobId}/vertices/${vertexId}/metrics?get=${metricName}`)
+      
.get<JobMetric[]>(`${this.configService.BASE_URL}/jobs/${jobId}/vertices/${vertexId}/metrics`,
 {
+        params: { get: metricName }
+      })
       .pipe(
         map(arr => {
           const result: MetricMap = {};
@@ -79,7 +81,8 @@ export class MetricsService {
     const metricName = listOfMetricName.join(',');
     return this.httpClient
       .get<Array<{ id: string; min: number; max: number; avg: number; sum: 
number }>>(
-        
`${this.configService.BASE_URL}/jobs/${jobId}/vertices/${vertexId}/subtasks/metrics?get=${metricName}`
+        
`${this.configService.BASE_URL}/jobs/${jobId}/vertices/${vertexId}/subtasks/metrics`,
+        { params: { get: metricName } }
       )
       .pipe(
         map(arr => {
diff --git 
a/flink-runtime-web/web-dashboard/src/app/services/task-manager.service.ts 
b/flink-runtime-web/web-dashboard/src/app/services/task-manager.service.ts
index e0b6fb0ca9e..017538ae957 100644
--- a/flink-runtime-web/web-dashboard/src/app/services/task-manager.service.ts
+++ b/flink-runtime-web/web-dashboard/src/app/services/task-manager.service.ts
@@ -100,7 +100,9 @@ export class TaskManagerService {
   loadMetrics(taskManagerId: string, listOfMetricName: string[]): 
Observable<MetricMap> {
     const metricName = listOfMetricName.join(',');
     return this.httpClient
-      
.get<JobMetric[]>(`${this.configService.BASE_URL}/taskmanagers/${taskManagerId}/metrics?get=${metricName}`)
+      
.get<JobMetric[]>(`${this.configService.BASE_URL}/taskmanagers/${taskManagerId}/metrics`,
 {
+        params: { get: metricName }
+      })
       .pipe(
         map(arr => {
           const result: MetricMap = {};

Reply via email to