ddtrace 0.12.0.rc1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -2
- data/docs/GettingStarted.md +118 -42
- data/lib/ddtrace/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed9e1360ddbe75df4f11570139cc00f400c18071
|
4
|
+
data.tar.gz: 913743d057209630997ba59f724e1daab5a596dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19746053111cb07270b7a8e09f59064f85f50d47be4d083a2e31dad8c7ce0b973e1706b74ae4fb71795f0d21edfe8a740f5cab5fbff097967d94be92844ed9bd
|
7
|
+
data.tar.gz: 2588e88b3bdf175079518fc14cdc58501b54f9d49a313ab5c19291ec02d86a84e3c10fa7870cc1050c640c89f89afa14c7c8692ae8debb4d57f03f3f83a7da19
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,38 @@
|
|
4
4
|
|
5
5
|
## [Unreleased (beta)]
|
6
6
|
|
7
|
+
## [0.12.0] - 2018-05-08
|
8
|
+
|
9
|
+
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0
|
10
|
+
|
11
|
+
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0
|
12
|
+
|
13
|
+
### Added
|
14
|
+
- GraphQL integration (supporting graphql 1.7.9+) (#295)
|
15
|
+
- ActiveRecord object instantiation tracing (#311, #334)
|
16
|
+
- Subscriber module for ActiveSupport::Notifications tracing (#324, #380, #390, #395) (@dasch)
|
17
|
+
- HTTP quantization module (#384)
|
18
|
+
- Partial flushing option to tracer (#247, #397)
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
- Rack applies URL quantization by default (#371)
|
22
|
+
- Elasticsearch applies body quantization by default (#362)
|
23
|
+
- Context for a single trace now has hard limit of 100,000 spans (#247)
|
24
|
+
- Tags with `rails.db.x` to `active_record.db.x` instead (#396)
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
- Loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)
|
28
|
+
- Some scenarios where `middleware_names` could result in bad resource names (#354)
|
29
|
+
- ActionController instrumentation conflicting with some gems that monkey patch Rails (#391)
|
30
|
+
|
31
|
+
### Deprecated
|
32
|
+
- Use of `:datadog_rack_request_span` variable in favor of `'datadog.rack_request_span'` in Rack. (#365, #392)
|
33
|
+
|
34
|
+
### Refactored
|
35
|
+
- Racecar to use ActiveSupport::Notifications Subscriber module (#381)
|
36
|
+
- Rails to use ActiveRecord integration instead of its own implementation (#396)
|
37
|
+
- ActiveRecord to use ActiveSupport::Notifications Subscriber module (#396)
|
38
|
+
|
7
39
|
## [0.12.0.rc1] - 2018-04-11
|
8
40
|
|
9
41
|
Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0.rc1
|
@@ -253,8 +285,9 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
|
|
253
285
|
|
254
286
|
Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
|
255
287
|
|
256
|
-
[Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.
|
257
|
-
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0
|
288
|
+
[Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...master
|
289
|
+
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...0.13-dev
|
290
|
+
[0.12.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0
|
258
291
|
[0.12.0.rc1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1
|
259
292
|
[0.12.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta1...v0.12.0.beta2
|
260
293
|
[0.12.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.2...v0.12.0.beta1
|
data/docs/GettingStarted.md
CHANGED
@@ -885,68 +885,144 @@ span.context.sampling_priority = Datadog::Ext::Priority::USER_KEEP
|
|
885
885
|
|
886
886
|
### Distributed Tracing
|
887
887
|
|
888
|
-
|
888
|
+
Distributed tracing allows traces to be propagated across multiple instrumented applications, so that a request can be presented as a single trace, rather than a separate trace per service.
|
889
889
|
|
890
|
-
|
891
|
-
def request_on_secondary_host(parent_trace_id, parent_span_id)
|
892
|
-
tracer.trace('web.request') do |span|
|
893
|
-
span.parent_id = parent_span_id
|
894
|
-
span.trace_id = parent_trace_id
|
890
|
+
To trace requests across application boundaries, the following must be propagated between each application:
|
895
891
|
|
896
|
-
|
897
|
-
|
898
|
-
|
892
|
+
| Property | Type | Description |
|
893
|
+
| --------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
|
894
|
+
| **Trace ID** | Integer | ID of the trace. This value should be the same across all requests that belong to the same trace. |
|
895
|
+
| **Parent Span ID** | Integer | ID of the span in the service originating the request. This value will always be different for each request within a trace. |
|
896
|
+
| **Sampling Priority** | Integer | Sampling priority level for the trace. This value should be the same across all requests that belong to the same trace. |
|
897
|
+
|
898
|
+
Such propagation can be visualized as:
|
899
|
+
|
900
|
+
```
|
901
|
+
Service A:
|
902
|
+
Trace ID: 100000000000000001
|
903
|
+
Parent ID: 0
|
904
|
+
Span ID: 100000000000000123
|
905
|
+
Priority: 1
|
906
|
+
|
907
|
+
|
|
908
|
+
| Service B Request:
|
909
|
+
| Metadata:
|
910
|
+
| Trace ID: 100000000000000001
|
911
|
+
| Parent ID: 100000000000000123
|
912
|
+
| Priority: 1
|
913
|
+
|
|
914
|
+
V
|
915
|
+
|
916
|
+
Service B:
|
917
|
+
Trace ID: 100000000000000001
|
918
|
+
Parent ID: 100000000000000123
|
919
|
+
Span ID: 100000000000000456
|
920
|
+
Priority: 1
|
921
|
+
|
922
|
+
|
|
923
|
+
| Service C Request:
|
924
|
+
| Metadata:
|
925
|
+
| Trace ID: 100000000000000001
|
926
|
+
| Parent ID: 100000000000000456
|
927
|
+
| Priority: 1
|
928
|
+
|
|
929
|
+
V
|
930
|
+
|
931
|
+
Service C:
|
932
|
+
Trace ID: 100000000000000001
|
933
|
+
Parent ID: 100000000000000456
|
934
|
+
Span ID: 100000000000000789
|
935
|
+
Priority: 1
|
899
936
|
```
|
900
937
|
|
901
|
-
|
938
|
+
**Via HTTP**
|
902
939
|
|
903
|
-
|
940
|
+
For HTTP requests between instrumented applications, this trace metadata is propagated by use of HTTP Request headers:
|
904
941
|
|
905
|
-
|
942
|
+
| Property | Type | HTTP Header name |
|
943
|
+
| --------------------- | ------- | ----------------------------- |
|
944
|
+
| **Trace ID** | Integer | `x-datadog-trace-id` |
|
945
|
+
| **Parent Span ID** | Integer | `x-datadog-parent-id` |
|
946
|
+
| **Sampling Priority** | Integer | `x-datadog-sampling-priority` |
|
906
947
|
|
907
|
-
|
908
|
-
require 'net/http'
|
909
|
-
require 'ddtrace'
|
948
|
+
Such that:
|
910
949
|
|
911
|
-
|
950
|
+
```
|
951
|
+
Service A:
|
952
|
+
Trace ID: 100000000000000001
|
953
|
+
Parent ID: 0
|
954
|
+
Span ID: 100000000000000123
|
955
|
+
Priority: 1
|
956
|
+
|
957
|
+
|
|
958
|
+
| Service B HTTP Request:
|
959
|
+
| Headers:
|
960
|
+
| x-datadog-trace-id: 100000000000000001
|
961
|
+
| x-datadog-parent-id: 100000000000000123
|
962
|
+
| x-datadog-sampling-priority: 1
|
963
|
+
|
|
964
|
+
V
|
965
|
+
|
966
|
+
Service B:
|
967
|
+
Trace ID: 100000000000000001
|
968
|
+
Parent ID: 100000000000000123
|
969
|
+
Span ID: 100000000000000456
|
970
|
+
Priority: 1
|
971
|
+
|
972
|
+
|
|
973
|
+
| Service B HTTP Request:
|
974
|
+
| Headers:
|
975
|
+
| x-datadog-trace-id: 100000000000000001
|
976
|
+
| x-datadog-parent-id: 100000000000000456
|
977
|
+
| x-datadog-sampling-priority: 1
|
978
|
+
|
|
979
|
+
V
|
980
|
+
|
981
|
+
Service C:
|
982
|
+
Trace ID: 100000000000000001
|
983
|
+
Parent ID: 100000000000000456
|
984
|
+
Span ID: 100000000000000789
|
985
|
+
Priority: 1
|
986
|
+
```
|
912
987
|
|
913
|
-
|
914
|
-
req = Net::HTTP::Get.new(uri)
|
915
|
-
req['x-datadog-trace-id'] = span.trace_id.to_s
|
916
|
-
req['x-datadog-parent-id'] = span.span_id.to_s
|
988
|
+
**Activating distributed tracing for integrations**
|
917
989
|
|
918
|
-
|
919
|
-
http.request(req)
|
920
|
-
end
|
990
|
+
Many integrations included in `ddtrace` support distributed tracing. Distributed tracing is disabled by default, but can be activated via configuration settings.
|
921
991
|
|
922
|
-
|
923
|
-
|
924
|
-
|
992
|
+
- If your application receives requests from services with distributed tracing activated, you must activate distributed tracing on the integrations that handle these requests (e.g. Rails)
|
993
|
+
- If your application send requests to services with distributed tracing activated, you must activate distributed tracing on the integrations that send these requests (e.g. Faraday)
|
994
|
+
- If your application both sends and receives requests implementing distributed tracing, it must activate all integrations which handle these requests.
|
925
995
|
|
926
|
-
|
996
|
+
For more details on how to activate distributed tracing for integrations, see their documentation:
|
927
997
|
|
928
|
-
|
929
|
-
|
930
|
-
|
998
|
+
- [Faraday](#faraday)
|
999
|
+
- [Net/HTTP](#nethttp)
|
1000
|
+
- [Rack](#rack)
|
1001
|
+
- [Rails](#rails)
|
1002
|
+
- [Sinatra](#sinatra)
|
931
1003
|
|
932
|
-
|
933
|
-
parent_trace_id = request.env['HTTP_X_DATADOG_TRACE_ID']
|
934
|
-
parent_span_id = request.env['HTTP_X_DATADOG_PARENT_ID']
|
1004
|
+
**Using the HTTP propagator**
|
935
1005
|
|
936
|
-
|
937
|
-
if parent_trace_id && parent_span_id
|
938
|
-
span.trace_id = parent_trace_id.to_i
|
939
|
-
span.parent_id = parent_span_id.to_i
|
940
|
-
end
|
1006
|
+
To make the process of propagating this metadata easier, you can use the `Datadog::HTTPPropagator` module.
|
941
1007
|
|
942
|
-
|
943
|
-
|
1008
|
+
On the client:
|
1009
|
+
|
1010
|
+
```ruby
|
1011
|
+
Datadog.tracer.trace('web.call') do |span|
|
1012
|
+
# Inject span context into headers (`env` must be a Hash)
|
1013
|
+
Datadog::HTTPPropagator.inject!(span.context, env)
|
944
1014
|
end
|
945
1015
|
```
|
946
1016
|
|
947
|
-
|
1017
|
+
On the server:
|
948
1018
|
|
949
|
-
|
1019
|
+
```ruby
|
1020
|
+
Datadog.tracer.trace('web.work') do |span|
|
1021
|
+
# Build a context from headers (`env` must be a Hash)
|
1022
|
+
context = HTTPPropagator.extract(request.env)
|
1023
|
+
Datadog.tracer.provider.context = context if context.trace_id
|
1024
|
+
end
|
1025
|
+
```
|
950
1026
|
|
951
1027
|
### Processing Pipeline
|
952
1028
|
|
data/lib/ddtrace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddtrace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.0
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -352,9 +352,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
352
352
|
version: 1.9.1
|
353
353
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
354
354
|
requirements:
|
355
|
-
- - "
|
355
|
+
- - ">="
|
356
356
|
- !ruby/object:Gem::Version
|
357
|
-
version:
|
357
|
+
version: '0'
|
358
358
|
requirements: []
|
359
359
|
rubyforge_project:
|
360
360
|
rubygems_version: 2.6.14
|