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

fixed the issue with setting tracing and metrics options with env variables #1112

Conversation

prasadmadanayake
Copy link

@prasadmadanayake prasadmadanayake commented Aug 3, 2022

📝 Description

When using the runner we cannot set tracing options using env variable because defaultOption tracing is a boolean and runner only update the values if property is an object

if (typeof obj[part] !== "object") {

So the fix is created by changing the tracing and metrics property to object with default state as false

🎯 Relevant issues

💎 Type of change

  • Bug fix (non-breaking change which fixes an issue)

📜 Example code

# now can set tracer type as below
MOL_TRACING__EXPORTER=Console 
# can set metrics type as below
MOL_METRICS__REPORTER=StatsD

🚦 How Has This Been Tested?

Created a sample service schema and execueted using moleculer-runner manually.

🏁 Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas

@icebob
Copy link
Member

icebob commented Aug 3, 2022

Could you make the same change with metrics as well, please?

@prasadmadanayake prasadmadanayake changed the title fixed the issue with setting tracing options with env variables fixed the issue with setting tracing and metrics options with env variables Aug 4, 2022
@prasadmadanayake
Copy link
Author

Could you make the same change with metrics as well, please?

updated

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

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

Thanks, good job!

@icebob icebob merged commit 937d50d into moleculerjs:master Aug 4, 2022
@prasadmadanayake prasadmadanayake deleted the bugfix/tracing_env_var_fix_for_runner branch August 7, 2022 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants