Skip to content

Commit 4ad2751

Browse files
authored
[starfish] add http.request.method attribute to http spans (#1633)
* add http.request.method to http spans * update changelog
1 parent 9442665 commit 4ad2751

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Enhancements
66

7+
- Add http.request.method attribute to http spans data ([#1633](https://github.com/getsentry/sentry-dart/pull/1633))
78
- Add db.system and db.name attributes to db spans data ([#1629](https://github.com/getsentry/sentry-dart/pull/1629))
89

910
### Features

dart/lib/src/http_client/tracing_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TracingClient extends BaseClient {
4141
span = null;
4242
}
4343

44-
span?.setData('http.method', request.method);
44+
span?.setData('http.request.method', request.method);
4545
urlDetails?.applyToSpan(span);
4646

4747
StreamedResponse? response;

dart/test/http_client/tracing_client_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void main() {
3838
expect(span.status, SpanStatus.ok());
3939
expect(span.context.operation, 'http.client');
4040
expect(span.context.description, 'GET https://example.com');
41-
expect(span.data['http.method'], 'GET');
41+
expect(span.data['http.request.method'], 'GET');
4242
expect(span.data['url'], 'https://example.com');
4343
expect(span.data['http.query'], 'foo=bar');
4444
expect(span.data['http.fragment'], 'baz');

dio/lib/src/sentry_transformer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SentryTransformer implements Transformer {
2727
description: description,
2828
);
2929

30-
span?.setData('http.method', options.method);
30+
span?.setData('http.request.method', options.method);
3131
// ignore: invalid_use_of_internal_member
3232
span?.origin = SentryTraceOrigins.autoHttpDioTransformer;
3333

@@ -65,7 +65,7 @@ class SentryTransformer implements Transformer {
6565
description: description,
6666
);
6767

68-
span?.setData('http.method', options.method);
68+
span?.setData('http.request.method', options.method);
6969
// ignore: invalid_use_of_internal_member
7070
span?.origin = SentryTraceOrigins.autoHttpDioTransformer;
7171

dio/lib/src/tracing_client_adapter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TracingClientAdapter implements HttpClientAdapter {
4646
span = null;
4747
}
4848

49-
span?.setData('http.method', options.method);
49+
span?.setData('http.request.method', options.method);
5050
urlDetails?.applyToSpan(span);
5151

5252
ResponseBody? response;

dio/test/sentry_transformer_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void main() {
3939
expect(span.status, SpanStatus.ok());
4040
expect(span.context.operation, 'serialize.http.client');
4141
expect(span.context.description, 'GET https://example.com');
42-
expect(span.data['http.method'], 'GET');
42+
expect(span.data['http.request.method'], 'GET');
4343
expect(span.data['url'], 'https://example.com');
4444
expect(span.data['http.query'], 'foo=bar');
4545
expect(span.data['http.fragment'], 'baz');
@@ -67,7 +67,7 @@ void main() {
6767
expect(span.status, SpanStatus.internalError());
6868
expect(span.context.operation, 'serialize.http.client');
6969
expect(span.context.description, 'GET https://example.com');
70-
expect(span.data['http.method'], 'GET');
70+
expect(span.data['http.request.method'], 'GET');
7171
expect(span.data['url'], 'https://example.com');
7272
expect(span.data['http.query'], 'foo=bar');
7373
expect(span.data['http.fragment'], 'baz');
@@ -96,7 +96,7 @@ void main() {
9696
expect(span.status, SpanStatus.ok());
9797
expect(span.context.operation, 'serialize.http.client');
9898
expect(span.context.description, 'GET https://example.com');
99-
expect(span.data['http.method'], 'GET');
99+
expect(span.data['http.request.method'], 'GET');
100100
expect(span.data['url'], 'https://example.com');
101101
expect(span.data['http.query'], 'foo=bar');
102102
expect(span.data['http.fragment'], 'baz');
@@ -126,7 +126,7 @@ void main() {
126126
expect(span.status, SpanStatus.internalError());
127127
expect(span.context.operation, 'serialize.http.client');
128128
expect(span.context.description, 'GET https://example.com');
129-
expect(span.data['http.method'], 'GET');
129+
expect(span.data['http.request.method'], 'GET');
130130
expect(span.data['url'], 'https://example.com');
131131
expect(span.data['http.query'], 'foo=bar');
132132
expect(span.data['http.fragment'], 'baz');

dio/test/tracing_client_adapter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void main() {
4343
expect(span.status, SpanStatus.ok());
4444
expect(span.context.operation, 'http.client');
4545
expect(span.context.description, 'GET https://example.com');
46-
expect(span.data['http.method'], 'GET');
46+
expect(span.data['http.request.method'], 'GET');
4747
expect(span.data['url'], 'https://example.com');
4848
expect(span.data['http.query'], 'foo=bar');
4949
expect(span.data['http.fragment'], 'baz');

0 commit comments

Comments
 (0)