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

chore: Creating AppInfo was absolutely spamming the Info logs #10060

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,9 @@ private static Map<String, ConfigValue> buildStreamingConfig(
}

private final Map<String, ConfigValue> ksqlStreamConfigProps;
private static final AppInfoParser.AppInfo appInfo
= new AppInfoParser.AppInfo(System.currentTimeMillis());


public KsqlConfig(final Map<?, ?> props) {
this(ConfigGeneration.CURRENT, props);
Expand Down Expand Up @@ -1730,7 +1733,7 @@ private void possiblyConfigureConfluentTelemetry(final Map<String, Object> map)
metricReporters.remove(TELEMETRY_REPORTER_CLASS);
map.put(METRIC_REPORTER_CLASSES_CONFIG, metricReporters);
} else {
map.putAll(addConfluentMetricsContextConfigsKafka(Collections.emptyMap()));
map.putAll(addConfluentMetricsContextConfigsKafka(Collections.emptyMap(), appInfo));
}
}

Expand Down Expand Up @@ -1784,10 +1787,10 @@ public Map<String, Object> getConsumerClientConfigProps() {
}

public Map<String, Object> addConfluentMetricsContextConfigsKafka(
final Map<String,Object> props
final Map<String,Object> props,
final AppInfoParser.AppInfo appInfo
) {
final Map<String, Object> updatedProps = new HashMap<>(props);
final AppInfoParser.AppInfo appInfo = new AppInfoParser.AppInfo(System.currentTimeMillis());
updatedProps.putAll(getConfigsForPrefix(REPORTER_CONFIGS_PREFIXES));
updatedProps.put(MetricCollectors.RESOURCE_LABEL_VERSION, appInfo.getVersion());
updatedProps.put(MetricCollectors.RESOURCE_LABEL_COMMIT_ID, appInfo.getCommitId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
import org.apache.kafka.clients.admin.Admin;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.common.errors.WakeupException;
import org.apache.kafka.common.utils.AppInfoParser;
import org.apache.kafka.common.utils.Time;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.processor.internals.DefaultKafkaClientSupplier;
Expand Down Expand Up @@ -785,14 +786,15 @@ static KsqlRestApplication buildApplication(
final Admin internalAdmin = createCommandTopicAdminClient(restConfig, ksqlConfig);
final KafkaTopicClient internalTopicClient = new KafkaTopicClientImpl(() -> internalAdmin);

final AppInfoParser.AppInfo appInfo = new AppInfoParser.AppInfo(System.currentTimeMillis());
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this be a different app info result than what's in KsqlConfig since the system time would be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it was being created new with each call anyways. It only records the commit and version so I don't think that should change. Also the call in ksqlConfig was generating like 95% of our log traffic in soak and it was added since the last release

@stevenpyzhang

final CommandStore commandStore = CommandStore.Factory.create(
ksqlConfig,
commandTopicName,
Duration.ofMillis(restConfig.getLong(DISTRIBUTED_COMMAND_RESPONSE_TIMEOUT_MS_CONFIG)),
ksqlConfig.addConfluentMetricsContextConfigsKafka(
restConfig.getCommandConsumerProperties()),
restConfig.getCommandConsumerProperties(), appInfo),
ksqlConfig.addConfluentMetricsContextConfigsKafka(
restConfig.getCommandProducerProperties()),
restConfig.getCommandProducerProperties(), appInfo),
internalTopicClient
);

Expand Down