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

contrib/IBM/sarama: adds trace for IBM/sarama #2142

Merged
merged 5 commits into from
Aug 29, 2023

Conversation

rodrigoff
Copy link
Contributor

What does this PR do?

As of version 1.40.0 and moving forward, sarama's ownership has been transfered from Shopify to IBM.

This change adds the contrib package for the new package as a copy of contrib/Shopify/sarama (in order not to break anything) to allow for apps to migrate to the new package.

Motivation

See IBM/sarama#2461 for more details

Describe how to test/QA your changes

Reviewer's Checklist

  • Changed code has unit tests for its functionality.
  • If this interacts with the agent in a new way, a system test has been added.

@rodrigoff rodrigoff requested a review from a team July 25, 2023 12:24
@rodrigoff rodrigoff requested a review from a team as a code owner July 25, 2023 12:24
@rarguelloF rarguelloF added the apm:ecosystem contrib/* related feature requests or bugs label Jul 27, 2023
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution.
There are just a few minor things to take care of.

@@ -0,0 +1,304 @@
// Unless explicitly stated otherwise all files in this repository are licensed
Copy link
Contributor

Choose a reason for hiding this comment

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

The path for this needs to be contrib/IBM/sarama.v1/

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've updated the path.

go.mod Outdated
@@ -12,7 +12,8 @@ require (
github.com/DataDog/go-libddwaf v1.4.1
github.com/DataDog/gostackparse v0.5.0
github.com/DataDog/sketches-go v1.2.1
github.com/Shopify/sarama v1.22.0
github.com/IBM/sarama v1.40.0
github.com/Shopify/sarama v1.19.0
Copy link
Contributor

@knusbaum knusbaum Aug 3, 2023

Choose a reason for hiding this comment

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

Is there a reason to downgrade this dependency?
We should avoid doing this unless necessary.

It looks like this might be causing the CI to fail.

Copy link
Contributor Author

@rodrigoff rodrigoff Aug 8, 2023

Choose a reason for hiding this comment

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

No reason, that was unintentional. The original version was restored.

const componentName = "IBM/sarama"

func init() {
telemetry.LoadIntegration("IBM/sarama")
Copy link
Contributor

@knusbaum knusbaum Aug 3, 2023

Choose a reason for hiding this comment

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

We want to add a tracer.MarkIntegrationImported("github.com/IBM/sarama") line here like we do in the current sarama package.
There also needs to be an entry in ddtrace/tracer/option.go in the contribIntegrations map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@rodrigoff rodrigoff force-pushed the add-contrib-ibm-sarama branch 2 times, most recently from 9af3449 to 42f471c Compare August 8, 2023 17:46
@rodrigoff
Copy link
Contributor Author

@knusbaum Hey, I've taken care of the issues you pointed out and rebased to the latest version.

Please review the changes again whenever you get the chance :)

const componentName = "IBM/sarama"

func init() {
telemetry.LoadIntegration("IBM/sarama")
Copy link
Contributor

Choose a reason for hiding this comment

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

To keep things consistent with the other contrib packages, let's use telemetry.LoadIntegration(componentName) here instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Comment on lines 88 to 89
"github.com/IBM/sarama": {"Kafka (sarama)", false},
"github.com/Shopify/sarama": {"Kafka (sarama)", false},
Copy link
Contributor

Choose a reason for hiding this comment

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

Having two integrations called "Kafka (sarama)" might be misleading. Can we change them to better represent what contrib integrations they come from? I.e., "IBM sarama" and "Shopify sarama" or similar

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 agree, I was just trying to keep consistency with confluent-kafka-go which is named Kafka (confluent) (and Kafka (confluent) v2, but looking at other contrib names, I don't think that's necessary.

I've updated both names to better represent their integration.

Rodrigo F. Fernandes added 3 commits August 21, 2023 14:42
As of version 1.40.0 and moving forward, sarama's ownership has been
transfered from Shopify to IBM.

This change adds the contrib package for the new package as a copy of
contrib/Shopify/sarama (in order not to break anything) to allow for
apps to migrate to the new package.
Copy link
Contributor

@zarirhamza zarirhamza left a comment

Choose a reason for hiding this comment

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

LGTM, just added a quick fix to the tracer test where we have a count of all existing integrations.

Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

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

Thanks for working with us on this!
Looks great!

@zarirhamza zarirhamza merged commit 1a1341a into DataDog:main Aug 29, 2023
9 checks passed
@rodrigoff rodrigoff deleted the add-contrib-ibm-sarama branch August 30, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants