Skip to content

Commit 86d4841

Browse files
Align method http span convention (#1477)
Co-authored-by: Manoel Aranda Neto <[email protected]>
1 parent 43760f9 commit 86d4841

8 files changed

+12
-11
lines changed

CHANGELOG.md

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

55
### Fixes
66

7+
- Align http method to span convention ([#1477](https://github.com/getsentry/sentry-dart/pull/1477))
78
- Wrapped methods return a `Future` instead of executing right away ([#1476](https://github.com/getsentry/sentry-dart/pull/1476))
89
- Relates to ([#1462](https://github.com/getsentry/sentry-dart/pull/1462))
910

dart/lib/src/http_client/tracing_client.dart

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

42-
span?.setData('method', request.method);
42+
span?.setData('http.method', request.method);
4343
urlDetails?.applyToSpan(span);
4444

4545
StreamedResponse? response;

dart/lib/src/protocol/sentry_response.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import '../utils/iterable_extension.dart';
55
/// The response interface contains information on a HTTP request related to the event.
66
@immutable
77
class SentryResponse {
8-
/// The tpye of this class in the [Contexts] field
8+
/// The type of this class in the [Contexts] field
99
static const String type = 'response';
1010

1111
/// The size of the response body.

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['method'], 'GET');
41+
expect(span.data['http.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('method', options.method);
30+
span?.setData('http.method', options.method);
3131
urlDetails?.applyToSpan(span);
3232

3333
String? request;
@@ -62,7 +62,7 @@ class SentryTransformer implements Transformer {
6262
description: description,
6363
);
6464

65-
span?.setData('method', options.method);
65+
span?.setData('http.method', options.method);
6666
urlDetails?.applyToSpan(span);
6767

6868
dynamic transformedResponse;

dio/lib/src/tracing_client_adapter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TracingClientAdapter implements HttpClientAdapter {
4343
span = null;
4444
}
4545

46-
span?.setData('method', options.method);
46+
span?.setData('http.method', options.method);
4747
urlDetails?.applyToSpan(span);
4848

4949
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['method'], 'GET');
42+
expect(span.data['http.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');
@@ -65,7 +65,7 @@ void main() {
6565
expect(span.status, SpanStatus.internalError());
6666
expect(span.context.operation, 'serialize.http.client');
6767
expect(span.context.description, 'GET https://example.com');
68-
expect(span.data['method'], 'GET');
68+
expect(span.data['http.method'], 'GET');
6969
expect(span.data['url'], 'https://example.com');
7070
expect(span.data['http.query'], 'foo=bar');
7171
expect(span.data['http.fragment'], 'baz');
@@ -93,7 +93,7 @@ void main() {
9393
expect(span.status, SpanStatus.ok());
9494
expect(span.context.operation, 'serialize.http.client');
9595
expect(span.context.description, 'GET https://example.com');
96-
expect(span.data['method'], 'GET');
96+
expect(span.data['http.method'], 'GET');
9797
expect(span.data['url'], 'https://example.com');
9898
expect(span.data['http.query'], 'foo=bar');
9999
expect(span.data['http.fragment'], 'baz');
@@ -122,7 +122,7 @@ void main() {
122122
expect(span.status, SpanStatus.internalError());
123123
expect(span.context.operation, 'serialize.http.client');
124124
expect(span.context.description, 'GET https://example.com');
125-
expect(span.data['method'], 'GET');
125+
expect(span.data['http.method'], 'GET');
126126
expect(span.data['url'], 'https://example.com');
127127
expect(span.data['http.query'], 'foo=bar');
128128
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
@@ -42,7 +42,7 @@ void main() {
4242
expect(span.status, SpanStatus.ok());
4343
expect(span.context.operation, 'http.client');
4444
expect(span.context.description, 'GET https://example.com');
45-
expect(span.data['method'], 'GET');
45+
expect(span.data['http.method'], 'GET');
4646
expect(span.data['url'], 'https://example.com');
4747
expect(span.data['http.query'], 'foo=bar');
4848
expect(span.data['http.fragment'], 'baz');

0 commit comments

Comments
 (0)