Skip to content

Conversation

@arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Feb 26, 2025

PR-Codex overview

This PR focuses on replacing the kafkajs dependency with @confluentinc/kafka-javascript in the service-utils package, updating the getTopicName function to handle different sources, and removing unnecessary configurations.

Detailed summary

  • Replaced kafkajs with @confluentinc/kafka-javascript in package.json.
  • Updated getTopicName function in usageV2.ts to handle "sdk" and "engine" sources.
  • Removed shouldCompress option from UsageV2Producer.
  • Simplified sendEvents method in UsageV2Producer.
  • Adjusted Kafka producer configuration and connection handling.
  • Added version property to ClientUsageV2Event interface.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@arcoraven arcoraven requested a review from a team as a code owner February 26, 2025 01:26
@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2025

🦋 Changeset detected

Latest commit: f4a596e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thirdweb-dev/service-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ❌ Failed (Inspect) Feb 26, 2025 1:36am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Feb 26, 2025 1:36am
login ⬜️ Skipped (Inspect) Feb 26, 2025 1:36am
thirdweb_playground ⬜️ Skipped (Inspect) Feb 26, 2025 1:36am
wallet-ui ⬜️ Skipped (Inspect) Feb 26, 2025 1:36am

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 26, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

"@confluentinc/kafka-javascript": "^1.2.0",
"aws4fetch": "1.0.20",
"kafkajs": "2.2.4",
"lz4js": "0.2.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no longer need to import and configure lz4 for compression

@socket-security
Copy link

socket-security bot commented Feb 26, 2025

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@confluentinc/[email protected] environment Transitive: filesystem, network, shell +58 11 MB confluent-npm

View full report↗︎

* Connects the producer. Can be called explicitly at the start of your service, or will be called automatically when sending messages.
*/
async connect() {
await this.producer.connect();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may not be concurrency-safe. Might need to wrap in a try/catch?

options?: KafkaProducerSendOptions,
): Promise<void> {
async sendEvents(events: UsageV2Event[]): Promise<void> {
const parsedEvents = events.map((event) => ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not setting a fallback for version here.
version is intended to be defined by the caller optionally.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.56 KB (0%) 932 ms (0%) 205 ms (+139.25% 🔺) 1.2 s
thirdweb (cjs) 124.25 KB (0%) 2.5 s (0%) 281 ms (+0.99% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 47 ms (+442.46% 🔺) 159 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 18 ms (+136.97% 🔺) 28 ms
thirdweb/react (minimal + tree-shaking) 19.35 KB (0%) 387 ms (0%) 76 ms (+96.74% 🔺) 463 ms

Copy link
Member

@jnsdls jnsdls left a comment

Choose a reason for hiding this comment

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

LGTM minus discussed change

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground February 26, 2025 01:36 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 February 26, 2025 01:36 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui February 26, 2025 01:36 Inactive
@vercel vercel bot temporarily deployed to Preview – login February 26, 2025 01:36 Inactive
@arcoraven arcoraven merged commit 0595c37 into main Feb 26, 2025
12 of 28 checks passed
@arcoraven arcoraven deleted the ph/update-kafka-library branch February 26, 2025 01:36
@joaquim-verges joaquim-verges mentioned this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants