You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/functions/destination-functions.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ All functions are scoped to your workspace, so members of other workspaces can't
13
13
> info ""
14
14
> Functions is available to all customer plan types with a free allotment of usage hours. Read more about [Functions usage limits](/docs/connections/functions/usage/), or see [your workspace's Functions usage stats](https://app.segment.com/goto-my-workspace/settings/usage?metric=functions){:target="_blank"}.
15
15
16
-

16
+

17
17
18
18
19
19
> note ""
@@ -352,7 +352,7 @@ A function can throw errors, or Segment might encounter errors while invoking yo
352
352
-**Bad Request** - Any error thrown by the function code that is not covered by the other errors.
353
353
-**Invalid Settings** - A configuration error prevented Segment from executing your code. If this error persists for more than an hour, [contact Segment Support](https://segment.com/help/contact/){:target="_blank"}.
354
354
-**Message Rejected** - Your code threw `InvalidEventPayload` or `ValidationError` due to invalid input.
355
-
-**Unsupported Event Type** - Your code does not implement a specific event type (`onTrack()`, etc.) or threw a `EventNotSupported` error.
355
+
-**Unsupported Event Type** - Your code doesn't implement a specific event type (for example, `onTrack()`) or threw a `EventNotSupported` error.
356
356
-**Retry** - Your code threw `RetryError` indicating that the function should be retried.
357
357
358
358
Segment only attempts to send the event to your destination function again if a **Retry** error occurs.
Copy file name to clipboardExpand all lines: src/connections/functions/environment.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ When you create a function, write code for it, and save it, the function appears
15
15
16
16
Only [Functions admins](#functions-permissions) can create or edit functions.
17
17
18
-
1. From your workspace, go to the Catalog and click the [Functions tab](https://app.segment.com/goto-my-workspace/functions/catalog).
18
+
1. From your workspace, go to the Catalog and click the [Functions tab](https://app.segment.com/goto-my-workspace/functions/catalog){:target="_blank"}.
19
19
2. Click **New Function**.
20
20
3. Select the type of function you want to build, and click **Build**.
21
21
@@ -24,7 +24,7 @@ Only [Functions admins](#functions-permissions) can create or edit functions.
24
24
5. Once you finish writing your function, click **Configure** to give it a name.
25
25
6. Click **Create Function** to save your work and make this function available in your workspace.
26
26
27
-
After you click **Create Function**, the function appears on the [Functions catalog page](https://app.segment.com/goto-my-workspace/functions/catalog/) in your workspace.
27
+
After you click **Create Function**, the function appears on the [Functions catalog page](https://app.segment.com/goto-my-workspace/functions/catalog/){:target="_blank"} in your workspace.
28
28
29
29
30
30
## Editing a function
@@ -40,7 +40,7 @@ You can also choose to **Save & Deploy** to push changes to all, or specific fun
40
40
> note ""
41
41
> You must be a **Workspace Owner** or **Source Admin** to connect an instance of your function in your workspace.
42
42
43
-
1. From the [Functions tab](https://app.segment.com/goto-my-workspace/functions/catalog), locate the source function you want to deploy.
43
+
1. From the [Functions tab](https://app.segment.com/goto-my-workspace/functions/catalog){:target="_blank"}, locate the source function you want to deploy.
44
44
2. Click **Connect Source** and follow the prompts to configure the source. (You can access these settings later by navigating to the Source Settings page for your source function.)
45
45
3. Locate the webhook URL for the source, either on the **Overview** or **Settings → Endpoint** page.
46
46
4. Copy this URL and paste it into the upstream tool or service.
Copy file name to clipboardExpand all lines: src/connections/functions/index.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Functions let you create your own sources and destinations directly within your
7
7
> info ""
8
8
> Functions is available to all customer plan types with a free allotment of usage hours. Read more about [Functions usage limits](/docs/connections/functions/usage/), or see [your workspace's Functions usage stats](https://app.segment.com/goto-my-workspace/settings/usage?metric=functions).
9
9
10
-

10
+

11
11
12
12
## What can you do with Functions?
13
13
Functions can help you bring external data into Segment ([Source Functions](/docs/connections/functions/source-functions)) and send data in Segment out to external destinations ([Destination Functions](/docs/connections/functions/destination-functions)). Functions are scoped to your specific workspace. If you're a technology partner and want to build a new integration and publish it in Segment's catalog, see the [Developer Center documentation](/docs/partners/).
Copy file name to clipboardExpand all lines: src/connections/functions/usage.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,19 @@ Functions are billed to your account using the total execution time per month.
6
6
7
7
An **individual function's execution time** is the total time it takes for the function to process events, including mapping, transformations, and requests to external APIs. Generally, requests to external APIs can greatly add to your total execution time.
8
8
9
-
Your **total execution time** is the execution time for all of your active functions accumulated over the course of a month. You can see your current execution time on the [Functions tab of the Usage page](https://app.segment.com/goto-my-workspace/settings/usage?metric=functions&period=current) in each workspace. You will receive notifications of your usage when you've reached 75%, 90% and 100% of your allotted execution time.
9
+
Your **total execution time** is the execution time for all of your active functions accumulated over the course of a month. You can see your current execution time on the [Functions tab of the Usage page](https://app.segment.com/goto-my-workspace/settings/usage?metric=functions&period=current){:target="_blank"} in each workspace. You will receive notifications of your usage when you've reached 75%, 90%, and 100% of your allotted execution time.
10
10
11
-
The amount of time you are allotted changes depending on your [Segment pricing plan](http://segment.com/pricing).
11
+
The amount of time you are allotted changes depending on your [Segment pricing plan](http://segment.com/pricing){:target="_blank"}.
12
12
13
13
## Measuring execution time
14
14
15
-
We measure execution time from when the function first receives an event to the time the function either returns successfully or throws an error. If Segment retries your function (for example, if there was a timeout), those retries also count as billable execution time.
15
+
Segment measures execution time from when the function first receives an event to the time the function either returns successfully or throws an error. If Segment retries your function (for example, if there was a timeout), those retries also count as billable execution time.
16
16
17
-
Starting on April 8, 2021 Functions usage is measured in millisecond increments. This makes your usage and billing much more precise. Prior to this change, Functions was measured in 100ms increments, and then rounded up. For example, a function that took 80ms to complete was previously billed as 100ms. Using the new usage calculation, it is billed as 80ms.
17
+
Starting on April 8, 2021 Functions usage is measured in millisecond increments. This makes your usage and billing much more precise. Prior to this change, Functions was measured in 100ms increments, and then rounded up. For example, a function that took 80ms to complete was previously billed as 100ms. Using the new usage calculation, it is billed as 80ms.
18
18
19
19
## Execution timeouts
20
20
21
-
Functions have a timeout of 5 seconds. If a function takes longer than 5 seconds, execution halts and the function is retried periodically for up to 4 hours.
21
+
Functions have a timeout of five seconds. If a function takes longer than five seconds, execution halts and the function is retried periodically for up to four hours.
22
22
23
23
24
24
@@ -40,15 +40,15 @@ You can (and should!) use [Destination Filters](/docs/connections/destinations/d
40
40
41
41
In the most cases, functions are slow due to external requests using the `fetch()` call. The external API may be under heavy load or it may simply take a long time to process your request.
42
42
43
-
If you're making many requests that could be done in parallel, ensure that you're not doing them sequentially. If the external API takes 400ms to respond and you issue 10 requests, it would take 4 seconds to do them sequentially versus 400ms to do them in parallel. For example, if you're waiting for requests to complete inside of a loop you're making your requests sequentially:
43
+
If you're making many requests that could be done in parallel, ensure that you're not doing them sequentially. If the external API takes 400ms to respond and you issue 10 requests, it would take four seconds to do them sequentially versus 400ms to do them in parallel. For example, if you're waiting for requests to complete inside of a loop you're making your requests sequentially:
0 commit comments