Skip to content

Commit 22b21b0

Browse files
committed
Lack of DSN should turn client into nop
1 parent 60d2266 commit 22b21b0

16 files changed

Lines changed: 97 additions & 18 deletions

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ client.instrument("transformers", hubs=["huggingface"])
5353
# models loaded after this point are tracked automatically
5454
```
5555

56+
If no DSN is configured, the client becomes a no-op and logs a warning.
57+
5658
## Supported integrations
5759

5860
**On-device**
@@ -90,7 +92,7 @@ For unsupported frameworks, see [Manual tracking](https://github.com/wild-edge/w
9092

9193
| Parameter | Default | Description |
9294
|---|---|---|
93-
| `dsn` | - | `https://<secret>@ingest.wildedge.dev/<key>` (or `WILDEDGE_DSN`) |
95+
| `dsn` | - | `https://<secret>@ingest.wildedge.dev/<key>` (or `WILDEDGE_DSN`). If unset, the client is a no-op. |
9496
| `app_version` | `None` | Your app's version string |
9597
| `app_identity` | `<project_key>` | Namespace for offline persistence. Set per-app in multi-process workloads (or `WILDEDGE_APP_IDENTITY`) |
9698
| `enable_offline_persistence` | `true` | Persist unsent events to disk and replay on restart |

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Full reference for all `WildEdge` client parameters.
66

77
| Parameter | Default | Env var | Description |
88
|---|---|---|---|
9-
| `dsn` | - | `WILDEDGE_DSN` | `https://<secret>@ingest.wildedge.dev/<key>` |
9+
| `dsn` | - | `WILDEDGE_DSN` | `https://<secret>@ingest.wildedge.dev/<key>`. If unset, the client is a no-op. |
1010
| `app_version` | `None` | - | Your app's version string |
1111
| `app_identity` | `<project_key>` | `WILDEDGE_APP_IDENTITY` | Namespace for offline persistence. Set per-app in multi-process workloads |
1212
| `enable_offline_persistence` | `true` | - | Persist unsent events to disk and replay on restart |

docs/manual-tracking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Every model needs a handle before you can track events against it. Pass the mode
2525
```python
2626
import wildedge
2727

28-
client = wildedge.WildEdge() # set WILDEDGE_DSN env var
28+
client = wildedge.WildEdge() # uses WILDEDGE_DSN if set; otherwise no-op
2929

3030
handle = client.register_model(
3131
my_model,

examples/feedback_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
CONFIDENCE_THRESHOLD = 0.6
2323

2424
client = wildedge.WildEdge(
25-
app_version="1.0.0", # set WILDEDGE_DSN env var
25+
app_version="1.0.0", # uses WILDEDGE_DSN if set; otherwise no-op
2626
)
2727
client.instrument("timm")
2828

examples/gguf_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import wildedge
1414

1515
client = wildedge.WildEdge(
16-
app_version="1.0.0", # set WILDEDGE_DSN env var
16+
app_version="1.0.0", # uses WILDEDGE_DSN if set; otherwise no-op
1717
)
1818
client.instrument("gguf", hubs=["huggingface"])
1919

examples/gguf_gemma_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
FILE = "gemma-2-2b-it-Q4_K_M.gguf"
2929

3030
client = wildedge.WildEdge(
31-
app_version="1.0.0", # set WILDEDGE_DSN env var
31+
app_version="1.0.0", # uses WILDEDGE_DSN if set; otherwise no-op
3232
)
3333

3434
# --- Download ---

examples/keras_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
exit(1)
2929

3030
client = wildedge.WildEdge(
31-
app_version="1.0.0", # set WILDEDGE_DSN env var
31+
app_version="1.0.0", # uses WILDEDGE_DSN if set; otherwise no-op
3232
)
3333

3434
# Load a pre-trained MobileNetV2 model using client to track construction and lifecycle

examples/mlx_example.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def main() -> None:
5252

5353
# instrument() patches mlx_lm.load and mlx_lm.generate; must be called
5454
# before any model is loaded.
55-
client = wildedge.WildEdge(app_version="1.0.0") # set WILDEDGE_DSN env var
55+
client = wildedge.WildEdge(
56+
app_version="1.0.0"
57+
) # uses WILDEDGE_DSN if set; otherwise no-op
5658
client.instrument("mlx", hubs=["huggingface"])
5759

5860
print(f"\nLoading {args.model} ...")

examples/onnx_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import wildedge
1515

1616
client = wildedge.WildEdge(
17-
app_version="1.0.0", # set WILDEDGE_DSN env var
17+
app_version="1.0.0", # uses WILDEDGE_DSN if set; otherwise no-op
1818
)
1919
client.instrument("onnx", hubs=["huggingface"])
2020

examples/openai_example.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
import wildedge
2020

21-
client = wildedge.WildEdge(app_version="1.0.0") # set WILDEDGE_DSN env var
21+
client = wildedge.WildEdge(
22+
app_version="1.0.0"
23+
) # uses WILDEDGE_DSN if set; otherwise no-op
2224
client.instrument("openai")
2325

2426
openai_client = OpenAI() # set OPENAI_API_KEY env var or pass api_key= explicitly

0 commit comments

Comments
 (0)