epsagon/serverless-plugin-epsagon

Disabling Epsagon function at a function level doesn't appear to be working correctly

arthurdelight4 opened this issue · 1 comments

I'm trying to disable epsagon on one of my functions, but it doesn't appear to be working correctly.

I added this configuration to my function, as per the documentation

  function1:
    handler: src/function1/handler.default
    epsagon:
      disable: true

But I get the following log output in verbose mode:

Serverless: [serverless-plugin-epsagon] Wrapping your functions with Epsagon...
Serverless: [serverless-plugin-epsagon] Epsagon is disabled for function undefined, skipping.

I confirmed that the listed log line only appears when I have the disable: true value, so it isn't triggering off of some other configuration.

Examining the relevant code, it appears that there are two issues.

        if (disable) {
          this.log(`Epsagon is disabled for function ${func.key}, skipping.`);
        }
  1. The value func.key should probably be key
  2. There is a missing return result; within that if block.

Fixed. #23