@@ -32,8 +32,13 @@ func Test_ok(t *testing.T) {
3232 {
3333 Level : sentrysdk .LevelInfo ,
3434 Message : http .StatusText (http .StatusInternalServerError ),
35- Extra : map [string ]interface {}{
36- "problem.status" : http .StatusInternalServerError ,
35+ Extra : map [string ]interface {}{},
36+ Contexts : map [string ]interface {
37+ }{
38+ "problemDetails" : & problemContext {
39+ Type : "about:blank" ,
40+ Status : http .StatusInternalServerError ,
41+ },
3742 },
3843 },
3944 },
@@ -46,9 +51,14 @@ func Test_ok(t *testing.T) {
4651 {
4752 Level : sentrysdk .LevelInfo ,
4853 Message : "some details" ,
49- Extra : map [string ]interface {}{
50- "problem.status" : http .StatusInternalServerError ,
51- "problem.detail" : "some details" ,
54+ Extra : map [string ]interface {}{},
55+ Contexts : map [string ]interface {
56+ }{
57+ "problemDetails" : & problemContext {
58+ Type : "about:blank" ,
59+ Status : http .StatusInternalServerError ,
60+ Detail : "some details" ,
61+ },
5262 },
5363 },
5464 },
@@ -61,9 +71,14 @@ func Test_ok(t *testing.T) {
6171 {
6272 Level : sentrysdk .LevelInfo ,
6373 Message : http .StatusText (http .StatusInternalServerError ),
64- Extra : map [string ]interface {}{
65- "problem.status" : http .StatusInternalServerError ,
66- "problem.instance" : "http://instance.example/" ,
74+ Extra : map [string ]interface {}{},
75+ Contexts : map [string ]interface {
76+ }{
77+ "problemDetails" : & problemContext {
78+ Type : "about:blank" ,
79+ Status : http .StatusInternalServerError ,
80+ Instance : "http://instance.example/" ,
81+ },
6782 },
6883 },
6984 },
@@ -82,8 +97,13 @@ func Test_ok(t *testing.T) {
8297 {
8398 Level : sentrysdk .LevelInfo ,
8499 Message : http .StatusText (http .StatusBadRequest ),
85- Extra : map [string ]interface {}{
86- "problem.status" : http .StatusBadRequest ,
100+ Extra : map [string ]interface {}{},
101+ Contexts : map [string ]interface {
102+ }{
103+ "problemDetails" : & problemContext {
104+ Type : "about:blank" ,
105+ Status : http .StatusBadRequest ,
106+ },
87107 },
88108 },
89109 },
@@ -165,10 +185,13 @@ func withSentryHub() httputil.Middleware {
165185var sentryEventCmpOptions = cmp.Options {
166186 cmpopts .IgnoreFields (
167187 sentry.Event {},
168- "Contexts" , " EventID" , "Platform" , "Release" , "Sdk" , "ServerName" , "Tags" , "Timestamp" ,
188+ "EventID" , "Platform" , "Release" , "Sdk" , "ServerName" , "Tags" , "Timestamp" ,
169189 ),
170190 cmpopts .IgnoreFields (
171191 sentry.Request {},
172192 "Env" ,
173193 ),
194+ cmpopts .IgnoreMapEntries (func (key string , value interface {}) bool {
195+ return key != "problemDetails"
196+ }),
174197}
0 commit comments