fluentd-sentry-output 0.0.7 → 0.0.9
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 +36 -3
- 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: 0367abe3a511b3408103227eb805579a871278885646c48db004d3877db70aac
|
4
|
+
data.tar.gz: 9f46f8d169400ecc50fa0966687af9026c2d449ef041e43cbe9a9dbc11089225
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1b68f880841099d707e92bd13001d67352a52ab4e4f68d5f80df6da8c74147ffc7e4c673706ea84c64109c07ffb3bffb393417589f63313080fbdf30c5b7b97
|
7
|
+
data.tar.gz: e53223dc1b767ddea9cdbe458fba75bde8b6d0beaaf3dbe414afc0ce1be674ad5a995ccf4a3d4d9439297af14fa24c9230ffffb606c6f7b6a7f5fa7ef321f654
|
@@ -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,9 @@ class SentryMessageFormat
|
|
68
68
|
request,
|
69
69
|
exception,
|
70
70
|
platform,
|
71
|
-
transaction
|
71
|
+
transaction,
|
72
|
+
otel_trace_id,
|
73
|
+
user
|
72
74
|
)
|
73
75
|
@event_id = event_id
|
74
76
|
@timestamp = timestamp
|
@@ -79,9 +81,38 @@ class SentryMessageFormat
|
|
79
81
|
@request = request
|
80
82
|
@platform = platform
|
81
83
|
@transaction = transaction
|
84
|
+
|
85
|
+
unless otel_trace_id.include? 'ukw'
|
86
|
+
self.contexts = create_context(otel_trace_id)
|
87
|
+
end
|
88
|
+
|
89
|
+
@user = if user.nil?
|
90
|
+
{}
|
91
|
+
else
|
92
|
+
@user
|
93
|
+
end
|
94
|
+
|
82
95
|
self.exception = SentryException.new(exception)
|
83
96
|
end
|
84
97
|
|
98
|
+
def create_context(otel_trace_id)
|
99
|
+
contexts = {}
|
100
|
+
contexts['trace'] = {}
|
101
|
+
contexts['trace']['op'] = 'http.server'
|
102
|
+
contexts['trace']['status'] = 'unknown'
|
103
|
+
contexts['trace']['type'] = 'trace'
|
104
|
+
contexts['trace']['trace_id'] = otel_trace_id.split('-')[0]
|
105
|
+
contexts['trace']['span_id'] = otel_trace_id.split('-')[1]
|
106
|
+
|
107
|
+
if self.tags.nil?
|
108
|
+
self.tags = {}
|
109
|
+
end
|
110
|
+
|
111
|
+
self.tags['trace_id'] = contexts['trace']['trace_id']
|
112
|
+
|
113
|
+
contexts
|
114
|
+
end
|
115
|
+
|
85
116
|
def to_json(*_args)
|
86
117
|
hash = {}
|
87
118
|
instance_variables.each do |var|
|
@@ -128,7 +159,9 @@ module Fluent::Plugin
|
|
128
159
|
record['request'] || nil,
|
129
160
|
record['exception'] || nil,
|
130
161
|
record['platform'] || 'node',
|
131
|
-
record['transaction'] || nil
|
162
|
+
record['transaction'] || nil,
|
163
|
+
record['oTelTraceId'] || 'ukw-ukw-1',
|
164
|
+
record['user'] || {}
|
132
165
|
)
|
133
166
|
|
134
167
|
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.9
|
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-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|