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

allow for kafka-emitter to have extra dimensions be set for each event it emits #15845

Conversation

TSFenwick
Copy link
Contributor

@TSFenwick TSFenwick commented Feb 6, 2024

Description

Allow for extra dimensions to be set in the kafka emitter. This functionality will allow the clusterName config for kafka-emitter to not need to necessarily be used as this new config allows for more flexibility to add n different dimensions.
Also made various nullable/nonnull annotation fixes

Release note

User configurable dimensions can be set via druid.emitter.kafka.extra.dimensions for events emitted by KafkaEmitter. For example, druid.emitter.kafka.extra.dimensions={"region":"us-east-1","environment":"preProd"}.


Key changed/added classes in this PR
  • KafkaEmitter
  • KafkaEmitterConfig

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@TSFenwick
Copy link
Contributor Author

running this locally to verify it works as expected

@@ -117,7 +120,7 @@ public void testSerDeNotRequiredKafkaProducerConfigOrKafkaSecretProducer()
{
KafkaEmitterConfig kafkaEmitterConfig = new KafkaEmitterConfig("localhost:9092", null, "metricTest",
"alertTest", null, "metadataTest",
"clusterNameTest", null, null
"clusterNameTest", null, null, null
Copy link
Contributor

Choose a reason for hiding this comment

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

For code coverage, maybe make this non-null or add a new test with a non-null extra dimension map?

Copy link
Contributor

@abhishekrb19 abhishekrb19 left a comment

Choose a reason for hiding this comment

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

LGTM. +1 after CI (checkstyle is failing), thanks @TSFenwick!

@abhishekrb19
Copy link
Contributor

Ignoring the unrelated IT failure: [standard-its / (Compile=openjdk8, Run=openjdk8, Cluster Build On K8s) ITNestedQueryPushDownTest integration test] and the coverage check from hashCode, etc.

@abhishekrb19 abhishekrb19 merged commit 11a8624 into apache:master Feb 9, 2024
77 of 83 checks passed
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants