georgelza commented on PR #22:
URL: 
https://github.com/apache/flink-connector-prometheus/pull/22#issuecomment-2931916009

   def keen to get access to the jar that implements this sink, have a blog
   just about ready to implement a IoT ->kafka->flink-prometheus-Grafana
   flow...
   
   G
   
   On Mon, Jun 2, 2025 at 7:40 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_r2121788185>
   > :
   >
   > > +            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)) {
   > +                builder.addLabel(fieldName, fieldValue.getStringValue());
   > +            } else if 
(fieldName.equals(prometheusConfig.getMetricSampleTimestamp())) {
   > +                sampleTimestamp = fieldValue.getLongValue();
   > +            } else {
   > +                throw new IllegalArgumentException(
   >
   > Yes this is a good suggestion, and I can confirm that the validation are
   > already in place, please take a look at:
   >
   >    - PrometheusDynamicSinkFactory.validateMetricConfigKeys()
   >    - PrometheusDynamicSinkFactory.requiredOptions()
   >
   > They are both called in sink constructor which aligns with your suggestion
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/flink-connector-prometheus/pull/22#discussion_r2121788185>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AGZLFP4QHMAFJJKZDWJBOE33BSEB5AVCNFSM6AAAAAB2JAJHWCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQOBZGM4DKNJZGI>
   > .
   > 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to