Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

feat: Use sentry-go #8

Merged
merged 65 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7c9453e
feat: Create exporter layout
AbhiPrasad May 13, 2020
b61783f
Remove unnecessary modules from go.mod
AbhiPrasad May 13, 2020
5489df0
run go mod tidy
AbhiPrasad May 13, 2020
4567e1a
feat: convert from OT spans to Sentry spans
AbhiPrasad May 13, 2020
30327a3
test: convert OT span to sentry span
AbhiPrasad May 13, 2020
223afa2
chore: remove year from license
AbhiPrasad May 13, 2020
7ce5837
fix: account for new status codes
AbhiPrasad May 13, 2020
33ce01b
fix: add period to comments
AbhiPrasad May 15, 2020
a7d1667
ref: Use better check for parentSpanID
AbhiPrasad May 15, 2020
b7c30da
chore: fix comment periods
AbhiPrasad May 15, 2020
9f1ebbf
fix: Address PR review
AbhiPrasad May 15, 2020
b4a5a5d
chore: change var name to sentryStatusUnknown
AbhiPrasad May 15, 2020
69e547b
fix: Address PR review 2
AbhiPrasad May 15, 2020
2250203
fix: correctly export sentryexporter
AbhiPrasad May 15, 2020
8e33fb6
feat: Classify spans
AbhiPrasad May 15, 2020
b95a5f2
feat: Transaction interface
AbhiPrasad May 15, 2020
2715796
test: refactor orphan spans test into table test
AbhiPrasad May 15, 2020
78217ff
ref: Use Sentry Event in Transaction struct
AbhiPrasad May 15, 2020
30b81b1
fix: PR review comments
AbhiPrasad May 15, 2020
4c30656
ref: Change transaction context
AbhiPrasad May 18, 2020
41da02a
ref: Change DSN
AbhiPrasad May 19, 2020
e2f6c97
fix: DSN
AbhiPrasad May 22, 2020
448d7c7
feat: Marshal sentry structs
AbhiPrasad May 19, 2020
9351de6
feat: Generate transactions from spans
AbhiPrasad May 19, 2020
c9fdb13
Generate envelope
AbhiPrasad May 19, 2020
0c64d6d
feat: Send events to Sentry
AbhiPrasad May 20, 2020
45ae585
fix: timestamps and DSN
AbhiPrasad May 22, 2020
5f2fa40
Chore: Adjust wording according to review
AbhiPrasad May 22, 2020
bd4c8cb
ref: Create transport for every exporter instance
AbhiPrasad May 22, 2020
f5515ff
fix: PR review
AbhiPrasad May 22, 2020
7613669
fix: correctly export sentryexporter
AbhiPrasad May 15, 2020
5396066
feat: Classify spans
AbhiPrasad May 15, 2020
331dc60
feat: Transaction interface
AbhiPrasad May 15, 2020
5ec99bb
test: refactor orphan spans test into table test
AbhiPrasad May 15, 2020
0f746ad
ref: Use Sentry Event in Transaction struct
AbhiPrasad May 15, 2020
75965f9
fix: PR review comments
AbhiPrasad May 15, 2020
4732fb7
ref: Change transaction context
AbhiPrasad May 18, 2020
9148963
ref: Change DSN
AbhiPrasad May 19, 2020
ded7fc5
fix: DSN
AbhiPrasad May 22, 2020
313754d
Merge branch 'master' into feat/add-sentry-transaction
AbhiPrasad May 22, 2020
12955e9
chore: Add comment about semantic conventions
AbhiPrasad May 22, 2020
fe9ed4e
ref: Avoid using IDMap and SSMap types
AbhiPrasad May 22, 2020
1367659
ref: change ssMap to rootSpanTreeMap
AbhiPrasad May 22, 2020
358d8f0
Merge branch 'feat/add-sentry-transaction' into feat/sentry-transport
AbhiPrasad May 22, 2020
1e41302
ref: disassociate envelope creation with transaction type
AbhiPrasad May 25, 2020
66c733c
ref: Change how library is set on span
AbhiPrasad May 26, 2020
3bbc12b
chore: remove SpanStore reference
AbhiPrasad May 26, 2020
736363d
merge: with master
AbhiPrasad May 27, 2020
855fa1d
fix: PR review
AbhiPrasad May 27, 2020
23f9830
test: check to see if time can be parsed
AbhiPrasad May 27, 2020
799a484
Feat: Add async buffer for transport
AbhiPrasad May 25, 2020
bda1edf
test: Test async buffer transport
AbhiPrasad May 25, 2020
387f8f2
ref: Send events with envelopes
AbhiPrasad May 26, 2020
fe042cd
fix: remove regex usage
AbhiPrasad May 27, 2020
f0d88d8
ref: Check if envelope URL is valid
AbhiPrasad May 27, 2020
a090d46
ref: Refactor to use sentry-go transport
AbhiPrasad Jun 1, 2020
7d33a99
chore: use latest go version
AbhiPrasad Jun 4, 2020
37b76d3
ref: Generate transactions from root span tree
AbhiPrasad Jun 4, 2020
afdf6e0
chore: Run go mod tidy
AbhiPrasad Jun 4, 2020
d4c169c
chore: add comments and better names
AbhiPrasad Jun 5, 2020
fd77b19
fix: Address PR review
AbhiPrasad Jun 22, 2020
f125961
feat: buffer size
AbhiPrasad Jun 22, 2020
e0ddc9d
remove buffer size
AbhiPrasad Jul 13, 2020
3cc5e3f
ref: Replace root span tree with transactions
AbhiPrasad Jul 13, 2020
731a2dd
remove resource_tag identifier
AbhiPrasad Jul 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/sentryexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ func TestLoadConfig(t *testing.T) {
NameVal: "sentry/2",
TypeVal: "sentry",
},
DSN: "https://key@host/path/id",
DSN: "https://key@host/path/42",
})
}
138 changes: 138 additions & 0 deletions exporter/sentryexporter/data_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package sentryexporter

import "github.com/getsentry/sentry-go"

/*
for trace d6c4f03650bd47699ec65c84352b6208:
rootSpan1 <- childSpan1 <- childChildSpan1
rootSpan1 <- childSpan2
rootSpan2 <- root2childSpan
orphanSpan
*/

var (
rootSpan1 = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "1cc4b26ab9094ef0",
ParentSpanID: "",
Description: "/api/users/{user_id}",
Op: "http.server",
Tags: map[string]string{
"organization": "12345",
"status_message": "HTTP OK",
"span_kind": "server",
},
StartTimestamp: unixNanoToTime(5),
EndTimestamp: unixNanoToTime(10),
Status: "ok",
}

childSpan1 = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "93ba92db3fa24752",
ParentSpanID: "1cc4b26ab9094ef0",
Description: `SELECT * FROM user WHERE "user"."id" = {id}`,
Op: "db",
Tags: map[string]string{
"function_name": "get_users",
"status_message": "MYSQL OK",
"span_kind": "server",
},
StartTimestamp: unixNanoToTime(5),
EndTimestamp: unixNanoToTime(7),
Status: "ok",
}

childChildSpan1 = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "1fa8913ec3814d34",
ParentSpanID: "93ba92db3fa24752",
Description: `DB locked`,
Op: "db",
Tags: map[string]string{
"db_status": "oh no im locked rn",
"status_message": "MYSQL OK",
"span_kind": "server",
},
StartTimestamp: unixNanoToTime(6),
EndTimestamp: unixNanoToTime(7),
Status: "ok",
}

childSpan2 = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "34efcde268684bb0",
ParentSpanID: "1cc4b26ab9094ef0",
Description: "Serialize stuff",
Op: "",
Tags: map[string]string{
"span_kind": "server",
},
StartTimestamp: unixNanoToTime(7),
EndTimestamp: unixNanoToTime(10),
Status: "ok",
}

orphanSpan1 = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "6241111811384fae",
ParentSpanID: "1930bb5cc45c4003",
Description: "A random span",
Op: "",
StartTimestamp: unixNanoToTime(3),
EndTimestamp: unixNanoToTime(6),
Status: "ok",
}

rootSpan2 = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "4c7f56556ffe4e4a",
ParentSpanID: "",
Description: "Navigating to fancy website",
Op: "pageload",
Tags: map[string]string{
"status_message": "HTTP OK",
"span_kind": "client",
},
StartTimestamp: unixNanoToTime(0),
EndTimestamp: unixNanoToTime(5),
Status: "ok",
}

root2childSpan = &sentry.Span{
TraceID: "d6c4f03650bd47699ec65c84352b6208",
SpanID: "7ff3c8daf8184fee",
ParentSpanID: "4c7f56556ffe4e4a",
Description: "<FancyReactComponent />",
Op: "react",
Tags: map[string]string{
"span_kind": "server",
},
StartTimestamp: unixNanoToTime(4),
EndTimestamp: unixNanoToTime(5),
Status: "ok",
}

transaction1 = getTestTransaction(rootSpan1, []*sentry.Span{childSpan1, childChildSpan1, childSpan2})
transaction2 = getTestTransaction(rootSpan2, []*sentry.Span{root2childSpan})
)

func getTestTransaction(rootSpan *sentry.Span, childSpans []*sentry.Span) *sentry.Event {
transaction := transactionFromSpan(rootSpan)
transaction.Spans = childSpans
return transaction
}
1 change: 1 addition & 0 deletions exporter/sentryexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (f *Factory) CreateDefaultConfig() configmodels.Exporter {
TypeVal: typeStr,
NameVal: typeStr,
},
DSN: "",
AbhiPrasad marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/sentryexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCreateDefaultConfig(t *testing.T) {
assert.NoError(t, configcheck.ValidateConfig(cfg))
}

func TestCreateTraceExporter(t *testing.T) {
func TestCreateTraceExporterDefault(t *testing.T) {
factory := &Factory{}
cfg := factory.CreateDefaultConfig()

Expand Down
4 changes: 2 additions & 2 deletions exporter/sentryexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sentry
go 1.14

require (
github.com/getsentry/sentry-go v0.6.1
github.com/getsentry/sentry-go v0.6.2-0.20200604090419-1d0b5e638037
github.com/google/go-cmp v0.4.0
github.com/open-telemetry/opentelemetry-collector v0.3.1-0.20200511154150-871119061598
github.com/open-telemetry/opentelemetry-proto v0.3.0
github.com/stretchr/testify v1.5.1
github.com/stretchr/testify v1.6.1
go.uber.org/zap v1.15.0
)
Loading