Skip to content

Commit

Permalink
Enable OOM monitoring by default (#3292)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsavoire authored Jun 26, 2023
1 parent 0fb796c commit e8dd7c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/dd-trace/src/profiling/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Config {
const endpointCollection = coalesce(options.endpointCollection,
DD_PROFILING_ENDPOINT_COLLECTION_ENABLED, false)
const pprofPrefix = coalesce(options.pprofPrefix,
DD_PROFILING_PPROF_PREFIX)
DD_PROFILING_PPROF_PREFIX, '')

this.enabled = enabled
this.service = service
Expand Down Expand Up @@ -88,7 +88,7 @@ class Config {
], this)

const oomMonitoringEnabled = isTrue(coalesce(options.oomMonitoring,
DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED, false))
DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED, true))
const heapLimitExtensionSize = coalesce(options.oomHeapLimitExtensionSize,
Number(DD_PROFILING_EXPERIMENTAL_OOM_HEAP_LIMIT_EXTENSION_SIZE), 0)
const maxHeapExtensionCount = coalesce(options.oomMaxHeapExtensionCount,
Expand Down
16 changes: 1 addition & 15 deletions packages/dd-trace/test/profiling/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,6 @@ describe('config', () => {
expect(exporterUrl).to.equal(expectedUrl)
})

it('should disable OOM heap profiler by default', () => {
const config = new Config()
expect(config.oomMonitoring).to.deep.equal({
enabled: false,
heapLimitExtensionSize: 0,
maxHeapExtensionCount: 0,
exportStrategies: [],
exportCommand: undefined
})
})

it('should support OOM heap profiler configuration', () => {
process.env = {
DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED: 'false'
Expand All @@ -171,10 +160,7 @@ describe('config', () => {
})
})

it('should use process as default strategy for OOM heap profiler', () => {
process.env = {
DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED: 'true'
}
it('should enable OOM heap profiler by default and use process as default strategy', () => {
const config = new Config()

expect(config.oomMonitoring).to.deep.equal({
Expand Down

0 comments on commit e8dd7c7

Please sign in to comment.