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

Introduce INSTANA_AUTO_PROFILE #128

Closed
wants to merge 1 commit into from
Closed

Introduce INSTANA_AUTO_PROFILE #128

wants to merge 1 commit into from

Conversation

mmanciop
Copy link

@mmanciop mmanciop commented Jun 22, 2020

Add option to activate AutoProfile via the INSTANA_AUTO_PROFILE env car, overriding the compiled setup. This also should work to enable AutoProfile with just recompilation and adding INSTANA_AUTO_PROFILE=true to the environment.

Copy link
Contributor

@andrewslotin andrewslotin left a comment

Choose a reason for hiding this comment

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

Great initiative! Being able to enable profiling without any code changes might be very handy when you need to understand the app state better and find the reason of sudden metric changes. The autoprofile package also offers a autoprofile.Disable() method that may override the env variable. I'll take over from here 👍

@@ -82,7 +83,7 @@ func InitSensor(options *Options) {
sensor = newSensor(options)

// enable auto-profiling
if options.EnableAutoProfile {
if options.EnableAutoProfile || strings.ToLower(os.Getenv("INSTANA_AUTO_PROFILE")) == "true" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could simplify configuration and simply check whether INSTANA_AUTO_PROFILE is set, just like we do with INSTANA_DEBUG.

@andrewslotin
Copy link
Contributor

Replaced by #132

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.

2 participants