fluentd-sentry-output 0.0.6 → 0.0.8
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/lib/fluent/plugin/out_sentry.rb +29 -6
- 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: e3fba0325e20965ae1bd28726cc974815bb3904522db32b95a376421d90f1f32
|
4
|
+
data.tar.gz: 5f2896d0c307051fa7bec32bcf6f4ee3df79faa97f5610a1ad4293ae018b44a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ed983a043c666119cc40a4f427d5492ca3b15e812159fd3bfd25cc01c276b0f3323115f6f5513b618e38ea935c21a36d21c277c7d632802d235879378f88b0f
|
7
|
+
data.tar.gz: e68775695c37601dbc8fbf120b2b14933ee476fb6ebedcd84d6fa0ee0ecb53310ff3e0ae2c3f00acbfd0e3f6d6e2c794440389ece22981d38b0eb02671b28d9b
|
@@ -13,10 +13,10 @@ class SentryException
|
|
13
13
|
trace['stacktrace']['frames'] = []
|
14
14
|
values.push(trace)
|
15
15
|
|
16
|
-
log.debug 'exception - ', exception
|
17
|
-
|
18
16
|
frames = exception['frames']
|
19
|
-
|
17
|
+
p exception
|
18
|
+
p frames
|
19
|
+
|
20
20
|
frames.each do |frame|
|
21
21
|
add_values(frame)
|
22
22
|
end
|
@@ -56,7 +56,7 @@ end
|
|
56
56
|
class SentryMessageFormat
|
57
57
|
attr_accessor :event_id, :server_name, :timestamp, :environment,
|
58
58
|
:release, :tags, :request, :user, :transaction, :exception,
|
59
|
-
:error_type, :error_message, :platform
|
59
|
+
:error_type, :error_message, :platform, :contexts
|
60
60
|
|
61
61
|
def initialize(
|
62
62
|
timestamp,
|
@@ -68,7 +68,8 @@ class SentryMessageFormat
|
|
68
68
|
request,
|
69
69
|
exception,
|
70
70
|
platform,
|
71
|
-
transaction
|
71
|
+
transaction,
|
72
|
+
otel_trace_id
|
72
73
|
)
|
73
74
|
@event_id = event_id
|
74
75
|
@timestamp = timestamp
|
@@ -79,9 +80,30 @@ class SentryMessageFormat
|
|
79
80
|
@request = request
|
80
81
|
@platform = platform
|
81
82
|
@transaction = transaction
|
83
|
+
unless otel_trace_id.include? 'ukw'
|
84
|
+
self.contexts = create_context(otel_trace_id)
|
85
|
+
end
|
82
86
|
self.exception = SentryException.new(exception)
|
83
87
|
end
|
84
88
|
|
89
|
+
def create_context(otel_trace_id)
|
90
|
+
contexts = {}
|
91
|
+
contexts['trace'] = {}
|
92
|
+
contexts['trace']['op'] = 'http.server'
|
93
|
+
contexts['trace']['status'] = 'unknown'
|
94
|
+
contexts['trace']['type'] = 'trace'
|
95
|
+
contexts['trace']['trace_id'] = otel_trace_id.split('-')[0]
|
96
|
+
contexts['trace']['span_id'] = otel_trace_id.split('-')[1]
|
97
|
+
|
98
|
+
if self.tags.nil?
|
99
|
+
self.tags = {}
|
100
|
+
end
|
101
|
+
|
102
|
+
self.tags['trace_id'] = contexts['trace']['trace_id']
|
103
|
+
|
104
|
+
contexts
|
105
|
+
end
|
106
|
+
|
85
107
|
def to_json(*_args)
|
86
108
|
hash = {}
|
87
109
|
instance_variables.each do |var|
|
@@ -128,7 +150,8 @@ module Fluent::Plugin
|
|
128
150
|
record['request'] || nil,
|
129
151
|
record['exception'] || nil,
|
130
152
|
record['platform'] || 'node',
|
131
|
-
record['transaction'] || nil
|
153
|
+
record['transaction'] || nil,
|
154
|
+
record['oTelTraceId'] || 'ukw-ukw-1'
|
132
155
|
)
|
133
156
|
|
134
157
|
url = create_sentry_event_ingestion_url
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd-sentry-output
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anirudh Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|