Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit f08842a

Browse files
authored
Merge pull request #2 from crshanks/crshanks-fix-request-traceparent
Fix request traceparent id
2 parents 1fc4993 + 255437e commit f08842a

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
## [0.9.1] - 2023-03-16
8+
9+
A minor release to make the traceparent header compliant with the W3C version 00 standard.
10+
11+
### Added
12+
13+
### Changed
14+
15+
### Fixed
16+
17+
Fixes issue [#1](https://github.com/newrelic-experimental/apigee-distributed-tracing/issues/1).
18+
19+
Increase length of parent-id component of the W3C traceparent header to 16 characters, to comply with the [W3C standard](https://www.w3.org/TR/trace-context/#parent-id) for version 00.
20+
21+
Comment out reference to pub/sub message policy that is no longer present in the repo. This allows the sample code to work with minimal configuration.
22+

src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/proxies/default.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<Step>
55
<Name>Trace-Context-Request</Name>
66
</Step>
7-
<Step>
7+
<!-- <Step>
88
<Name>Add-Trace-Context-To-Pub-Sub-Message</Name>
9-
</Step>
9+
</Step> -->
1010
</Request>
1111
</PreFlow>
1212
<PostFlow name="PostFlow">

src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/resources/jsc/Trace-Context-Request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ else {
155155
// Update parent-id: The value of property parent-id MUST be set to a value representing the ID of the current operation.
156156
// Update sampled: The value of sampled reflects the caller's recording behavior. The value of the sampled flag of trace-flags MAY be set to 1 if the trace data is likely to be recorded or to 0 otherwise. Setting the flag is no guarantee that the trace will be recorded but increases the likeliness of end-to-end recorded traces.
157157
requestParentID = parentID;
158-
parentID = generateValidID(8);
158+
parentID = generateValidID(16);
159159
traceFlags = generateSampled();
160160
} else {
161161
logMsg(logPrefix + 'Error: invalid traceFlags: ' + traceFlags);

src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/targets/default.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<Step>
55
<Name>Target-Trace-Context-Request</Name>
66
</Step>
7-
<Step>
7+
<!-- <Step>
88
<Name>Add-Trace-Context-To-Pub-Sub-Message</Name>
9-
</Step>
9+
</Step> -->
1010
</Request>
1111
</PreFlow>
1212
<PostFlow name="PostFlow">

0 commit comments

Comments
 (0)