-
Notifications
You must be signed in to change notification settings - Fork 994
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update parser to parse from prometheus txt metrics data (#1421)
Signed-off-by: tomsun28 <tomsun28@outlook.com>
- Loading branch information
Showing
4 changed files
with
341 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...src/main/java/org/dromara/hertzbeat/collector/collect/prometheus/parser/MetricFamily.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.dromara.hertzbeat.collector.collect.prometheus.parser; | ||
|
||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* metric family | ||
* | ||
*/ | ||
@Data | ||
@ToString | ||
public class MetricFamily { | ||
|
||
/** | ||
* metric name | ||
*/ | ||
private String name; | ||
|
||
/** | ||
* metrics | ||
*/ | ||
private List<Metric> metricList; | ||
|
||
@Data | ||
public static class Metric { | ||
|
||
private List<Label> labels; | ||
|
||
private double value; | ||
|
||
private long timestamp; | ||
} | ||
|
||
@Data | ||
public static class Label { | ||
|
||
private String name; | ||
|
||
private String value; | ||
} | ||
} |
Oops, something went wrong.