{"record":{"id":"a3e2c49749d3628f","repo":"Netflix/chaosmonkey","slug":"unsupported-error-counter-s","errorCode":null,"errorMessage":"unsupported error counter: %s","messagePattern":"unsupported error counter: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"errorcounter/errorcounter.go","lineNumber":41,"sourceCode":"\n// Netflix uses Atlas for tracking error events.\n// In the open-source build, we currently only support a null (no-op) error\n// counter\n\ntype nullErrorCounter struct{}\n\nfunc (n nullErrorCounter) Increment() error {\n\treturn nil\n}\n\nfunc init() {\n\tdeps.GetErrorCounter = getNullErrorCounter\n}\n\nfunc getNullErrorCounter(cfg *config.Monkey) (chaosmonkey.ErrorCounter, error) {\n\tkind := cfg.ErrorCounter()\n\tif kind != \"\" {\n\t\treturn nil, errors.Errorf(\"unsupported error counter: %s\", kind)\n\t}\n\n\treturn nullErrorCounter{}, nil\n}\n","sourceCodeStart":23,"sourceCodeEnd":46,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/errorcounter/errorcounter.go#L23-L46","documentation":"getNullErrorCounter is the default factory for the monkey's error counter. Any non-empty cfg.ErrorCounter() value is rejected because only the built-in null (no-op) error counter exists; no third-party error counters are supported. The error names the unsupported kind via %s.","triggerScenarios":"Setting an error counter config value (e.g. error_counter in the monkey config) to any non-empty string while using this library, since no alternative error counter kinds are implemented.","commonSituations":"Copying config from a fork or docs that mention error counters (e.g. 'datadog', 'prometheus') that this build does not support; typo intended to disable the counter instead of leaving it empty.","solutions":["Remove the error counter setting from the monkey config so it stays empty and the nullErrorCounter is used","If a real counter is needed, implement a chaosmonkey.ErrorCounter and wire it via deps.GetErrorCounter instead of the config kind","Check the config file/flags for a stray error_counter value copied from another setup"],"exampleFix":"// before (config)\nerror_counter: \"datadog\"\n// after\n// remove the error_counter key entirely (empty means use nullErrorCounter)","handlingStrategy":"validation","validationCode":"if kind := cfg.ErrorCounter(); kind != \"\" {\n    return fmt.Errorf(\"this build only supports the null error counter; got %q\", kind)\n}","typeGuard":null,"tryCatchPattern":"if _, err := getNullErrorCounter(cfg); err != nil {\n    log.Fatalf(\"error counter config invalid: %v\", err)\n}","preventionTips":["Keep error counter config empty unless you have implemented a custom counter","Validate all config keys against a known schema before startup","Search configs inherited from forks for unsupported keys"],"tags":["go","configuration","unsupported-feature"],"backgroundTag":"unsupported-config-value","analyzedSha":"eaa28fb761c0ebe8644d1333e5d164e9cc3071e9","analyzedAt":"2026-09-03T17:04:39.020Z","contentChangedAt":"2026-09-03T17:04:39.020Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}