darenwkt opened a new pull request, #22:
URL: https://github.com/apache/flink-connector-prometheus/pull/22

   <!--
   *Thank you for contributing to the Apache Flink Prometheus Connector - we 
are happy that you want to help us improve our Flink connectors. To help the 
community review your contribution in the best possible way, please go through 
the checklist below, which will get the contribution into a shape in which it 
can be best reviewed.*
   
   ## Contribution Checklist
   
   - The name of the pull request should correspond to a [JIRA 
issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are 
made for typos in JavaDoc or documentation files, which need no JIRA issue.
   - Commits should be in the form of "[FLINK-XXXX][Connectors / Prometheus] 
Title of the pull request", where [FLINK-XXXX] should be replaced by the actual 
issue number.
   - Each pull request should only have one JIRA issue.
   - Once all items of the checklist are addressed, remove the above text and 
this checklist, leaving only the filled out template below.
   -->
   
   ## Purpose of the change
   
   https://issues.apache.org/jira/browse/FLINK-33139 Implements Table API for 
Prometheus Sink
   
   ## Verifying this change
   
   Please make sure both new and modified tests in this PR follows the 
conventions defined in our code quality guide: 
https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
   
   This change added tests and can be verified as follows:
   - Added unit tests for RowDataElementConverter and DynamicSinkTableFactory
   - Manually verified by running the Prometheus Sink TableAPI to submit data 
to Amazon Managed Prometheus
   ![Screenshot 2025-03-31 at 22 00 
00](https://github.com/user-attachments/assets/cb7c3cb1-3ec8-4fc3-a46e-a4d848a33c50)
   
     - SQL Code ran for the test:
   ```
   CREATE TABLE PromTable (
     `my_metric_name` BIGINT,
     `my_label` BIGINT,
     `sample_value` BIGINT,
     `sample_ts` TIMESTAMP(3)
   )
   WITH (
     'connector' = 'prometheus',
     'aws.region' = 'us-east-1',
     'metric.request-signer' = 'amp',
     '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',
     'metric.sample.key' = 'sample_value',
     'metric.sample.timestamp' = 'sample_ts',
     'sink.batch.max-size' = '2',
     'sink.flush-buffer.size' = '1'
   );
   
   CREATE TABLE DataGen (
     `my_metric_name` STRING,
     `my_label` STRING,
     `sample_value` BIGINT,
     `sample_ts` TIMESTAMP(3)
   ) WITH (
     'connector' = 'datagen',
     'rows-per-second' = '50',
     'fields.my_metric_name.kind' = 'random',
     'fields.my_metric_name.values' = '["my_metric_1", "my_metric_2"]',
     'fields.my_label.kind' = 'random',
     'fields.my_label.values' = '["my_label_1", "my_label_2"]'
   );
   
   INSERT INTO PromTable SELECT my_metric_name, my_label, sample_value, 
sample_ts FROM DataGen;
   ```
   
   - Manually verified that existing Prometheus Sink DataStream API is still 
working
   <img width="399" alt="Screenshot 2025-04-02 at 09 38 23" 
src="https://github.com/user-attachments/assets/20af1d1c-20c3-46ed-8306-32756c3b0f8a";
 />
   
   ## Significant changes
   *(Please check any boxes [x] if the answer is "yes". You can first publish 
the PR and check them afterwards, for convenience.)*
   - [yes] Dependencies have been added or upgraded
   - [no] Public API has been changed (Public API is any class annotated with 
`@Public(Evolving)`)
   - [no] Serializers have been changed
   - [yes] New feature has been introduced
       - If yes, how is this documented? (JavaDocs)
   


-- 
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