-
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
Add config for custom metrics tags #2971
Changes from 1 commit
e3a1799
1f5499e
07d8ff4
2f9ef7f
0e85090
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,6 +18,9 @@ KSQL 5.4.0 includes new features, including: | |||||
Avro record or JSON object, depending on the format in use, or as an anonymous value. | ||||||
For more information, refer to :ref:`ksql_single_field_wrapping`. | ||||||
|
||||||
* A new config `ksql.metrics.tags.custom` for adding custom tags to emitted JMX metrics. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the catch @JimGalasyn ! I updated an earlier line in the changelog with the same fix while I was at it. |
||||||
See :ref:`ksql-metrics-tags-custom` for usage. | ||||||
|
||||||
KSQL 5.4.0 includes the following misc. changes: | ||||||
|
||||||
* Require either the value for a ``@UdfParameter`` or for the UDF JAR to be compiled with | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
package io.confluent.ksql.util; | ||
|
||
import com.google.common.base.Splitter; | ||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.ImmutableMap; | ||
import io.confluent.ksql.config.ConfigItem; | ||
|
@@ -146,7 +147,7 @@ public class KsqlConfig extends AbstractConfig { | |
public static final String KSQL_CUSTOM_METRICS_TAGS = "ksql.metrics.tags.custom"; | ||
private static final String KSQL_CUSTOM_METRICS_TAGS_DOC = | ||
"A list of tags to be included with emitted JMX metrics, formatted as a string of key:value " | ||
+ "pairs separated by semicolons. For example, 'key1:value1;key2:value2'."; | ||
+ "pairs separated by commas. For example, 'key1:value1,key2:value2'."; | ||
|
||
public static final String | ||
defaultSchemaRegistryUrl = "http://localhost:8081"; | ||
|
@@ -718,6 +719,22 @@ public KsqlConfig overrideBreakingConfigsWithOriginalValues(final Map<String, St | |
return new KsqlConfig(ConfigGeneration.LEGACY, mergedProperties, mergedStreamConfigProps); | ||
} | ||
|
||
public Map<String, String> getStringAsMap(final String key) { | ||
final String value = getString(key).trim(); | ||
try { | ||
return value.equals("") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check for the NULL value as well. I think if you set a config like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I tried setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it was a different configuration that has NULL as default. |
||
? Collections.emptyMap() | ||
: Splitter.on(",").trimResults().withKeyValueSeparator(":").split(value); | ||
} catch (IllegalArgumentException e) { | ||
throw new KsqlException( | ||
String.format( | ||
"Invalid config value for '%s'. value: %s. reason: %s", | ||
key, | ||
value, | ||
e.getMessage())); | ||
} | ||
} | ||
|
||
private static Set<String> sslConfigNames() { | ||
final ConfigDef sslConfig = new ConfigDef(); | ||
SslConfigs.addClientSslSupport(sslConfig); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
import io.confluent.ksql.util.QueryMetadata; | ||
import java.io.Closeable; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
@@ -67,7 +68,7 @@ public KsqlEngine( | |
final ProcessingLogContext processingLogContext, | ||
final FunctionRegistry functionRegistry, | ||
final String serviceId, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I think we should couple |
||
final String customMetricsTags | ||
final Map<String, String> customMetricsTags | ||
) { | ||
this( | ||
serviceContext, | ||
|
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.
is it
to emit
orwith emitted
?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 have a slight preference for "adding ... to" versus "adding ... with" but I don't feel too strongly.