-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: create MetricsContext for ksql metrics reporters #5528
feat: create MetricsContext for ksql metrics reporters #5528
Conversation
7ad7489
to
81657ea
Compare
0cf1ea2
to
a74fcc7
Compare
a74fcc7
to
26fff48
Compare
updatedProps.put(RESOURCE_LABEL_TYPE, KSQL_RESOURCE_TYPE); | ||
updatedProps.put(RESOURCE_LABEL_KSQL_SERVICE_ID, ksqlServiceId); | ||
updatedProps.put(RESOURCE_LABEL_CLUSTER_ID, ksqlServiceId); | ||
updatedProps.put(RESOURCE_LABEL_KAFKA_CLUSTER_ID, kafkaClusterId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this. According to KIP-606, "kafka.cluster.id" is for kafka broker. For client of TelemetryReporter, you only need resource.cluster.id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
return Collections.unmodifiableMap(props); | ||
} | ||
|
||
public Map<String, Object> getKsqlAdminClientConfigProps() { | ||
return getConfigsFor(AdminClientConfig.configNames()); | ||
final Map<String, Object> map = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want ksql cluster id and application propagate to AdminClient, you should add as part of admin client properties:
metrics.context.cluster.id, metrics.context.ksql.application.id
Because in KafkaAdminClient, we treat properties as metrics reporter properties if it starts with metrics.context: https://github.com/confluentinc/ce-kafka/blob/0f61da6b355f2f34e1b6d2f30072bb47f600bdae/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L495
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it so that metrics.context.resource.cluster.id=<ksql-service-id>
is being passed in for adminClient, producer, and streams
final Map<String, Object> map = new HashMap<>(); | ||
map.putAll(getConfigsFor(ProducerConfig.configNames())); | ||
|
||
map.putAll(getConfigsForPrefix(REPORTER_CONFIGS_PREFIXES)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as AdminClient
5d09d36
to
72e6413
Compare
Updated so that when KSQL is passing configs to consumer, producer, and AdminClient, then the configs should contain
Streams created by KSQL will have an additional config
KSQL Metrics Context
|
03f6fa6
to
b80b081
Compare
b80b081
to
9ff74dd
Compare
9ff74dd
to
4190131
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just making sure, if you don't specify any METRIC_REPORTER_CLASSES_CONFIG
then the default behavior is to report nothing back to confluent, right?
Yes, the list returned when trying to get configuredInstances will be empty. |
Description
Follow up to
https://github.com/apache/kafka/pull/8691/files
Testing done
Updated unit tests to pass
Reviewer checklist