serverless-plugin-tracing
serverless-plugin-tracing copied to clipboard
Enabling on specific stages only
It would be handy if we could pass a stage variable into this plugin to be enabled only at that stage. Currently, I have to reference an external file in order to check the current stage and return true/false for the tracing
property.
Hi @kbariotis
Could you point me to any examples of how this is done in other plugins? If I get a chance to implement this, wondering what good practice are.
Hmm no not really, I don't have any concrete examples but I have implement such a feature on a plugin we use internally in my current company. You are passing an array of strings and the plugin is being enabled only if the current stage is inside that array. So for example, I want to enable tracing only on DEVELOPMENT
and STAGING
environments
@alex-murashkin serverless-plugin-warmup has a nice pattern for this.