salestation 5.4.0 → 5.5.0
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 +9 -0
- data/lib/salestation/web/request_logger.rb +4 -1
- data/salestation.gemspec +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd7b52225452bf9e306427aac8619e9b4a41a7b2301fd050e5cadef33ce0a609
|
|
4
|
+
data.tar.gz: 919ed91a19ac79a75bb09d6b786c885b201b46c719b0bd2bb59b8e132629fca8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 38c10c460642865693c5941430ac49cfc97b5d17296ac434ab5d1f43ac7f79a7b98f7da39f310b31fd099056d8104f6c3816e73bff727e596e75081c1b1fee40
|
|
7
|
+
data.tar.gz: 05046b1499641bb9c889a0d97ef68cb7d8d650089f2f8b317a0e96108819a436e8883768973ed437b736a4c273abadd0e58e5308cc5d31ce7dbdf3da2905c824
|
data/README.md
CHANGED
|
@@ -167,6 +167,15 @@ class Webapp < Sinatra::Base
|
|
|
167
167
|
end
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
+
You can configure per-request fields by defining `salestation.request_logger.fields` in sinatra `env`:
|
|
171
|
+
|
|
172
|
+
```ruby
|
|
173
|
+
def my_handler(env)
|
|
174
|
+
env['salestation.request_logger.fields'] = { foo: 'bar' }
|
|
175
|
+
# ...
|
|
176
|
+
end
|
|
177
|
+
```
|
|
178
|
+
|
|
170
179
|
### Using StatsD
|
|
171
180
|
|
|
172
181
|
Salestation provides a StatsD middleware which can be used record request
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Salestation
|
|
4
4
|
class Web < Module
|
|
5
5
|
class RequestLogger
|
|
6
|
+
EXTRA_FIELDS_ENV_KEY = 'salestation.request_logger.fields'
|
|
7
|
+
|
|
6
8
|
DURATION_PRECISION = 6
|
|
7
9
|
REMOTE_ADDR = 'REMOTE_ADDR'
|
|
8
10
|
REQUEST_URI = 'REQUEST_URI'
|
|
@@ -71,7 +73,8 @@ module Salestation
|
|
|
71
73
|
log[:body] = body.join
|
|
72
74
|
end
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
extra_fields = env.fetch(EXTRA_FIELDS_ENV_KEY, {})
|
|
77
|
+
log.merge!(extra_fields)
|
|
75
78
|
end
|
|
76
79
|
|
|
77
80
|
def duration(from:)
|
data/salestation.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: salestation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Glia TechMovers
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -220,7 +219,6 @@ homepage: ''
|
|
|
220
219
|
licenses:
|
|
221
220
|
- MIT
|
|
222
221
|
metadata: {}
|
|
223
|
-
post_install_message:
|
|
224
222
|
rdoc_options: []
|
|
225
223
|
require_paths:
|
|
226
224
|
- lib
|
|
@@ -235,8 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
235
233
|
- !ruby/object:Gem::Version
|
|
236
234
|
version: '0'
|
|
237
235
|
requirements: []
|
|
238
|
-
rubygems_version: 3.
|
|
239
|
-
signing_key:
|
|
236
|
+
rubygems_version: 3.6.2
|
|
240
237
|
specification_version: 4
|
|
241
238
|
summary: ''
|
|
242
239
|
test_files: []
|