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

fix: Updated Elasticsearch instrumentation to only register on v7.13.0+ #1816

Merged
merged 6 commits into from Oct 17, 2023

Conversation

mrickard
Copy link
Member

@mrickard mrickard commented Oct 16, 2023

Added semver check to noop for ElasticSearch prior to v7.13.0.
Added defensive check on body and bulkBody params.
Added tests to verify ElasticSearch v7.13.0 and later coverage.

How to Test

npm run versioned elastic

Related Issues

Closes #1809
Closes NR-170194.

…oop for earlier

Signed-off-by: mrickard <maurice@mauricerickard.com>
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

A few comments and questions. Nice tracking this down!

lib/instrumentation/@elastic/elasticsearch.js Outdated Show resolved Hide resolved
test/versioned/elastic/elasticsearch7.tap.js Outdated Show resolved Hide resolved
lib/instrumentation/@elastic/elasticsearch.js Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #1816 (a40d5d5) into main (99e5792) will increase coverage by 0.00%.
Report is 8 commits behind head on main.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1816   +/-   ##
=======================================
  Coverage   96.83%   96.83%           
=======================================
  Files         199      200    +1     
  Lines       38959    38994   +35     
=======================================
+ Hits        37724    37759   +35     
  Misses       1235     1235           
Flag Coverage Δ
integration-tests-16.x 78.91% <76.66%> (+<0.01%) ⬆️
integration-tests-18.x 79.18% <76.66%> (-0.01%) ⬇️
integration-tests-20.x 79.20% <76.66%> (+<0.01%) ⬆️
unit-tests-16.x 91.41% <79.54%> (-0.02%) ⬇️
unit-tests-18.x 91.39% <79.54%> (-0.02%) ⬇️
unit-tests-20.x 91.39% <79.54%> (-0.02%) ⬇️
versioned-tests-16.x 73.16% <97.72%> (+0.10%) ⬆️
versioned-tests-18.x 73.16% <97.72%> (+0.10%) ⬆️
versioned-tests-20.x 73.17% <97.72%> (+0.20%) ⬆️

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

Files Coverage Δ
lib/config/merge-server-config.js 100.00% <100.00%> (ø)
lib/instrumentation/@elastic/elasticsearch.js 100.00% <100.00%> (ø)
lib/util/objects.js 100.00% <100.00%> (ø)

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

@mrickard mrickard changed the title fix: Noop for ElasticSearch prior to v7.16.0 fix: Noop for ElasticSearch prior to v7.13.0 Oct 16, 2023
…ve. Consolidated supported versioned tests to one file

Signed-off-by: mrickard <maurice@mauricerickard.com>
Signed-off-by: mrickard <maurice@mauricerickard.com>
Signed-off-by: mrickard <maurice@mauricerickard.com>
Signed-off-by: mrickard <maurice@mauricerickard.com>
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

A few suggestions, getting close though

lib/util/objects.js Show resolved Hide resolved
lib/util/objects.js Outdated Show resolved Hide resolved
test/versioned/elastic/elasticsearch.tap.js Show resolved Hide resolved
test/versioned/elastic/elasticsearch.tap.js Outdated Show resolved Hide resolved
test/versioned/elastic/elasticsearch.tap.js Outdated Show resolved Hide resolved
…densed assignments

Signed-off-by: mrickard <maurice@mauricerickard.com>
@bizob2828 bizob2828 changed the title fix: Noop for ElasticSearch prior to v7.13.0 fix: Updated Elasticsearch instrumentation to only register on v7.13.0+ Oct 17, 2023
@bizob2828 bizob2828 merged commit 6437671 into newrelic:main Oct 17, 2023
28 checks passed
Node.js Engineering Board automation moved this from Needs PR Review to Done: Issues recently completed Oct 17, 2023
This was referenced Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Node.js Engineering Board
  
Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

Crash in elasticsearch instrumentation with null body.
3 participants