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

OpenSearch Integration #2940

Merged
merged 3 commits into from
Jul 7, 2023
Merged

OpenSearch Integration #2940

merged 3 commits into from
Jul 7, 2023

Conversation

sarahchen6
Copy link
Contributor

@sarahchen6 sarahchen6 commented Jun 29, 2023

OpenSearch Integration - Technical Specification.pdf

What does this PR do?
This PR implements the OpenSearch integration with dd-trace-rb code by creating and populating two directories: /lib/datadog/tracing/contrib/opensearch/ and /spec/datadog/tracing/contrib/opensearch/.

Motivation
OpenSearch has had over 100 million downloads since its fork from Elasticsearch in 2021. It is a widely used project with roughly 500 contributors. Thus, providing OpenSearch integration would benefit a substantial number of users and expand Datadog’s tracing client to offer more valuable trace requests and development visibility.

fixes #2628

Additional Notes
Under Github's checks, there are currently still failures with the Library Injection code.

How to test the change?
This code is covered by unit tests located in the /spec/datadog/tracing/contrib/opensearch/ directory. To test the change on your machine, run docker compose run --rm tracer-3.1 /bin/bash in your terminal to enter the docker environment. Once inside, run bundle exec appraisal ruby-3.1.2-contrib rspec spec/datadog/tracing/contrib/opensearch/patcher_spec.rb to test the patcher code. Run bundle exec appraisal ruby-3.1.2-contrib rspec spec/datadog/tracing/contrib/opensearch/quantize_spec.rb to test the quantization code.

This PR has also been tested by CircleCI.

@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Jun 29, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2023

Codecov Report

Merging #2940 (b5b8dfa) into master (fb06e8d) will increase coverage by 0.00%.
The diff coverage is 98.59%.

@@           Coverage Diff            @@
##           master    #2940    +/-   ##
========================================
  Coverage   97.97%   97.97%            
========================================
  Files        1287     1295     +8     
  Lines       71207    71564   +357     
  Branches     3284     3299    +15     
========================================
+ Hits        69764    70117   +353     
- Misses       1443     1447     +4     
Impacted Files Coverage Δ
lib/datadog/tracing/contrib/opensearch/quantize.rb 94.44% <94.44%> (ø)
lib/datadog/tracing/contrib/opensearch/patcher.rb 96.92% <96.92%> (ø)
...datadog/tracing/contrib/opensearch/patcher_spec.rb 99.23% <99.23%> (ø)
...acing/contrib/opensearch/configuration/settings.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/contrib/opensearch/ext.rb 100.00% <100.00%> (ø)
.../datadog/tracing/contrib/opensearch/integration.rb 100.00% <100.00%> (ø)
.../contrib/opensearch/configuration/settings_spec.rb 100.00% <100.00%> (ø)
...atadog/tracing/contrib/opensearch/quantize_spec.rb 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sarahchen6 sarahchen6 marked this pull request as ready for review July 3, 2023 15:19
@sarahchen6 sarahchen6 requested a review from a team July 3, 2023 15:19
@sarahchen6 sarahchen6 changed the title Feature/opensearch from scratch Feature/Opensearch Integration Jul 5, 2023
@sarahchen6 sarahchen6 changed the title Feature/Opensearch Integration Opensearch Integration Jul 5, 2023
@delner delner self-requested a review July 5, 2023 16:43
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Overall this is shaping up very nicely!

The only significant change I see so far that's an issue is the dependence upon Elasticsearch. We should be able to instrument OpenSearch without importing the instrumentation for Elasticsearch. See my comments about our options.

lib/datadog/tracing/contrib/opensearch/quantize.rb Outdated Show resolved Hide resolved
lib/datadog/tracing/contrib/opensearch/patcher.rb Outdated Show resolved Hide resolved
lib/datadog/tracing/contrib/opensearch/ext.rb Outdated Show resolved Hide resolved
@sarahchen6 sarahchen6 force-pushed the feature/opensearch_from_scratch branch from 40c18f9 to 3e80a38 Compare July 5, 2023 21:25
@sarahchen6 sarahchen6 requested review from marcotc and delner July 6, 2023 14:18
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

Awesome work, @sarahchen6! 🙇

Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Some minor suggestions, but otherwise looks great. Only thing I need to double check is the use of SpanAttributeSchema.... although this should happen soon, I didn't think this was yet merged to master. Want to check with @zarirhamza on this.

docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Show resolved Hide resolved

option :service_name do |o|
o.default do
Contrib::SpanAttributeSchema.fetch_service_name(
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious to see this in here. My understanding is this (SpanAttributeSchema) was still on a feature branch? Or is this really in master? cc @zarirhamza

Copy link
Contributor

Choose a reason for hiding this comment

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

Answering my question, this looks like it was a prototype of sorts merged months ago.

lib/datadog/tracing/contrib/opensearch/patcher.rb Outdated Show resolved Hide resolved
@sarahchen6 sarahchen6 requested a review from delner July 7, 2023 21:54
@sarahchen6 sarahchen6 changed the title Opensearch Integration OpenSearch Integration Jul 7, 2023
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

🎉

@sarahchen6 sarahchen6 merged commit 3cc3b68 into master Jul 7, 2023
203 checks passed
@sarahchen6 sarahchen6 deleted the feature/opensearch_from_scratch branch July 7, 2023 22:01
@github-actions github-actions bot added this to the 1.13.0 milestone Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for opensearch gem
4 participants