logister-ruby 0.2.4 → 0.2.6
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/CHANGELOG.md +10 -0
- data/README.md +94 -4
- data/lib/logister/reporter.rb +38 -4
- data/lib/logister/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63dccd6fdb12e5417bcca918c033a19e421087e188eac57f994939aa2eb4732f
|
|
4
|
+
data.tar.gz: 825d77d1304622efc28380e3e26167df40b411be97aa23219cce9d7f89944e6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 663bc90bcba5cfd300d1875536350131a5c1c2c540269168f910b648aa9a93ef98a301579389900cec0cbf135471c6078261a9a045b7be14b23987c9eef477c2
|
|
7
|
+
data.tar.gz: e0f8d74a0eff0434b7884ba945ffe96f752724c18cc3bc9b332651c02cde83e8e36a9f619e1dfe356116c6c63ef154bb79c667188cd23cf74f62b28e7d5a8361
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.2.6 - 2026-05-22
|
|
4
|
+
|
|
5
|
+
- Added README guidance for using Ruby reports with the Logister project Insights beta, including practical metric, transaction, log, check-in, and custom attribute examples.
|
|
6
|
+
- Added a tag-based release workflow that publishes the gem to RubyGems with trusted publishing and then creates or updates the matching GitHub release.
|
|
7
|
+
|
|
8
|
+
## v0.2.5 - 2026-05-21
|
|
9
|
+
|
|
10
|
+
- Added metric value/unit options to `Logister.report_metric` while keeping the existing context/tags API.
|
|
11
|
+
- Added per-check-in environment, release, occurred-at, trace ID, and request ID options to `Logister.report_check_in`.
|
|
12
|
+
|
|
3
13
|
## v0.2.4 - 2026-05-21
|
|
4
14
|
|
|
5
15
|
- Enriched every Ruby error report with shared runtime, deployment, breadcrumb, and dependency context, including manual `Logister.report_error` calls.
|
data/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Install it from RubyGems as `logister-ruby`.
|
|
|
17
17
|
- [Breadcrumbs and dependencies](#breadcrumbs-and-dependencies)
|
|
18
18
|
- [ActiveJob error context](#activejob-error-context)
|
|
19
19
|
- [Manual reporting](#manual-reporting)
|
|
20
|
+
- [Using project Insights beta](#using-project-insights-beta)
|
|
20
21
|
- [Documentation](#documentation)
|
|
21
22
|
- [Release](#release)
|
|
22
23
|
|
|
@@ -174,6 +175,8 @@ Logister.report_error(StandardError.new("Something failed"), tags: { area: "chec
|
|
|
174
175
|
|
|
175
176
|
Logister.report_metric(
|
|
176
177
|
message: "checkout.completed",
|
|
178
|
+
value: 1,
|
|
179
|
+
unit: "count",
|
|
177
180
|
level: "info",
|
|
178
181
|
context: { duration_ms: 123 },
|
|
179
182
|
tags: { region: "us-east-1" }
|
|
@@ -195,13 +198,85 @@ Logister.report_log(
|
|
|
195
198
|
Logister.report_check_in(
|
|
196
199
|
slug: "nightly-reconcile",
|
|
197
200
|
status: "ok",
|
|
198
|
-
expected_interval_seconds: 900
|
|
201
|
+
expected_interval_seconds: 900,
|
|
202
|
+
duration_ms: 248.3,
|
|
203
|
+
trace_id: "trace-123",
|
|
204
|
+
request_id: "req-123"
|
|
199
205
|
)
|
|
200
206
|
```
|
|
201
207
|
|
|
208
|
+
## Using project Insights beta
|
|
209
|
+
|
|
210
|
+
The Logister project Insights tab combines Inbox, Activity, and Performance signals into live dashboard views. Ruby apps get the most useful Insights experience when every event carries stable deployment context plus a few low-cardinality custom attributes.
|
|
211
|
+
|
|
212
|
+
Use `config.environment`, `config.release`, and top-level scalar `context` values for the dimensions you want to filter by:
|
|
213
|
+
|
|
214
|
+
```ruby
|
|
215
|
+
Logister.configure do |config|
|
|
216
|
+
config.environment = Rails.env
|
|
217
|
+
config.release = ENV["RELEASE_SHA"]
|
|
218
|
+
config.service = "billing-web"
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
Logister.report_metric(
|
|
222
|
+
message: "queue.depth",
|
|
223
|
+
value: Sidekiq::Queue.new("billing").size,
|
|
224
|
+
unit: "jobs",
|
|
225
|
+
context: {
|
|
226
|
+
service: "billing-worker",
|
|
227
|
+
queue: "billing",
|
|
228
|
+
region: "us-east-1",
|
|
229
|
+
tenant_tier: "enterprise"
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
Logister.report_transaction(
|
|
234
|
+
name: "POST /checkout",
|
|
235
|
+
duration_ms: 184.7,
|
|
236
|
+
status: 200,
|
|
237
|
+
context: {
|
|
238
|
+
service: "billing-web",
|
|
239
|
+
route: "POST /checkout",
|
|
240
|
+
feature_flag: "new_checkout",
|
|
241
|
+
tenant_tier: "enterprise"
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
Logister.report_log(
|
|
246
|
+
message: "payment provider retry",
|
|
247
|
+
level: "warn",
|
|
248
|
+
context: {
|
|
249
|
+
service: "billing-worker",
|
|
250
|
+
provider: "stripe",
|
|
251
|
+
queue: "billing"
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
Logister.report_check_in(
|
|
256
|
+
slug: "nightly-reconcile",
|
|
257
|
+
status: "ok",
|
|
258
|
+
expected_interval_seconds: 3600,
|
|
259
|
+
duration_ms: 842.7,
|
|
260
|
+
context: {
|
|
261
|
+
service: "billing-worker",
|
|
262
|
+
queue: "reconcile"
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Practical Insights recipes:
|
|
268
|
+
|
|
269
|
+
- Release validation: send `release`, then filter the Insights tab to the new release and compare errors, transaction P95, database query timing, and custom metrics.
|
|
270
|
+
- Queue monitoring: report metrics such as `queue.depth`, `queue.latency`, and `jobs.retry_count` with a stable `queue` context key.
|
|
271
|
+
- Performance triage: send transaction events with `route`, `service`, and `tenant_tier` so slow routes can be filtered beside errors and logs.
|
|
272
|
+
- Instrumentation audit: open Insights after deploy and confirm errors, logs, metrics, transactions, and check-ins all appear in the recent stream.
|
|
273
|
+
|
|
274
|
+
Keep dashboard dimensions stable and low-cardinality. Good custom attribute keys include `service`, `region`, `queue`, `route`, `tenant_tier`, `provider`, and `feature_flag`. Avoid raw IDs, emails, request bodies, SQL text, and per-user values as top-level Insights dimensions.
|
|
275
|
+
|
|
202
276
|
## Documentation
|
|
203
277
|
|
|
204
278
|
- Ruby integration docs: https://docs.logister.org/integrations/ruby/
|
|
279
|
+
- Insights beta guide: https://docs.logister.org/product/#insights-beta
|
|
205
280
|
- Main Logister docs: https://docs.logister.org/
|
|
206
281
|
- [Contributing](CONTRIBUTING.md)
|
|
207
282
|
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
@@ -210,13 +285,28 @@ Logister.report_check_in(
|
|
|
210
285
|
|
|
211
286
|
## Release
|
|
212
287
|
|
|
213
|
-
|
|
288
|
+
This repo runs CI on commits and pull requests. Version tags run the release workflow so RubyGems and GitHub Releases stay aligned:
|
|
214
289
|
|
|
215
290
|
```bash
|
|
216
291
|
# 1) bump version in lib/logister/version.rb
|
|
217
292
|
# 2) update CHANGELOG.md
|
|
218
293
|
# 3) commit changes
|
|
219
|
-
|
|
294
|
+
# 4) push a matching tag, for example:
|
|
295
|
+
git tag -a v0.2.6 -m "Release logister-ruby v0.2.6"
|
|
296
|
+
git push origin main v0.2.6
|
|
220
297
|
```
|
|
221
298
|
|
|
222
|
-
|
|
299
|
+
The `.github/workflows/release.yml` workflow verifies the tag matches `Logister::VERSION`, runs tests, builds the gem, publishes to RubyGems with trusted publishing, and then creates or updates the matching GitHub release from `CHANGELOG.md`.
|
|
300
|
+
|
|
301
|
+
Before tag releases can publish the gem, configure a RubyGems trusted publisher for:
|
|
302
|
+
|
|
303
|
+
- GitHub owner: `taimoorq`
|
|
304
|
+
- Repository: `logister-ruby`
|
|
305
|
+
- Workflow file: `.github/workflows/release.yml`
|
|
306
|
+
- Environment: leave blank unless you also add a GitHub release environment to the workflow
|
|
307
|
+
|
|
308
|
+
Manual publishing is still possible with Bundler's built-in release flow when needed:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
bundle exec rake release
|
|
312
|
+
```
|
data/lib/logister/reporter.rb
CHANGED
|
@@ -64,16 +64,29 @@ module Logister
|
|
|
64
64
|
@client.publish(payload)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
def report_metric(message:, level: 'info', context: {}, tags: {}, fingerprint: nil)
|
|
67
|
+
def report_metric(message:, value: nil, unit: nil, level: 'info', context: {}, tags: {}, fingerprint: nil)
|
|
68
68
|
return false if ignored_environment?
|
|
69
69
|
return false if ignored_path?(context)
|
|
70
70
|
|
|
71
|
+
metric_context = context.merge(tags: tags)
|
|
72
|
+
if value
|
|
73
|
+
metric_context = metric_context.merge(
|
|
74
|
+
metric: {
|
|
75
|
+
name: message,
|
|
76
|
+
value: value,
|
|
77
|
+
unit: unit
|
|
78
|
+
}.compact,
|
|
79
|
+
value: value,
|
|
80
|
+
unit: unit
|
|
81
|
+
).compact
|
|
82
|
+
end
|
|
83
|
+
|
|
71
84
|
payload = build_payload(
|
|
72
85
|
event_type: 'metric',
|
|
73
86
|
level: level,
|
|
74
87
|
message: message,
|
|
75
88
|
fingerprint: fingerprint || metric_fingerprint(message),
|
|
76
|
-
context:
|
|
89
|
+
context: metric_context
|
|
77
90
|
)
|
|
78
91
|
|
|
79
92
|
payload = apply_before_notify(payload)
|
|
@@ -123,7 +136,19 @@ module Logister
|
|
|
123
136
|
@client.publish(payload)
|
|
124
137
|
end
|
|
125
138
|
|
|
126
|
-
def report_check_in(
|
|
139
|
+
def report_check_in(
|
|
140
|
+
slug:,
|
|
141
|
+
status: 'ok',
|
|
142
|
+
expected_interval_seconds: 300,
|
|
143
|
+
duration_ms: nil,
|
|
144
|
+
context: {},
|
|
145
|
+
level: nil,
|
|
146
|
+
environment: nil,
|
|
147
|
+
release: nil,
|
|
148
|
+
occurred_at: nil,
|
|
149
|
+
trace_id: nil,
|
|
150
|
+
request_id: nil
|
|
151
|
+
)
|
|
127
152
|
return false if ignored_environment?
|
|
128
153
|
|
|
129
154
|
payload = build_payload(
|
|
@@ -135,9 +160,14 @@ module Logister
|
|
|
135
160
|
check_in_slug: slug,
|
|
136
161
|
check_in_status: status,
|
|
137
162
|
expected_interval_seconds: expected_interval_seconds,
|
|
138
|
-
duration_ms: duration_ms
|
|
163
|
+
duration_ms: duration_ms,
|
|
164
|
+
environment: environment,
|
|
165
|
+
release: release,
|
|
166
|
+
trace_id: trace_id,
|
|
167
|
+
request_id: request_id
|
|
139
168
|
).compact
|
|
140
169
|
)
|
|
170
|
+
payload[:occurred_at] = normalize_timestamp(occurred_at) if occurred_at
|
|
141
171
|
|
|
142
172
|
payload = apply_before_notify(payload)
|
|
143
173
|
return false unless payload
|
|
@@ -222,6 +252,10 @@ module Logister
|
|
|
222
252
|
}
|
|
223
253
|
end
|
|
224
254
|
|
|
255
|
+
def normalize_timestamp(timestamp)
|
|
256
|
+
timestamp.respond_to?(:utc) ? timestamp.utc.iso8601 : timestamp.to_s
|
|
257
|
+
end
|
|
258
|
+
|
|
225
259
|
def apply_before_notify(payload)
|
|
226
260
|
hook = @configuration.before_notify
|
|
227
261
|
return payload unless hook.respond_to?(:call)
|
data/lib/logister/version.rb
CHANGED