blipit 0.3.0 → 0.3.1
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 +4 -0
- data/lib/blipit/nuggets.rb +12 -0
- data/lib/blipit/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: 8f4ec865735afcdbd98349eb7d2148acc8b1ff40e2384de3ed3440f184f1d1b2
|
|
4
|
+
data.tar.gz: '05877dd952a76408ac91f2584dbd928b468a81778c07bcbed1f11dff2338691a'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f9b14cccbf62cb78c2fe5f031e0b11af71214add1be19091c23eb4394b3da1b6a24a4b434706609c182ba81fc9155bfdf21a63e8a72afb7de1788e21f30d3fe
|
|
7
|
+
data.tar.gz: 314ebfa21e8a5a77735b0518cca8771f9545a8497200ec9b541729bad1ae7b5672dcd78d646e534c38aea16c5bea5bbb9b6f44d817a446bf84eb3e3f96a0acd9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.3.1
|
|
2
|
+
|
|
3
|
+
- Platform mismatch: when Blipit refuses data because the key belongs to a project for another platform (HTTP 409 platform_mismatch), the SDK logs one clear error and stops sending for the rest of the run.
|
|
4
|
+
|
|
1
5
|
## 0.3.0
|
|
2
6
|
|
|
3
7
|
- Runs on Blipit's own core, blipit-nuggets, with no third-party monitoring gem and no runtime dependencies. Events go to `POST /api/v1/events` in Blipit's event format with the `X-Blipit-Key` header; spans go to `/v1/traces`.
|
data/lib/blipit/nuggets.rb
CHANGED
|
@@ -18,6 +18,7 @@ module Blipit
|
|
|
18
18
|
SECURITY_FIELDS = { actor_id: 128, ip: 45, user_agent: 512, database: 64, outcome: 64, target: 256 }.freeze
|
|
19
19
|
HEADER_ALLOW = %w[user-agent referer content-type accept-language].freeze
|
|
20
20
|
MAX_EVENTS = 100
|
|
21
|
+
REFUSED_KEYS = {}
|
|
21
22
|
MAX_SPANS = 10_000
|
|
22
23
|
SPAN_BATCH = 1000
|
|
23
24
|
SPAN_FLUSH = 5.0
|
|
@@ -459,6 +460,17 @@ module Blipit
|
|
|
459
460
|
end
|
|
460
461
|
|
|
461
462
|
def post(path, body)
|
|
463
|
+
return [409, {}, nil] if REFUSED_KEYS[@key]
|
|
464
|
+
|
|
465
|
+
status, headers, payload = send_request(path, body)
|
|
466
|
+
if status == 409 && payload.is_a?(Hash) && payload["reason"] == "platform_mismatch" && !REFUSED_KEYS[@key]
|
|
467
|
+
REFUSED_KEYS[@key] = true
|
|
468
|
+
warn("[blipit] #{payload["error"] || "This key belongs to a project for another platform."} Blipit stopped sending with this key until the process restarts.")
|
|
469
|
+
end
|
|
470
|
+
[status, headers, payload]
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
def send_request(path, body)
|
|
462
474
|
uri = URI.parse(@base + path)
|
|
463
475
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
464
476
|
http.use_ssl = uri.scheme == "https"
|
data/lib/blipit/version.rb
CHANGED