-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Before this change, setting `enableMinutelyProbes` to `false` would not disable the minutely probes system, it merely does not register the default minutely probe. The flag's behaviour has been changed so that the minutely probes system is disabled in its entirety when it is set to `false`. The `Probes` object within `Metrics` is replaced by a `NoopProbes` object, which does nothing when a probe is registered.
- Loading branch information
Showing
10 changed files
with
122 additions
and
35 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/nodejs/.changesets/fix-enableminutelyprobes-behaviour.md
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,21 @@ | ||
--- | ||
bump: "patch" | ||
type: "fix" | ||
--- | ||
|
||
Setting `enableMinutelyProbes` to `false` now disables the minutely probes | ||
system. Custom probes will not be called when the minutely probes are | ||
disabled. In addition, the `APPSIGNAL_ENABLE_MINUTELY_PROBES` environment | ||
variable can now be used to enable or disable the minutely probes. | ||
|
||
Before this change, setting `enableMinutelyProbes` to `false` would not | ||
register the default Node.js heap statistics minutely probe, but custom | ||
probes would still be called. To opt in for the previous behaviour, | ||
disabling only the Node.js heap statistics minutely probe without disabling | ||
custom probes, you can use the `probes.unregister()` method to unregister | ||
the default probe: | ||
|
||
```js | ||
const probes = appsignal.metrics().probes(); | ||
probes.unregister("v8_stats"); | ||
``` |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./span" | ||
export * from "./tracer" | ||
export * from "./metrics" | ||
export * from "./probes" |
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,19 @@ | ||
import { Probes } from "../interfaces" | ||
|
||
export class NoopProbes implements Probes { | ||
public get count(): number { | ||
return 0 | ||
} | ||
|
||
public register(name: string, fn: () => void): this { | ||
return this | ||
} | ||
|
||
public unregister(name: string): this { | ||
return this | ||
} | ||
|
||
public clear(): this { | ||
return this | ||
} | ||
} |