Skip to content

Commit d09149b

Browse files
authored
Merge pull request #558 from JamieDanielson/jamie.update-sdk-node-install
docs: update package for sdk-node install (516)
2 parents e4fdb76 + 7473124 commit d09149b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/docs/getting-started/js-sdk/trace-manual-instr.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The diagram below shows the data path for exporting traces from an application i
3030

3131
[Node.js v10 (or later)](https://nodejs.org/en/download/) is required to run an application using OpenTelemetry.
3232

33-
Note: You’ll also need to have the ADOT Collector running to export traces to AWS X-Ray. See the ADOT Collector
33+
Note: You’ll also need to have the ADOT Collector running to export traces to AWS X-Ray. See the ADOT Collector
3434
[documentation](https://aws-otel.github.io/docs/getting-started/collector) for setup instructions.
3535

3636
<SectionSeparator />
@@ -42,7 +42,7 @@ In order to trace your application, the following OpenTelemetry JavaScript packa
4242
```bash
4343
npm install --save \
4444
@opentelemetry/api \
45-
opentelemetry/sdk-node \
45+
@opentelemetry/sdk-node \
4646
@opentelemetry/exporter-trace-otlp-grpc
4747
```
4848

@@ -97,9 +97,9 @@ async function nodeSDKBuilder() {
9797
traceExporter: _traceExporter,
9898
});
9999
sdk.configureTracerProvider(_tracerConfig, _spanProcessor);
100-
100+
101101
// this enables the API to record telemetry
102-
await sdk.start();
102+
await sdk.start();
103103
// gracefully shut down the SDK on process exit
104104
process.on('SIGTERM', () => {
105105
sdk.shutdown()
@@ -167,9 +167,9 @@ async function nodeSDKBuilder() {
167167
traceExporter: _traceExporter,
168168
});
169169
sdk.configureTracerProvider(_tracerConfig, _spanProcessor);
170-
170+
171171
// this enables the API to record telemetry
172-
await sdk.start();
172+
await sdk.start();
173173
// gracefully shut down the SDK on process exit
174174
process.on('SIGTERM', () => {
175175
sdk.shutdown()
@@ -195,13 +195,13 @@ diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
195195

196196
**Warning: Some instrumentations are not yet stable and their configuration and the attributes they collect are subject to change until the instrumentation reaches 1.0 stability. It is recommended to pin a specific version of an instrumentation to avoid breaking changes.**
197197

198-
OpenTelemetry can collect tracing data from various applications automatically using plugins. The plugins offer instrumenting popular frameworks such as
199-
Hapi, Express, Redis, GraphQL, and many more. The full list of supported libraries and installation instructions can be found on the
198+
OpenTelemetry can collect tracing data from various applications automatically using plugins. The plugins offer instrumenting popular frameworks such as
199+
Hapi, Express, Redis, GraphQL, and many more. The full list of supported libraries and installation instructions can be found on the
200200
[OpenTelemetry JavaScript Contrib repo](https://github.com/open-telemetry/opentelemetry-js-contrib#node-instrumentations).
201201

202202
### Instrumenting the AWS SDK
203203

204-
Tracing support for downstream AWS SDK calls to Amazon DynamoDB, S3, and others is provided by the
204+
Tracing support for downstream AWS SDK calls to Amazon DynamoDB, S3, and others is provided by the
205205
[OpenTelemetry AWS SDK Instrumentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-sdk).
206206

207207
Install the following dependency with npm:
@@ -233,11 +233,11 @@ const sdk = new opentelemetry.NodeSDK({
233233

234234
### Creating Custom Spans
235235

236-
You can use custom spans to monitor the performance of internal activities that are not captured by instrumentation libraries.
237-
Note that only spans of kind `Server` are converted into X-Ray segments, all other spans are converted into X-Ray subsegments.
236+
You can use custom spans to monitor the performance of internal activities that are not captured by instrumentation libraries.
237+
Note that only spans of kind `Server` are converted into X-Ray segments, all other spans are converted into X-Ray subsegments.
238238
For more on segments and subsegments, see the [AWS X-Ray developer guide](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-segments).
239239

240-
```javascript
240+
```javascript
241241
const { SpanKind } = require("@opentelemetry/api")
242242

243243
const serverSpan = tracer.startActiveSpan('server', { kind: SpanKind.SERVER }); // This span will appear as a segment in X-Ray
@@ -249,8 +249,8 @@ serverSpan.end();
249249

250250
### Adding Custom Attributes
251251

252-
You can also add custom key-value pairs as attributes onto your spans. Attributes are converted to metadata by default.
253-
If you [configure your collector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/7bf2266a025425993a233f66c77a0810ab11a78b/exporter/awsxrayexporter#exporter-configuration), you can convert some or all of the attributes to annotations.
252+
You can also add custom key-value pairs as attributes onto your spans. Attributes are converted to metadata by default.
253+
If you [configure your collector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/7bf2266a025425993a233f66c77a0810ab11a78b/exporter/awsxrayexporter#exporter-configuration), you can convert some or all of the attributes to annotations.
254254
To read more about X-Ray annotations and metadata see the [AWS X-Ray Developer Guide](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-annotations).
255255

256256
```javascript
@@ -264,6 +264,6 @@ Similarly to Traces, you can create custom metrics in your application using the
264264
Refer to <Link to="/docs/getting-started/js-sdk/metric-manual-instr">Metric-Manual-Instrumentation</Link> for introduction to metric creation using OpenTelemetry JavaScript SDK.
265265

266266

267-
## Sample Application
267+
## Sample Application
268268

269269
See the [AWS Distro for OpenTelemetry Sample Code with JavaScript SDK](https://github.com/aws-observability/aws-otel-community/tree/master/sample-apps/javascript-sample-app) for instructions on setting up and using the sample app.

0 commit comments

Comments
 (0)