|
1 | 1 | [](https://opensource.newrelic.com/oss-category/#new-relic-experimental) |
2 | | - |
3 | 2 |  |
4 | 3 |  |
5 | 4 |  |
6 | | - |
7 | 5 |  |
8 | 6 |  |
9 | 7 |  |
10 | 8 |  |
11 | | - |
12 | 9 |  |
13 | 10 |  |
14 | 11 |  |
15 | 12 |  |
16 | 13 |
|
17 | 14 | # Apigee Distributed Tracing |
| 15 | +This repository includes Apigee [Javascript Resources](src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/resources/jsc) for |
| 16 | +- Creating or propagating [W3C Trace Context](https://www.w3.org/TR/trace-context/) through [Apigee Flows](https://cloud.google.com/apigee/docs/api-platform/fundamentals/what-are-flows) and on to the Apigee Target |
| 17 | +- Reporting Flow Request/Response pairs as Spans to [New Relic's Trace API](https://docs.newrelic.com/docs/distributed-tracing/trace-api/introduction-trace-api/) |
| 18 | + |
| 19 | +The repository also includes [sample policies](src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/policies) to demonstrate how the pieces work together. |
| 20 | + |
| 21 | +**The documentation requires fluency with Apigee.** |
18 | 22 |
|
19 | | -## TO DO |
20 | | -- Who writes the `tracecontext` to the Pub/Sub message? |
21 | | - - What is the format? |
22 | | -- Does NR have a standard for `tracestate`? |
23 | 23 | ## Installation |
| 24 | +1. Copy the JavaScript resources into the `resources/jsc` folder |
| 25 | +2. Copy `newrelic-sample.properties` file to `resources/properties/newrelic.properties` |
| 26 | +3. Create a Request/Response Policy pair for each Flow step measured. At a minimum one pair is required to ensure that a Trace Context is present for a Target. |
| 27 | + - [Sample Request Policy](src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/policies/Trace-Context-Request.xml) |
| 28 | + - [Sample Response Policy](src/main/apigee/apiproxies/W3C-Trace-Context/apiproxy/policies/Trace-Context-Response.xml) |
| 29 | + |
24 | 30 | ## Configuration |
| 31 | +All Resource and Policy files include complete in-file documentation, see them for details |
| 32 | + |
| 33 | +### Javascript Resources |
| 34 | +Nothing required |
| 35 | + |
| 36 | +### Properties file |
| 37 | +- Edit the `newrelic.properties` file and add your New Relic License Key. |
| 38 | + |
| 39 | +### Proxy policies |
| 40 | +- **Proxy policies must be paired, one in a Request Flow and one in a Response Flow** |
25 | 41 | - [Flow execution sequence](https://docs.apigee.com/api-platform/fundamentals/what-are-flows#designingflowexecutionsequence) |
26 | 42 | - Start/End timestamps: [Apigee Flow Variables](https://cloud.google.com/apigee/docs/api-platform/reference/variables-reference) |
27 | | -### Proxy policies |
28 | | -- Proxy policies must be paired, one in a Request Flow and one in a Response Flow |
29 | | -- Request Policies use `<ResourceURL>jsc://Trace-Context-Request.js</ResourceURL>` |
30 | | -- |
31 | | -## Development |
32 | 43 |
|
| 44 | +## Development |
33 | 45 | ### Helpful links |
| 46 | +- [W3C Trace Context](https://www.w3.org/TR/trace-context/) |
34 | 47 | - [Apigee development with VSCode](https://cloud.google.com/apigee/docs/api-platform/local-development/vscode/get-started) |
35 | 48 | - [Apigee JavaScript object model](https://cloud.google.com/apigee/docs/api-platform/reference/javascript-object-model) |
36 | | - |
37 | | -## Testing |
| 49 | +- [Rhino features by release](https://mozilla.github.io/rhino/compat/engines.html) ([Apigee uses Rhino 1.7..7.1](https://cloud.google.com/apigee/docs/api-platform/reference/policies/javascript-policy#:~:text=Apigee%20supports%20JavaScript%20that%20runs,7.1.), it's fairly limited.) |
| 50 | +- [New Relic Trace API Payload](https://docs.newrelic.com/docs/distributed-tracing/trace-api/report-new-relic-format-traces-trace-api/#new-relic-guidelines) |
38 | 51 |
|
39 | 52 | ## Support |
40 | | - |
41 | 53 | New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub. |
42 | 54 |
|
43 | 55 | We encourage you to bring your experiences and questions to the [Explorers Hub](https://discuss.newrelic.com) where our community members collaborate on solutions and new ideas. |
44 | 56 |
|
45 | 57 | ## Contributing |
46 | | - |
47 | 58 | We encourage your contributions to improve Apigee Distributed Tracing! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected]. |
48 | 59 |
|
49 | | -**A note about vulnerabilities** |
50 | | - |
| 60 | +## A note about vulnerabilities |
51 | 61 | As noted in our [security policy](../../security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals. |
52 | 62 |
|
53 | 63 | If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic). |
54 | 64 |
|
55 | 65 | ## License |
56 | | - |
57 | 66 | Apigee Distributed Tracing is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License. |
0 commit comments