Skip to content

Commit 5519ed5

Browse files
authored
feat: add telemetry information and opt-out options across SDKs (#560)
1 parent 97f54be commit 5519ed5

File tree

10 files changed

+207
-5
lines changed

10 files changed

+207
-5
lines changed

qstash/sdks/ts/gettingstarted.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,22 @@ const client = new Client({
4545
},
4646
});
4747
```
48+
49+
## Telemetry
50+
51+
This sdk sends anonymous telemetry headers to help us improve your experience.
52+
We collect the following:
53+
54+
- SDK version
55+
- Platform (Cloudflare, AWS or Vercel)
56+
- Runtime version ([email protected])
57+
58+
You can opt out by setting the `UPSTASH_DISABLE_TELEMETRY` environment variable
59+
to any truthy value. Or setting `enableTelemetry: false` in the client options.
60+
61+
```ts
62+
const client = new Client({
63+
token: "<QSTASH_TOKEN>",
64+
enableTelemetry: false,
65+
});
66+
```

redis/sdks/py/features.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,21 @@ result = pipeline.exec()
9595
print(result)
9696
# prints [True, 2, '2']
9797
```
98+
99+
# Telemetry
100+
101+
This library sends anonymous telemetry data to help us improve your experience.
102+
We collect the following:
103+
104+
- SDK version
105+
- Platform (Vercel, AWS)
106+
- Python Runtime version
107+
108+
You can opt out by passing `allow_telemetry=False` when initializing the Redis client:
109+
110+
```py
111+
redis = Redis(
112+
# ...,
113+
allow_telemetry=False,
114+
)
115+
```

redis/sdks/ts/advanced.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,28 @@ try {
5353
}
5454
}
5555
```
56+
57+
## Telemetry
58+
59+
This library sends anonymous telemetry data to help us improve your experience.
60+
We collect the following:
61+
62+
- SDK version
63+
- Platform (Deno, Cloudflare, Vercel)
64+
- Runtime version ([email protected])
65+
66+
You can opt out by setting the `UPSTASH_DISABLE_TELEMETRY` environment variable
67+
to any truthy value.
68+
69+
```sh
70+
UPSTASH_DISABLE_TELEMETRY=1
71+
```
72+
73+
Alternatively, you can pass `enableTelemetry: false` when initializing the Redis client:
74+
75+
```ts
76+
const redis = new Redis({
77+
// ...,
78+
enableTelemetry: false,
79+
});
80+
```

search/sdks/py/gettingstarted.mdx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,23 @@ index.upsert(
8383
},
8484
],
8585
)
86-
```
86+
```
87+
88+
## Telemetry
89+
90+
This sdk sends anonymous telemetry data to help us improve your experience.
91+
We collect the following:
92+
93+
- SDK version
94+
- Platform (Cloudflare, AWS or Vercel)
95+
- Runtime version (python@vX)
96+
97+
You can opt out using the allow_telemetry flag when creating the client:
98+
99+
```ts
100+
client = Search(
101+
url="UPSTASH_SEARCH_REST_URL",
102+
token="UPSTASH_SEARCH_REST_TOKEN",
103+
allow_telemetry=False,
104+
)
105+
```

search/sdks/ts/getting-started.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,27 @@ const results = await index.upsert<Content>({
123123
content: { title: "Movie title", ... }
124124
});
125125
```
126+
127+
## Telemetry
128+
129+
This sdk sends anonymous telemetry data to help us improve your experience.
130+
We collect the following:
131+
132+
- SDK version
133+
- Platform (Cloudflare, AWS or Vercel)
134+
- Runtime version ([email protected])
135+
136+
You can opt out by setting the `UPSTASH_DISABLE_TELEMETRY` environment variable
137+
to any truthy value.
138+
139+
```sh
140+
UPSTASH_DISABLE_TELEMETRY=1
141+
```
142+
143+
Alternatively, you can disable telemetry programmatically:
144+
145+
```ts
146+
const index = client.index("movies", {
147+
enableTelemetry: false,
148+
});
149+
```

vector/sdks/py/features.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,19 @@ from upstash_vector import Index
1717

1818
# Try 5 times with a 2-second interval between retries
1919
index = Index.from_env(retries=5, retry_interval=2.0)
20-
```
20+
```
21+
22+
# Telemetry
23+
24+
This library sends anonymous telemetry data to help us improve your experience.
25+
We collect the following:
26+
27+
- SDK version
28+
- Platform (Vercel, AWS)
29+
- Python Runtime version
30+
31+
You can opt out by passing `allow_telemetry=False` when initializing the Redis client:
32+
33+
```py
34+
idx = Index("INDEX_URL", "INDEX_TOKEN", allow_telemetry=False)
35+
```

vector/sdks/ts/advanced.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,19 @@ try {
2424
}
2525
}
2626
```
27+
28+
## Telemetry
29+
30+
This sdk sends anonymous telemetry data to help us improve your experience.
31+
We collect the following:
32+
33+
- SDK version
34+
- Platform (Cloudflare, AWS or Vercel)
35+
- Runtime version ([email protected])
36+
37+
You can opt out by setting the `UPSTASH_DISABLE_TELEMETRY` environment variable
38+
to any truthy value.
39+
40+
```sh
41+
UPSTASH_DISABLE_TELEMETRY=1
42+
```

workflow/basics/client/trigger.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ You can also trigger multiple workflow runs in a single call by passing an array
9191
This can be useful for identifying and filtering runs in the dashboard or logs.
9292
</ParamField>
9393

94+
<ParamField body="disableTelemetry" type="boolean">
95+
If set to true, telemetry data collection for this workflow run will be disabled.
96+
By default, telemetry is enabled to help improve Upstash services.
97+
98+
See the [`disableTelemetry` parameter in serve options](/workflow/basics/serve/advanced#param-disable-telemetry) for more details.
99+
</ParamField>
100+
94101
## Usage
95102
<CodeGroup>
96103
```ts Single Workflow

workflow/basics/serve/advanced.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,33 @@ Advanced Options are intended to support edge cases or testing pipelines and are
232232

233233
</ParamField>
234234

235+
<ParamField path="schema" type="z.ZodType">
236+
Alternative to `initialPayloadParser`, you can pass a `schema` in the TypeScript SDK.
237+
238+
The schema is used to validate and parse the initial request payload automatically using [Zod](https://zod.dev/).
239+
240+
<CodeGroup>
241+
242+
```typescript TypeScript
243+
244+
import { z } from "zod";
245+
246+
const parameters = z.object({ expression: z.string() });
247+
248+
export const { POST } = serve(
249+
async (context) => {
250+
// context.requestPayload is typed as `{ expression: string }`
251+
const payload = context.requestPayload;
252+
},
253+
{
254+
schema: parameters,
255+
}
256+
);
257+
```
258+
259+
</CodeGroup>
260+
</ParamField>
261+
235262
<ParamField path="url" type="string">
236263
Specifies the full endpoint URL of the workflow, including the route path.
237264

@@ -460,3 +487,38 @@ async def example(context: AsyncWorkflowContext[str]) -> None:
460487
</ParamField>
461488

462489

490+
<ParamField path="disableTelemetry" type="boolean">
491+
Disables anonymous telemetry data collection for this workflow endpoint. Since we don't collect telemetry
492+
in Python SDK, this option is only available in the TypeScript SDK.
493+
494+
By default, the Upstash Workflow SDK collects anonymous telemetry data to help improve the service.
495+
The collected data includes:
496+
497+
- SDK version
498+
- Platform (Vercel, AWS, etc.)
499+
- Runtime version (Node.js, Python, etc.)
500+
501+
Set `disableTelemetry` to `true` to opt out of telemetry for this specific workflow endpoint.
502+
503+
<CodeGroup>
504+
505+
```typescript TypeScript
506+
export const { POST } = serve<string>(
507+
async (context) => { ... },
508+
{
509+
disableTelemetry: true
510+
}
511+
);
512+
```
513+
514+
```python Python
515+
@serve.post("/api/example", disable_telemetry=True)
516+
async def example(context: AsyncWorkflowContext[str]) -> None: ...
517+
```
518+
</CodeGroup>
519+
520+
<Tip>
521+
You should also
522+
set [`disableTelemetry` when triggering workflow runs via `client.trigger()`](/workflow/basics/client/trigger#param-disable-telemetry) to fully disable telemetry
523+
</Tip>
524+
</ParamField>

workflow/features/invoke.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ This allows to orchestrate multiple workflows together without external synchron
77

88
When you use `context.invoke`, invoking workflow will wait until the invoked workflow finishes before running the next step.
99

10-
11-
12-
1310
```typescript
1411
const {
1512
body, // response from the invoked workflow

0 commit comments

Comments
 (0)