darenwkt commented on code in PR #22: URL: https://github.com/apache/flink-connector-prometheus/pull/22#discussion_r2072389078
########## flink-connector-prometheus/src/main/java/org/apache/flink/connector/prometheus/table/PrometheusConnectorOption.java: ########## @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.connector.prometheus.table; + +import org.apache.flink.configuration.ConfigOption; +import org.apache.flink.configuration.ConfigOptions; + +import java.util.List; + +public class PrometheusConnectorOption { + + // ----------------------------------------------------------------------------------------- + // Prometheus connector specific options + // ----------------------------------------------------------------------------------------- + + public static final ConfigOption<String> METRIC_NAME = + ConfigOptions.key("metric.name") Review Comment: Thanks Lorenzo for the review and apology for the misleading example as there were typo in there, I have updated description and below with an accurate example: In the example below, a table is created where the metricName, labels are STRING and there are 2 labels (String/String) pairs used as you have correctly pointed out. ``` Flink SQL> CREATE TABLE PromTable ( > `my_metric_name` STRING, > `my_label_1` STRING, > `my_label_2` STRING, > `sample_value` BIGINT, > `sample_ts` TIMESTAMP(3) > ) > WITH ( > 'connector' = 'prometheus', > 'metric.endpoint-url' = 'https://aps-workspaces.us-east-1.amazonaws.com/workspaces/redacted/api/v1/remote_write', > 'metric.name' = 'my_metric_name', > 'metric.label.keys' = '[my_label_1,my_label_2]', > 'metric.sample.key' = 'sample_value', > 'metric.sample.timestamp' = 'sample_ts' > ); [INFO] Execute statement succeed. ``` Next, a row of sample data is inserted into the table where metricName="sample_name", and the label pairs are ("my_label_1":"sample_label_1", "my_label_2":"sample_label_2") ``` Flink SQL> INSERT INTO PromTable VALUES ('sample_name', 'sample_label_1', 'sample_label_2', 123, TIMESTAMP '2025-04-30 10:00:00.000'); [INFO] Submitting SQL update statement to the cluster... [INFO] SQL update statement has been successfully submitted to the cluster: Job ID: 596c86fb5485ddd3c1a3594e3c837d02 ``` -- 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