File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ methods available in `@sentry/node` can be imported from `@sentry/serverless`.
1919
2020Currently supported environment:
2121
22- * AWS Lambda*
22+ ### AWS Lambda
2323
2424To use this SDK, call ` Sentry.AWSLambda.init(options) ` at the very beginning of your JavaScript file.
2525
@@ -52,3 +52,35 @@ Sentry.AWSLambda.init({
5252 tracesSampleRate: 1.0 ,
5353});
5454```
55+
56+ ### Google Cloud Functions
57+
58+ To use this SDK, call ` Sentry.GCPFunction.init(options) ` at the very beginning of your JavaScript file.
59+
60+ ``` javascript
61+ import * as Sentry from ' @sentry/serverless' ;
62+
63+ Sentry .GCPFunction .init ({
64+ dsn: ' __DSN__' ,
65+ tracesSampleRate: 1.0 ,
66+ // ...
67+ });
68+
69+ // For HTTP Functions:
70+
71+ exports .helloHttp = Sentry .GCPFunction .wrapHttpFunction ((req , res ) => {
72+ throw new Error (' oh, hello there!' );
73+ });
74+
75+ // For Background Functions:
76+
77+ exports .helloEvents = Sentry .GCPFunction .wrapEventFunction ((data , context , callback ) => {
78+ throw new Error (' oh, hello there!' );
79+ });
80+
81+ // For CloudEvents:
82+
83+ exports .helloEvents = Sentry .GCPFunction .wrapCloudEventFunction ((context , callback ) => {
84+ throw new Error (' oh, hello there!' );
85+ });
86+ ```
You can’t perform that action at this time.
0 commit comments