Skip to content

Commit

Permalink
Add SDKIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Nov 7, 2022
1 parent 12cb9e4 commit 565c4a6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,12 @@ func (client *Client) prepareEvent(event *Event, hint *EventHint, scope EventMod

event.Platform = "go"
event.Sdk = SdkInfo{
Name: "sentry.go",
Version: Version,
Name: SDKIdentifier,
Version: SDKVersion,
Integrations: client.listIntegrations(),
Packages: []SdkPackage{{
Name: "sentry-go",
Version: Version,
Version: SDKVersion,
}},
}

Expand Down
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ func TestCaptureEvent(t *testing.T) {
Platform: "go",
Sdk: SdkInfo{
Name: "sentry.go",
Version: Version,
Version: SDKVersion,
Integrations: []string{},
Packages: []SdkPackage{
{
// FIXME: name format doesn't follow spec in
// https://docs.sentry.io/development/sdk-dev/event-payloads/sdk/
Name: "sentry-go",
Version: Version,
Version: SDKVersion,
},
// TODO: perhaps the list of packages is incomplete or there
// should not be any package at all. We may include references
Expand Down
10 changes: 8 additions & 2 deletions sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ import (
"time"
)

// Deprecated: Use SDKVersion instead.
const Version = SDKVersion

// Version is the version of the SDK.
const Version = "0.14.0"
const SDKVersion = "0.14.0"

// The identifier of the SDK.
const SDKIdentifier = "sentry.go"

// apiVersion is the minimum version of the Sentry API compatible with the
// sentry-go SDK.
const apiVersion = "7"

// userAgent is the User-Agent of outgoing HTTP requests.
const userAgent = "sentry-go/" + Version
const userAgent = "sentry-go/" + SDKVersion

// Init initializes the SDK with options. The returned error is non-nil if
// options is invalid, for instance if a malformed DSN is provided.
Expand Down

0 comments on commit 565c4a6

Please sign in to comment.