Skip to content

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

Merged
abhishekrb19 merged 6 commits intoapache:masterfrom
TSFenwick:kafka-emitter-can-set-extra-dimensions-for-events-emitted
Feb 9, 2024
Merged

allow for kafka-emitter to have extra dimensions be set for each event it emits#15845
abhishekrb19 merged 6 commits intoapache:masterfrom
TSFenwick:kafka-emitter-can-set-extra-dimensions-for-events-emitted

Conversation

@TSFenwick
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

running this locally to verify it works as expected

Comment thread docs/development/extensions-contrib/kafka-emitter.md Outdated
Comment thread docs/development/extensions-contrib/kafka-emitter.md Outdated
KafkaEmitterConfig kafkaEmitterConfig = new KafkaEmitterConfig("localhost:9092", null, "metricTest",
"alertTest", null, "metadataTest",
"clusterNameTest", null, null
"clusterNameTest", null, null, null
Copy link
Copy Markdown
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?

Comment thread docs/development/extensions-contrib/kafka-emitter.md Outdated
Comment thread docs/development/extensions-contrib/kafka-emitter.md Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
@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