Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Supports Bulletin to view all metrics. #2584

Merged
merged 93 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
4a96c02
[remove]Remove optional comments.
zqr10159 Apr 23, 2024
1f6614d
[remove]Remove optional comments.
zqr10159 Apr 23, 2024
f4943e9
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 Apr 23, 2024
47dbe2f
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 Apr 24, 2024
26c3a80
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 Apr 25, 2024
7351a03
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 Apr 28, 2024
1cb919a
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 Apr 29, 2024
ccbc215
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 May 7, 2024
641ba47
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 May 9, 2024
2defaec
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 May 10, 2024
918073d
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 May 11, 2024
55d8dfd
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 May 14, 2024
ec1c041
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 May 18, 2024
ee32a89
Merge branch 'master' of github.com:dromara/hertzbeat
zqr10159 Jun 1, 2024
7a74f80
Merge branch 'master' of github.com:apache/hertzbeat
zqr10159 Jun 11, 2024
9c5ea20
[doc]HertzBeat 1.6.0 Upgrade Guide.
zqr10159 Jun 11, 2024
b0fdd5e
Merge branch 'master' of github.com:apache/hertzbeat
zqr10159 Jun 18, 2024
dbbbc04
Merge branch 'master' of github.com:apache/hertzbeat
zqr10159 Jul 2, 2024
cf4dd6b
[feature]Monitor bulletin.
zqr10159 Jul 2, 2024
c4f528a
[feature] Add monitor bulletin feature and related UI components.
zqr10159 Jul 3, 2024
83fbedb
[feature] Add Bulletin class and BulletinService interface.
zqr10159 Jul 3, 2024
370a17c
[feat(manager)] Implement Bulletin entity and service with JPA annota…
zqr10159 Jul 4, 2024
09d1f6f
[feat(bulletin)] Implement Bulletin entity and service with JPA annot…
zqr10159 Jul 4, 2024
92bd2f8
[feat(bulletin)] Add Bulletin entity and service layer
zqr10159 Jul 6, 2024
9b7d095
[refactor(bulletin)] remove
zqr10159 Jul 6, 2024
45d7c06
[feat(bulletin)] add dropdown selection to bulletin component
zqr10159 Jul 9, 2024
b45d8d3
Merge branch 'master' of github.com:apache/hertzbeat into bulletin
zqr10159 Jul 9, 2024
40a23f3
[feat(app-define)] add get app defines endpoint and i18n support
zqr10159 Jul 9, 2024
bdda79b
[feat(bulletin)] implement tree structure for metric selection
zqr10159 Jul 10, 2024
8ca928f
[feat(bulletin)] implement transfer component for metric selection
zqr10159 Jul 10, 2024
2a5d12c
[feat(bulletin)] integrate monitor selection into bulletin component
zqr10159 Jul 11, 2024
84c010e
[feat(bulletin)] add tags support for bulletin definitions
zqr10159 Jul 11, 2024
eca4e73
[feat(bulletin)] refactor tab and table components for dynamic data l…
zqr10159 Jul 11, 2024
0eaf08b
[feat(bulletin)] dynamically generate columns for metrics data
zqr10159 Jul 12, 2024
fb25e13
[feat(bulletin)] optimize data loading and column generation in bulle…
zqr10159 Jul 12, 2024
a380e6f
[feat(bulletin)] add metrics data support and optimize data loading
zqr10159 Jul 13, 2024
6d57704
Merge branch 'master' of github.com:apache/hertzbeat into bulletin
zqr10159 Jul 13, 2024
98ce1e2
Merge branch 'master' of github.com:apache/hertzbeat into bulletin
zqr10159 Jul 13, 2024
bc39945
feat(bulletin): implement dynamic metric fields for bulletin components
zqr10159 Jul 15, 2024
5b06274
refactor(manager): optimize metric fields handling in BulletinController
zqr10159 Jul 16, 2024
15e3a01
refactor(manager): improve metric fields structure in BulletinController
zqr10159 Jul 17, 2024
7ff2e2d
refactor(bulletin): improve table scroll configuration and metric fie…
zqr10159 Jul 17, 2024
c692eec
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 17, 2024
3295a22
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 18, 2024
03a0f5b
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 18, 2024
3c73afb
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 18, 2024
2bc74b4
Merge branch 'bulletin' of github.com:apache/hertzbeat into bulletin
zqr10159 Jul 18, 2024
ab91fde
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 19, 2024
79cb06c
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 20, 2024
8a00f2d
refactor(bulletin): optimize table layout and metric fields processing
zqr10159 Jul 21, 2024
1bf4d2b
Merge branch 'master' of github.com:apache/hertzbeat into bulletin
zqr10159 Jul 21, 2024
556b09f
feat(bulletin): add delete function and modify modal content
zqr10159 Jul 22, 2024
e1a261d
feat(bulletin): implement batch delete and update component structure
zqr10159 Jul 23, 2024
5e70923
feat(bulletin): implement batch delete and update component structure
zqr10159 Jul 25, 2024
ad2684a
feat(bulletin): modify metrics data processing and improve data struc…
zqr10159 Jul 26, 2024
2ae654c
refactor(bulletin-controller): optimize data processing and add const…
zqr10159 Jul 30, 2024
1538e91
feat(bulletin): implement pagination and sorting for metrics data
zqr10159 Jul 31, 2024
caba096
improve tableLoading
zqr10159 Aug 3, 2024
b2a6885
feat(bulletin): implement tab-based data loading and dynamic metric n…
zqr10159 Aug 6, 2024
7c5a5db
refactor(bulletin): restructure data grouping logic and update page s…
zqr10159 Aug 6, 2024
30ad15c
feat(bulletin): support multiple monitor IDs and app metrics
zqr10159 Aug 7, 2024
1522b8b
refactor(bulletin): support array type for metrics in define
zqr10159 Aug 7, 2024
5090d24
improve
zqr10159 Aug 8, 2024
4ddd97e
improve
zqr10159 Aug 10, 2024
1b9593c
refactor(bulletin): support array type for metrics in define
zqr10159 Aug 12, 2024
bcb4558
refactor(bulletin): support array type for metrics in define
zqr10159 Aug 13, 2024
d9fcaf7
refactor(bulletin): support array type for metrics in define
zqr10159 Aug 15, 2024
555b118
refactor(bulletin): support array type for metrics in define
zqr10159 Aug 16, 2024
498d3c5
improve
zqr10159 Aug 20, 2024
a4bd92d
improve
zqr10159 Aug 20, 2024
0bf4be7
improve
zqr10159 Aug 21, 2024
a0452f8
```feat(bulletin): i18n support and table display adjustments
zqr10159 Aug 22, 2024
92e18cf
```refactor(menu): rename Monitor-bulletin to Bulletin for clarityRen…
zqr10159 Aug 22, 2024
9d39635
Merge branch 'master' of github.com:apache/hertzbeat into bulletin
zqr10159 Aug 22, 2024
e272c63
```refactor(bulletin): move bulletin data building logic to BulletinS…
zqr10159 Aug 22, 2024
12c1dcc
Merge branch 'master' into bulletin
zqr10159 Aug 22, 2024
64c21f3
Merge branch 'master' into bulletin
yuluo-yx Aug 23, 2024
a8a3903
Merge branch 'master' into bulletin
yuluo-yx Aug 24, 2024
e490f77
Merge branch 'master' into bulletin
zqr10159 Aug 25, 2024
0efb734
```refactor: reformat code and adjust import statements
zqr10159 Aug 25, 2024
152b7f0
```docs(Fields): add Apache License header comment
zqr10159 Aug 25, 2024
4fe45b0
```fix(JsonUtilTest): correct isJsonStr method test cases
zqr10159 Aug 25, 2024
e2e801f
[improve] update sureness protocted api
tomsun28 Aug 25, 2024
06ff475
[improve] exact dup method
tomsun28 Aug 25, 2024
d888a7e
Fixed the issue of not refreshing when adding/deleting records.
kerwin612 Aug 26, 2024
579ea35
Merge branch 'master' into bulletin
kerwin612 Aug 26, 2024
c20c8e0
Merge branch 'master' into bulletin
kerwin612 Aug 26, 2024
f18fdee
Correct the form title issue
kerwin612 Aug 26, 2024
9d96120
Hide the edit button
kerwin612 Aug 26, 2024
a2c8044
Merge branch 'master' into bulletin
kerwin612 Aug 26, 2024
311a69c
Correct the incorrect null value check
kerwin612 Aug 26, 2024
eada072
Fixed the form reset logic
kerwin612 Aug 26, 2024
5aa67ff
Merge branch 'master' into bulletin
zqr10159 Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ public class Monitor {
/**
* Record create time
*/
@Schema(title = "Record create time", example = "1612198922000", accessMode = READ_ONLY)
@Schema(title = "Record create time", example = "2024-07-02T20:09:34.903217", accessMode = READ_ONLY)
@CreatedDate
private LocalDateTime gmtCreate;

/**
* Record the latest modification time (timestamp in milliseconds)
*/
@Schema(title = "Record modify time", example = "1612198444000", accessMode = READ_ONLY)
@Schema(title = "Record modify time", example = "2024-07-02T20:09:34.903217", accessMode = READ_ONLY)
@LastModifiedDate
private LocalDateTime gmtUpdate;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hertzbeat.common.entity.manager.bulletin;

import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.time.LocalDateTime;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.hertzbeat.common.entity.manager.JsonLongListAttributeConverter;
import org.apache.hertzbeat.common.entity.manager.JsonTagListAttributeConverter;
import org.apache.hertzbeat.common.entity.manager.TagItem;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

/**
* Bulletin
*/
@Entity
@Data
@Schema(description = "Bulletin")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
@Table(name = "hzb_bulletin")
public class Bulletin {

@Id
@Schema(description = "Bulletin ID", example = "1")
private Long id;

@Schema(description = "Bulletin Name", example = "Bulletin1", accessMode = READ_WRITE)
private String name;

@Schema(description = "Monitor IDs", example = "1")
@Column(name = "monitor_ids", length = 5000)
@Convert(converter = JsonLongListAttributeConverter.class)
private List<Long> monitorIds;

@Schema(description = "Monitor Type eg: jvm, tomcat", example = "jvm", accessMode = READ_WRITE)
private String app;


@Schema(description = "Monitor Fields")
@Column(length = 4096, columnDefinition = "json")
private String fields;

@Schema(description = "Tags(status:success,env:prod)", example = "{name: key1, value: value1}",
accessMode = READ_WRITE)
@Convert(converter = JsonTagListAttributeConverter.class)
@Column(length = 2048)
private List<TagItem> tags;

@Schema(title = "The creator of this record", example = "tom", accessMode = READ_WRITE)
@CreatedBy
private String creator;

@Schema(title = "The modifier of this record", example = "tom", accessMode = READ_WRITE)
@LastModifiedBy
private String modifier;

@Schema(title = "Record create time", example = "2024-07-02T20:09:34.903217", accessMode = READ_WRITE)
@CreatedDate
private LocalDateTime gmtCreate;

@Schema(title = "Record modify time", example = "2024-07-02T20:09:34.903217", accessMode = READ_WRITE)
@LastModifiedDate
private LocalDateTime gmtUpdate;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


package org.apache.hertzbeat.common.entity.manager.bulletin;

import java.util.List;
import java.util.Map;
import lombok.Data;

/**
* Bulletin DTO
*/
@Data
public class BulletinDto {

/**
* Bulletin name
*/
private String name;

/**
* Monitor type eg: jvm, tomcat
*/
private String app;


/**
* Monitor fields
*/
private Map<String, List<String>> fields;

/**
* Monitor ids
*/
private List<Long> monitorIds;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hertzbeat.common.entity.manager.bulletin;

import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Bulletin Metrics Data
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Bulletin Metrics Data")
public class BulletinMetricsData {

/**
* Bulletin Name
*/
@Schema(title = "Bulletin Name")
private String name;

/**
* Content Data
*/
@Schema(description = "Content Data")
private List<Data> content;

/**
* Bulletin Metrics Data
*/
@lombok.Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public static class Data {

/**
* Monitor Name
*/
@Schema(title = "Monitor name")
private String monitorName;

/**
* Monitor ID
*/
@Schema(title = "Monitor ID")
private Long monitorId;

/**
* Monitor IP
*/
@Schema(title = "Monitor IP")
private String host;

/**
* Monitor Metrics
*/
@Schema(title = "Monitor Metrics")
private List<Metric> metrics;
}

/**
* Metrics Data
*/
@lombok.Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Metrics Data")
public static class Metric{

/**
* Metric type
*/
@Schema(title = "Metric type")
private String name;

/**
* Metric fields
*/
@Schema(title = "Metric fields")
private List<List<Field>> fields;
}


/**
* Metrics field
*/
@lombok.Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Metrics field")
public static class Field{

/**
* Field name
*/
@Schema(title = "Field name")
private String key;

/**
* Field unit
*/
@Schema(title = "Field unit")
private String unit;

/**
* Field value
*/
@Schema(title = "Field value")
private String value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hertzbeat.common.entity.manager.bulletin;

import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.hertzbeat.common.entity.manager.TagItem;

/**
* Bulletin Vo
*/

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BulletinVo {

/**
* Bulletin ID
*/
private Long id;

/**
* Bulletin name
*/
private String name;

/**
* Bulletin metrics
*/
private List<String> metrics;

/**
* Bulletin tags
*/
private List<TagItem> tags;

/**
* Bulletin monitor ID
*/
private List<Long> monitorId;

/**
* Bulletin monitor name
*/
private String app;

}
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@ public static JsonNode fromJson(String jsonStr) {
* @param jsonStr json string
* @return true if the string is a json string
*/


public static boolean isJsonStr(String jsonStr) {
if (!StringUtils.hasText(jsonStr)) {
if (jsonStr == null || jsonStr.trim().isEmpty()) {
return false;
}
if (!jsonStr.startsWith("{") || !jsonStr.endsWith("}")) {
jsonStr = jsonStr.trim();
if (!(jsonStr.startsWith("{") && jsonStr.endsWith("}"))
&& !(jsonStr.startsWith("[") && jsonStr.endsWith("]"))) {
return false;
}
try {
Expand Down
Loading
Loading