Skip to content

Commit

Permalink
fix: redis instrumentation startup stream check open-telemetry#666 (o…
Browse files Browse the repository at this point in the history
…pen-telemetry#818)

* fix hasOwnProperty check

* Revert "fix hasOwnProperty check"

This reverts commit 671021cb6e9732ef14ef50f69feabaa3d49d61a4.

* 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 5a04acc4b9ce47713c0fc5eec18cdd5ad52ab70d.

* style: fix lint

Co-authored-by: Jonathan Campos <[email protected]>
  • Loading branch information
rauno56 and jonbcampos-alto authored 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.