This repository was archived by the owner on Jun 13, 2023. It is now read-only.
File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ Available options:
102
102
|`ignoredKeys` |Optional |`-` |May contain strings (will perform a loose match, so that First Name also matches first_name) |
103
103
|`urlsToIgnore` |Optional |`-` |Ignore HTTP calls to specific domains |
104
104
|`labels` |Optional |`[]` |Global labels applied to all traces. For example "[['key', 'val']]". (Not available for Python) |
105
+ |`wrapper`|Optional |`lambda_wrapper/lambdaWrapper` - The wrapper to use to wrap this function. See [wrappers](#wrappers)| |
105
106
106
107
# ## Function Level Options
107
108
These options are defined at the function level, under the `epsagon` member of your function in the `serverless.yml` file.
@@ -131,10 +132,12 @@ Available options:
131
132
* `lambda_wrapper` - regular lambda wrapper
132
133
* `step_lambda_wrapper` - Used to wrap step functions
133
134
* `python_wrapper` - Used to wrap regular Python functions (doesn't have to run on Lambda)
135
+ * `tencent_function_wrapper` - Wrapper for Tencent Cloud Serverless Cloud Functions
134
136
* Node.js functions:
135
137
* `lambdaWrapper` - regular lambda wrapper
136
138
* `stepLambdaWrapper` - Used to wrap step functions
137
139
* `nodeWrapper` - Used to wrap regular Node functions (doesn't have to run on Lambda)
140
+ * `tencentFunctionWrapper` - Wrapper for Tencent Cloud Serverless Cloud Functions
138
141
139
142
# # Troubleshooting
140
143
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ export default class ServerlessEpsagonPlugin {
93
93
ignoredKeys : { type : 'string' } ,
94
94
urlsToIgnore : { type : 'string' } ,
95
95
labels : { type : 'string' } ,
96
+ wrapper : { type : 'string' } ,
96
97
} ,
97
98
additionalProperties : false ,
98
99
} ,
@@ -221,7 +222,7 @@ export default class ServerlessEpsagonPlugin {
221
222
return result ;
222
223
}
223
224
224
- const language = SUPPORTED_LANGUAGES . find ( ( lang => runtime . match ( lang ) ) ) ;
225
+ const language = SUPPORTED_LANGUAGES . find ( ( lang => runtime . toLowerCase ( ) . match ( lang ) ) ) ;
225
226
if ( ! language ) {
226
227
this . log ( `Runtime "${ runtime } " is not supported yet, skipping function ${ key } ` ) ;
227
228
return result ;
@@ -254,6 +255,14 @@ export default class ServerlessEpsagonPlugin {
254
255
}
255
256
}
256
257
await Promise . all ( this . funcs . map ( async ( func ) => {
258
+ if ( this . config ( ) . wrapper ) {
259
+ if ( ! func . epsagon ) {
260
+ // eslint-disable-next-line no-param-reassign
261
+ func . epsagon = { } ;
262
+ }
263
+ // eslint-disable-next-line no-param-reassign
264
+ func . epsagon . wrapper = this . config ( ) . wrapper ;
265
+ }
257
266
const handlerCode = generateWrapperCode ( func , this . config ( ) ) ;
258
267
await writeFile (
259
268
join (
You can’t perform that action at this time.
0 commit comments