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

Add instrumentation for confluent-kafka-go #100

Merged
merged 45 commits into from
Oct 1, 2021

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Sep 15, 2021

This new module instruments the built-inconfluent-kafka-go/kafka package. This instrumentation wraps the Consumer and Producer from the instrumented package. Kafka messages received and sent, both synchronously and asynchronously, are traced. The message headers are used to propagate trace context with a configurable TextMapPropagtor.

  • Comply with OpenTelemetry database semantic conventions
  • Package documentation
  • Exported objects are documented
  • Tests and linting are passing
  • Includes dependabot config
  • Library added to README.md

@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2021

Codecov Report

Merging #100 (ba6c12c) into main (ecebf9c) will increase coverage by 2.19%.
The diff coverage is 90.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
+ Coverage   81.32%   83.52%   +2.19%     
==========================================
  Files          23       27       +4     
  Lines         889     1159     +270     
==========================================
+ Hits          723      968     +245     
- Misses        134      155      +21     
- Partials       32       36       +4     
Flag Coverage Δ
Linux 82.65% <90.74%> (+2.45%) ⬆️
Windows 80.65% <ø> (ø)
macOS ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/confluent-kafka-go/kafka/splunkkafka/producer.go 87.50% <87.50%> (ø)
...c/confluent-kafka-go/kafka/splunkkafka/consumer.go 88.42% <88.42%> (ø)
...nc/confluent-kafka-go/kafka/splunkkafka/carrier.go 100.00% <100.00%> (ø)
...inc/confluent-kafka-go/kafka/splunkkafka/config.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecebf9c...ba6c12c. Read the comment docs.

@MrAlias
Copy link
Contributor Author

MrAlias commented Sep 16, 2021

@pellared thoughts on how we can exclude this package from being built on certain systems? confluent-kafka-go is not supported on Windows and it looks like Ubuntu 20.04 does not have a build of librdkafka-dev for i386 machine architecture.

@pellared
Copy link
Contributor

pellared commented Sep 16, 2021

@pellared thoughts on how we can exclude this package from being built on certain systems? confluent-kafka-go is not supported on Windows and it looks like Ubuntu 20.04 does not have a build of librdkafka-dev for i386 machine architecture.

To handle Windows, I would try adding the following build constraint to all files:

// +build !linux

package ...

For Ubuntu, I would add a step in GH workflow to install the package in the jobs where it is needed.

@MrAlias
Copy link
Contributor Author

MrAlias commented Sep 16, 2021

For Ubuntu, I would add a step in GH workflow to install the package in the jobs where it is needed.

Tried that. The package could not be found :|

@MrAlias
Copy link
Contributor Author

MrAlias commented Sep 16, 2021

// +build !linux

Guessing you meant // +build !windows. This does not work though: level=error msg="Running error: context loading failed: no go files to analyze".

@MrAlias MrAlias merged commit 9326f15 into signalfx:main Oct 1, 2021
@MrAlias MrAlias deleted the splunkkafka branch October 1, 2021 20:50
@MrAlias MrAlias mentioned this pull request Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants