Skip to content

Commit

Permalink
fix: redis instrumentation startup stream check #666 (#818)
Browse files Browse the repository at this point in the history
* fix hasOwnProperty check

* Revert "fix hasOwnProperty check"

This reverts commit 671021c.

* fix(opentelemetry/instrumentation-redis) hasOwnProperty check fixes duplicate call check

in my project this code was called a second time based on importing. However in the case it was called again the check would fail. By switching to hasOwnProperty it fixes this issue.

* adding tests and changing stream check to not crash

* fix(opentelemetry/instrumentation-redis) changing has stream check

This reverts commit 5a04acc.

* style: fix lint

Co-authored-by: Jonathan Campos <jonathan@ridealto.com>
  • Loading branch information
rauno56 and jonbcampos-alto committed Jan 5, 2022
1 parent cf268e7 commit 81b3190
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const getTracedCreateStreamTrace = (
original: Function
) => {
return function create_stream_trace(this: redisTypes.RedisClient) {
if (!this.stream) {
if (!Object.prototype.hasOwnProperty.call(this, 'stream')) {
Object.defineProperty(this, 'stream', {
get() {
return this._patched_redis_stream;
Expand Down

0 comments on commit 81b3190

Please sign in to comment.