Keylchen commented on code in PR #6334:
URL: https://github.com/apache/inlong/pull/6334#discussion_r1009209802
##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/metrics/prometheus/PrometheusMetricListener.java:
##########
@@ -179,31 +175,33 @@ public void snapshot(String domain, List<MetricItemValue>
itemValues) {
public List<MetricFamilySamples> collect() {
// total
- CounterMetricFamily totalCounter = new CounterMetricFamily(metricName
+ "&group=total",
+ CounterMetricFamily totalCounter = new CounterMetricFamily(metricName,
Review Comment:
Special character will cause `expected text error`
##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/metrics/prometheus/PrometheusMetricListener.java:
##########
@@ -179,31 +175,33 @@ public void snapshot(String domain, List<MetricItemValue>
itemValues) {
public List<MetricFamilySamples> collect() {
// total
- CounterMetricFamily totalCounter = new CounterMetricFamily(metricName
+ "&group=total",
+ CounterMetricFamily totalCounter = new CounterMetricFamily(metricName,
"The metrics of dataproxy node.",
Arrays.asList("dimension"));
totalCounter.addMetric(Arrays.asList(M_READ_SUCCESS_COUNT),
metricItem.readSuccessCount.get());
totalCounter.addMetric(Arrays.asList(M_READ_SUCCESS_SIZE),
metricItem.readSuccessSize.get());
totalCounter.addMetric(Arrays.asList(M_READ_FAIL_COUNT),
metricItem.readFailCount.get());
totalCounter.addMetric(Arrays.asList(M_READ_FAIL_SIZE),
metricItem.readFailSize.get());
- //
+ // send
totalCounter.addMetric(Arrays.asList(M_SEND_COUNT),
metricItem.sendCount.get());
totalCounter.addMetric(Arrays.asList(M_SEND_SIZE),
metricItem.sendSize.get());
- //
totalCounter.addMetric(Arrays.asList(M_SEND_SUCCESS_COUNT),
metricItem.sendSuccessCount.get());
totalCounter.addMetric(Arrays.asList(M_SEND_SUCCESS_SIZE),
metricItem.sendSuccessSize.get());
totalCounter.addMetric(Arrays.asList(M_SEND_FAIL_COUNT),
metricItem.sendFailCount.get());
totalCounter.addMetric(Arrays.asList(M_SEND_FAIL_SIZE),
metricItem.sendFailSize.get());
- //
+ // duration
totalCounter.addMetric(Arrays.asList(M_SINK_DURATION),
metricItem.sinkDuration.get());
totalCounter.addMetric(Arrays.asList(M_NODE_DURATION),
metricItem.nodeDuration.get());
totalCounter.addMetric(Arrays.asList(M_WHOLE_DURATION),
metricItem.wholeDuration.get());
List<MetricFamilySamples> mfs = new ArrayList<>();
mfs.add(totalCounter);
// id dimension
- CounterMetricFamily idCounter = new CounterMetricFamily(metricName +
"&group=id",
- "The metrics of inlong datastream.", this.dimensionKeys);
+ List<String> dimensionIdKeys = new ArrayList<>();
+ dimensionIdKeys.add(DEFAULT_DIMENSION_LABEL);
+ dimensionIdKeys.addAll(this.dimensionKeys);
+ CounterMetricFamily idCounter = new CounterMetricFamily(metricName +
"_id",
Review Comment:
Special character will cause `expected text error`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]