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

ioredis: SetConfig not supported #624

Closed
blumamir opened this issue Aug 17, 2021 · 3 comments · Fixed by #689
Closed

ioredis: SetConfig not supported #624

blumamir opened this issue Aug 17, 2021 · 3 comments · Fixed by #689
Labels
bug Something isn't working good first issue up-for-grabs Good for taking. Extra help will be provided by maintainers

Comments

@blumamir
Copy link
Member

What version of OpenTelemetry are you using?

v0.24.0

What version of Node are you using?

12

What did you do?

tried to call setConfig function from the InstrumentationAbstract api on an instance of the ioredis instrumentation to update the config.

What did you expect to see?

instrumentation to use the new config on future operations

What did you see instead?

previous config is in use

Additional context

ioredis instrumentation is using the _config object during patching as closure param instead of reading the current attribute from this everytime it should be used. Thus instrumentation will not be affected when setConfig is called.

@blumamir blumamir added the bug Something isn't working label Aug 17, 2021
@vmarchaud vmarchaud added good first issue up-for-grabs Good for taking. Extra help will be provided by maintainers labels Aug 17, 2021
@mustafain117
Copy link
Contributor

I noticed that the IORedisInstrumentation does not override the base setConfig function. Using an instance of ioredis instrumentation, setConfig can only be called with parameters of the type InstrumentationConfig instead of type IORedisInstrumentationConfig to update the config. Does the scope of this issue include accepting IORedisInstrumentationConfig parameter type in setConfig?

@blumamir
Copy link
Member Author

I noticed that the IORedisInstrumentation does not override the base setConfig function. Using an instance of ioredis instrumentation, setConfig can only be called with parameters of the type InstrumentationConfig instead of type IORedisInstrumentationConfig to update the config. Does the scope of this issue include accepting IORedisInstrumentationConfig parameter type in setConfig?

I support fixing this too as part of this issue. That is: override the setConfig in the instrumentation with the correct type.
Would you like to create a PR for that?

@Flarna
Copy link
Member

Flarna commented Sep 29, 2021

IORedisInstrumentationConfig extends InstrumentationConfig therefore it should fit into the base class setConfig().

Actually it's getConfig which is more problematic as it returns only an InstrumentationConfig instead IORedisInstrumentationConfig.
But this is already tracked: open-telemetry/opentelemetry-js#2258
Maybe also relevant/related: open-telemetry/opentelemetry-js#2257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue up-for-grabs Good for taking. Extra help will be provided by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants