Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup metric solves feature request #179 #180

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

cl-a-us
Copy link

@cl-a-us cl-a-us commented Aug 26, 2022

This PR introduces the feature discussed in #179.

It allows enabling a custom metric to determine the number of messages/records that will be published into the Kafka topic.

To reduce database load, the corresponding query is executed at startup only. The metric is published via JMX under io.aiven.connect.jdbc.initialImportCount<task=\"{connector/task_name}\", topic=\"{topic_name}\", [table=\"{table_name}\",
The attribute ‘table’ is optional, depending on the table or query mode.

The feature is disabled by default and can be enabled with the config JdbcSourceTaskConfig.INITIAL_MESSAGE_COUNT_METRIC_ENABLED_CONFIG

@cl-a-us cl-a-us requested review from a team as code owners August 26, 2022 13:36
@mdedetrich
Copy link

Thanks for the PR!

I just ran the CI and I could see that tests are failing, are the tests passing locally on your machine?

@mdedetrich
Copy link

Thanks, rerunning CI

@mdedetrich
Copy link

Okay so CI looks good

@DerPfeiffer
Copy link

This feature looks interesting for us too. Do you know when it will be usable @mdedetrich ?

import org.slf4j.LoggerFactory;

/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add proper documentation here.


import static io.aiven.connect.jdbc.source.JdbcSourceTaskConfig.TABLES_CONFIG;

public class StartupMetricUpdater {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add proper documentation here. What does this class do. Are there any design constraints that future developers should know about, etc.

properties.put(JdbcSourceTaskConfig.TABLES_CONFIG, "");
properties.put(JdbcSourceTaskConfig.QUERY_CONFIG,
"SELECT * FROM \"" + SINGLE_TABLE_NAME + "\" WHERE \"id\" > 0");
properties.put("name", "soneTaskName");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an intentional typo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants