logbrew-sdk 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -4
- data/lib/logbrew/rails_integration.rb +1 -1
- data/lib/logbrew/version.rb +1 -1
- data/lib/logbrew.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25c59f04169b6fce06afa15c04f790fd7b0d3d8643b50c880ca2d451e71168b2
|
|
4
|
+
data.tar.gz: dec9fb58c8ba57ad3745227d5858a400947a41e62c2fea3ce66d9d9096495372
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 251d55bf921e65cd161648547aa60a9ac6242aee7659b48ef674d87e42bda61d6dea4234b7e164f2a7d996dd9af92b32cc54315bde1b5edc37a765a68bc00b36
|
|
7
|
+
data.tar.gz: 3a66a2414a69c0f85a80050f772137b85482d2212a926f5d78b6a67edab7f73394473c27b1a1ceffa54c0eea59be98d7c47048ca1a1c25739b60d9526b9e0ee1
|
data/README.md
CHANGED
|
@@ -23,7 +23,7 @@ needed:
|
|
|
23
23
|
|
|
24
24
|
```ruby
|
|
25
25
|
# Gemfile
|
|
26
|
-
gem "logbrew-sdk", "~> 0.1.
|
|
26
|
+
gem "logbrew-sdk", "~> 0.1.17"
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
```bash
|
|
@@ -91,7 +91,7 @@ The explicit Rails capture settings are:
|
|
|
91
91
|
| `LOGBREW_RELEASE` | unset | Optional release identifier |
|
|
92
92
|
| `LOGBREW_ENDPOINT` | `https://api.logbrew.co/v1/events` | HTTPS intake URL; loopback HTTP is accepted for local development |
|
|
93
93
|
| `LOGBREW_REQUEST_TIMEOUT_MS` | `10000` | Per-request delivery timeout from 1 to 600000 ms |
|
|
94
|
-
| `LOGBREW_FLUSH_INTERVAL_MS` | `
|
|
94
|
+
| `LOGBREW_FLUSH_INTERVAL_MS` | `1000` | Automatic delivery interval after the first queued event, from 10 to 3600000 ms |
|
|
95
95
|
| `LOGBREW_FLUSH_THRESHOLD` | `100` | Queue size from 1 to 1000 that requests an earlier flush |
|
|
96
96
|
| `LOGBREW_CAPTURE_EXCEPTION_MESSAGES` | `false` | Opt in to exception message capture |
|
|
97
97
|
| `LOGBREW_CAPTURE_RAILS_LOGS` | `false` | Opt in to bounded application-origin logs on active request and job traces |
|
|
@@ -145,6 +145,24 @@ rm -f "$HOME/.logbrew/rails-service.ingest"
|
|
|
145
145
|
unset LOGBREW_PROJECT_ID
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
## Read Events Back
|
|
149
|
+
|
|
150
|
+
A successful send shows that LogBrew accepted the request. It does not show
|
|
151
|
+
that you can read the event. After your app sends one event, read it
|
|
152
|
+
back with a project read key:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
logbrew projects keys create "<project_id>" --kind read \
|
|
156
|
+
--ingest-key-file "$HOME/.logbrew/setup-check.read" --json
|
|
157
|
+
export LOGBREW_TOKEN="$(< "$HOME/.logbrew/setup-check.read")"
|
|
158
|
+
logbrew read logs --since 1h --json
|
|
159
|
+
logbrew issues --since 1h --json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
A read key reads 1 project and cannot send telemetry. Run `unset LOGBREW_TOKEN`
|
|
163
|
+
when you finish. [Read your events back](https://docs.logbrew.co/guides/verify-setup)
|
|
164
|
+
covers key kinds, empty results, and how to revoke the key.
|
|
165
|
+
|
|
148
166
|
## Usage
|
|
149
167
|
|
|
150
168
|
```ruby
|
|
@@ -692,7 +710,7 @@ client = LogBrew::Client.create_automatic(
|
|
|
692
710
|
sdk_name: "checkout-worker",
|
|
693
711
|
sdk_version: "1.0.0",
|
|
694
712
|
transport: transport,
|
|
695
|
-
flush_interval:
|
|
713
|
+
flush_interval: 1,
|
|
696
714
|
flush_threshold: 100,
|
|
697
715
|
retry_base_delay: 0.25,
|
|
698
716
|
retry_max_delay: 30,
|
|
@@ -704,7 +722,7 @@ warn JSON.generate(client.delivery_health.to_h)
|
|
|
704
722
|
client.shutdown
|
|
705
723
|
```
|
|
706
724
|
|
|
707
|
-
The worker starts only after accepted queue work exists, then wakes when the queue reaches `flush_threshold` or `flush_interval` expires. Restart-hydrated persistent work wakes it immediately. Automatic and manual sends share the existing serialized flush, immutable failed prefix, accepted-prefix acknowledgement, batch bounds, and persistence format; no second queue or transport path is created.
|
|
725
|
+
The worker starts only after accepted queue work exists, then wakes when the queue reaches `flush_threshold` or `flush_interval` expires. The defaults are 1 second and 100 events, so a single event is readable in about a second while bursts still share one request. Restart-hydrated persistent work wakes it immediately. Automatic and manual sends share the existing serialized flush, immutable failed prefix, accepted-prefix acknowledgement, batch bounds, and persistence format; no second queue or transport path is created.
|
|
708
726
|
|
|
709
727
|
Retryable network, `408`, and `5xx` failures retain the exact failed body and use capped equal-jitter backoff. Authentication (`401`/`403`), quota (`429`), validation (`400`/`422`), and other non-retryable responses pause automatic sends without dropping queued work. `recover_automatic_delivery` performs one explicit synchronous flush through the owned transport and resumes scheduling only after success. Calling `flush(transport)` directly provides the same explicit recovery boundary. `stop_automatic_delivery` joins the worker without draining or discarding work; a later manual flush remains available.
|
|
710
728
|
|
|
@@ -12,7 +12,7 @@ module LogBrew
|
|
|
12
12
|
class Configuration
|
|
13
13
|
DEFAULT_ENDPOINT = LogBrew::HttpTransport::DEFAULT_ENDPOINT
|
|
14
14
|
DEFAULT_REQUEST_TIMEOUT_MS = 10_000
|
|
15
|
-
DEFAULT_FLUSH_INTERVAL_MS =
|
|
15
|
+
DEFAULT_FLUSH_INTERVAL_MS = 1_000
|
|
16
16
|
DEFAULT_FLUSH_THRESHOLD = 100
|
|
17
17
|
MAX_LABEL_BYTES = 255
|
|
18
18
|
MAX_ENDPOINT_BYTES = 2_048
|
data/lib/logbrew/version.rb
CHANGED
data/lib/logbrew.rb
CHANGED
|
@@ -832,7 +832,7 @@ module LogBrew
|
|
|
832
832
|
end
|
|
833
833
|
|
|
834
834
|
class Client
|
|
835
|
-
DEFAULT_AUTOMATIC_FLUSH_INTERVAL =
|
|
835
|
+
DEFAULT_AUTOMATIC_FLUSH_INTERVAL = 1.0
|
|
836
836
|
DEFAULT_AUTOMATIC_FLUSH_THRESHOLD = 100
|
|
837
837
|
DEFAULT_AUTOMATIC_RETRY_BASE_DELAY = 0.25
|
|
838
838
|
DEFAULT_AUTOMATIC_RETRY_MAX_DELAY = 30.0
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logbrew-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- LogBrew
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Public LogBrew Ruby SDK with typed issue diagnostics, automatic Rails
|
|
14
14
|
request/error capture, and standard-library delivery.
|