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: README.md
+18-40Lines changed: 18 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,59 +58,37 @@ Run the script above with `node hello.js`, and you should see the span being log
58
58
59
59
### Cloudflare Workers
60
60
61
-
First, install the `@microlabs/otel-cf-workers`[NPM package](https://github.com/evanderkoogh/otel-cf-workers) and the `@pydantic/logfire-cf-workers @pydantic/logfire-api` NPM package:
61
+
First, install the `@pydantic/logfire-cf-workers @pydantic/logfire-api` NPM packages:
As per the otel-cf-workers package instructions, add `compatibility_flags = [ "nodejs_compat" ]` to your wrangler.toml or `"compatibility_flags": ["nodejs_compat"]` if you're using `wrangler.jsonc`.
66
+
Next, add `compatibility_flags = [ "nodejs_compat" ]` to your wrangler.toml or `"compatibility_flags": ["nodejs_compat"]` if you're using `wrangler.jsonc`.
67
67
68
-
Add your [Logfire write token](https://logfire.pydantic.dev/docs/how-to-guides/create-write-tokens/) to your Wrangler file:
68
+
Add your [Logfire write token](https://logfire.pydantic.dev/docs/how-to-guides/create-write-tokens/) to your `.dev.vars` file. Check the [Cloudflare documentation for further details on how to manage and deploy the secrets](https://developers.cloudflare.com/workers/configuration/secrets/).
69
69
70
-
`wrangler.jsonc`:
71
-
72
-
```json
73
-
"vars": {
74
-
"LOGFIRE_TOKEN": "your-write-token",
75
-
},
76
-
```
77
-
78
-
`wrangler.toml`:
79
-
80
-
```toml
81
-
[vars]
82
-
LOGFIRE_WRITE_TOKEN="your-write-token"
70
+
```sh
71
+
LOGFIRE_TOKEN=your-write-token
83
72
```
84
73
85
74
Next, add the necessary instrumentation around your handler. The `tracerConfig` function will extract your write token from the `env` object and provide the necessary configuration for the instrumentation:
0 commit comments