This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config and more descriptive names on GCE/GKE
Allow for custom config files specified by the GCLOUD_DIAGNOSTICS_CONFIG environment variable. Also attach provided description to the debuggee so it is visible in the UI.
- Loading branch information
Matt Loring
committed
May 12, 2016
1 parent
3fcf3e8
commit c7e1572
Showing
12 changed files
with
170 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright 2015 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
'use strict'; | ||
|
||
// Default configuration | ||
module.exports = { | ||
debug: { | ||
enabled: true, | ||
|
||
// An identifier for the current code deployment. | ||
description: 'test config', | ||
|
||
// Log levels: 0-disabled,1-error,2-warn,3-info,4-debug. | ||
logLevel: 4, | ||
|
||
capture: { | ||
// Whether to include details about stack frames belonging to node-core. | ||
includeNodeModules: true, | ||
}, | ||
|
||
// These configuration options are for internal experimentation only. | ||
internal: { | ||
registerDelayOnFetcherErrorSec: 300 // 5 minutes. | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright 2015 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
process.env.GCLOUD_DIAGNOSTICS_CONFIG = 'test/fixtures/test-config.js'; | ||
process.env.GCLOUD_DEBUG_LOGLEVEL = 4; | ||
|
||
var assert = require('assert'); | ||
|
||
describe('should respect environment variables', function() { | ||
it('should respect GCLOUD_DIAGNOSTICS_CONFIG', function() { | ||
var agent = require('../..'); | ||
var config = agent.private_.config_; | ||
// Set by env var | ||
assert.equal(config.logLevel, 4); | ||
// Set default + user config | ||
assert.equal(config.internal.registerDelayOnFetcherErrorSec, 300); | ||
// Set by user | ||
assert.equal(config.capture.includeNodeModules, true); | ||
// In sub config but not set by user | ||
assert.equal(config.capture.maxExpandFrames, 5); | ||
// In top level config set by user | ||
assert.equal(config.description, 'test config'); | ||
// In top level config not set by user | ||
assert.equal(config.breakpointUpdateIntervalSec, 10); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters