georgelza commented on PR #22: URL: https://github.com/apache/flink-connector-prometheus/pull/22#issuecomment-2930733548
Hi Daren I actually think the way you defining the labels are very elegant. G On Mon, Jun 2, 2025 at 3:27 PM darenwkt ***@***.***> wrote: > ***@***.**** commented on this pull request. > ------------------------------ > > In > flink-connector-prometheus/src/main/java/org/apache/flink/connector/prometheus/table/RowDataToPrometheusTimeSeriesConverter.java > <https://github.com/apache/flink-connector-prometheus/pull/22#discussion_r2121153890> > : > > > + PrometheusTimeSeries.Builder builder = PrometheusTimeSeries.builder(); > + Double sampleValue = null; > + Long sampleTimestamp = null; > + > + for (int i = 0; i < fields.size(); i++) { > + DataTypes.Field field = fields.get(i); > + RowData.FieldGetter fieldGetter = > + createFieldGetter(fields.get(i).getDataType().getLogicalType(), i); > + FieldValue fieldValue = new FieldValue(fieldGetter.getFieldOrNull(row)); > + String fieldName = field.getName(); > + > + if (fieldName.equals(prometheusConfig.getMetricName())) { > + builder.withMetricName(fieldValue.getStringValue()); > + } else if (fieldName.equals(prometheusConfig.getMetricSampleKey())) { > + sampleValue = fieldValue.getDoubleValue(); > + } else if (prometheusConfig.getLabelKeys().contains(fieldName)) { > > I may require further clarification on the question here, but my > understanding is that this approach allows setting any label name actually, > for example, the following label names are all valid: > > 'metric.label.keys' = '[my_label_1, my_label_2, ***@***.***, 123%label, label(123)]' > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/flink-connector-prometheus/pull/22#discussion_r2121153890>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AGZLFP7W3XYQO2NRRNNXMSL3BRGM3AVCNFSM6AAAAAB2JAJHWCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQOBYGQYTKNJUGI> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> > -- You have the obligation to inform one honestly of the risk, and as a person you are committed to educate yourself to the total risk in any activity! Once informed & totally aware of the risk, every fool has the right to kill or injure themselves as they see fit! -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org