Kimahriman commented on a change in pull request #3369:
URL: https://github.com/apache/hadoop/pull/3369#discussion_r703950339
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/PrometheusMetricsSink.java
##########
@@ -53,42 +57,16 @@ public PrometheusMetricsSink() {
@Override
public void putMetrics(MetricsRecord metricsRecord) {
- for (AbstractMetric metrics : metricsRecord.metrics()) {
- if (metrics.type() == MetricType.COUNTER
- || metrics.type() == MetricType.GAUGE) {
+ for (AbstractMetric metric : metricsRecord.metrics()) {
+ if (metric.type() == MetricType.COUNTER
+ || metric.type() == MetricType.GAUGE) {
String key = prometheusName(
- metricsRecord.name(), metrics.name());
-
- StringBuilder builder = new StringBuilder();
- builder.append("# TYPE ")
- .append(key)
- .append(" ")
- .append(metrics.type().toString().toLowerCase())
- .append("\n")
- .append(key)
- .append("{");
- String sep = "";
-
- //add tags
- for (MetricsTag tag : metricsRecord.tags()) {
- String tagName = tag.name().toLowerCase();
-
- //ignore specific tag which includes sub-hierarchy
- if (!tagName.equals("numopenconnectionsperuser")) {
- builder.append(sep)
- .append(tagName)
- .append("=\"")
- .append(tag.value())
- .append("\"");
- sep = ",";
- }
Review comment:
Ah I didn't realize that was actually unable to be parsed by prometheus,
I thought it was just a thing you definitely don't want included in your
prometheus series that could be excluded from scraping. I'll add that back in
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]