@saidsef/tracing-node 7.0.0 → 7.0.1
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.
- package/CONTRIBUTING.md +7 -6
- package/README.md +6 -6
- package/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Please open an issue to discuss a change before you make it, or reach the owners of this repository by email or whatever other route you prefer. Agreeing the shape of a change first saves rework on both sides.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This project has a code of conduct. It applies to every interaction with the project, so please follow it.
|
|
6
6
|
|
|
7
7
|
## Pull Request Process
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
12
|
-
4.
|
|
9
|
+
1. Run `npm run lint` and `npm test` locally. Both need to pass before you open the pull request.
|
|
10
|
+
2. Bump the version in `package.json`, with the increment matching the scope of your change. Run `npm run rebuild` where you have changed a dependency, which refreshes `package-lock.json`.
|
|
11
|
+
3. Describe the change in the commit message. Name any new environment variable, option or file path that a user of the library will need to know about.
|
|
12
|
+
4. The `Release` workflow reads the version from `package.json`, tags `v<version>`, publishes the GitHub release and pushes the package to npm. You do not need to create a tag yourself.
|
|
13
|
+
5. A member of the project team signs the pull request off before it merges. Ask a reviewer to merge it for you where you do not have permission to do it yourself.
|
|
13
14
|
|
|
14
15
|
## Code of Conduct
|
|
15
16
|
|
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
**Traces, metrics and logs from one function call.** Add two lines to a service
|
|
11
|
+
**Traces, metrics and logs from one function call.** Add two lines to a service and everything it does arrives at your collector: its requests, its calls to Redis, Elasticsearch and AWS, its runtime counters, its Pino log records. All of it correlated by trace id and stitched into a service graph.
|
|
12
12
|
|
|
13
|
-
`@saidsef/tracing-node` wraps the OpenTelemetry Node SDK. One call to `setupTracing` builds the tracer, meter and logger providers, registers them globally, and turns on a fixed set of instrumentations
|
|
13
|
+
`@saidsef/tracing-node` wraps the OpenTelemetry Node SDK. One call to `setupTracing` builds the tracer, meter and logger providers, registers them globally, and turns on a fixed set of instrumentations. An application gets all three signals without assembling exporters, span processors, resource detectors and instrumentation packages itself. A second call logs a warning and returns the tracer that already exists, which makes initialisation idempotent.
|
|
14
14
|
|
|
15
15
|
Full documentation: [tracing-node.readthedocs.io](https://tracing-node.readthedocs.io/).
|
|
16
16
|
|
|
@@ -32,7 +32,7 @@ Elasticsearch spans carrying the query, the operation and the index name need an
|
|
|
32
32
|
npm install opentelemetry-instrumentation-elasticsearch --save
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
That package pins `@opentelemetry/core` to the 1.x line, so installing it brings [GHSA-8988-4f7v-96qf](https://github.com/advisories/GHSA-8988-4f7v-96qf) into the dependency tree.
|
|
35
|
+
That package pins `@opentelemetry/core` to the 1.x line, so installing it brings [GHSA-8988-4f7v-96qf](https://github.com/advisories/GHSA-8988-4f7v-96qf) into the dependency tree. Leave it out and an Elasticsearch call is still traced as an HTTP client span, still on the service graph. See [Instrumentation](https://tracing-node.readthedocs.io/en/latest/instrumentation/) for what each option records.
|
|
36
36
|
|
|
37
37
|
## Usage
|
|
38
38
|
|
|
@@ -49,11 +49,11 @@ node --import ./instrument.mjs ./app.mjs
|
|
|
49
49
|
|
|
50
50
|
`serviceName` and `url` are required, and both fall back to the `SERVICE_NAME` and `ENDPOINT` environment variables.
|
|
51
51
|
|
|
52
|
-
`setupTracing` has to run before the application imports the libraries being traced,
|
|
52
|
+
`setupTracing` has to run before the application imports the libraries being traced, and the `--import` preload guarantees it. The library registers the `import-in-the-middle` loader hook on import, which covers ES modules and CommonJS modules alike. Importing an instrumented package statically in the same file as the library loads it too early to patch, so reach for the preload. [Initialisation order](https://tracing-node.readthedocs.io/en/latest/usage/#initialisation-order) covers the alternatives.
|
|
53
53
|
|
|
54
54
|
## Collector and backend
|
|
55
55
|
|
|
56
|
-
The exporter speaks OTLP over gRPC,
|
|
56
|
+
The exporter speaks OTLP over gRPC, which any OpenTelemetry-compatible collector accepts for all three signals. Point `url` at yours.
|
|
57
57
|
|
|
58
58
|
[**grafana-loki-on-k8s**](https://github.com/saidsef/grafana-loki-on-k8s) is the companion stack, and the one the end to end harness in [`test/e2e/`](./test/e2e) targets. It deploys Grafana, Prometheus, Mimir, Loki, Tempo, Pyroscope, Alloy and Beyla to Kubernetes as small composable manifests.
|
|
59
59
|
|
|
@@ -62,7 +62,7 @@ git clone https://github.com/saidsef/grafana-loki-on-k8s
|
|
|
62
62
|
kubectl apply -k grafana-loki-on-k8s/deployment
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
Traces sent to its Alloy OTLP receiver on port 4317 land in Tempo, log records in Loki and metrics in Mimir. Tempo's metrics generator turns the spans into RED and service graph metrics
|
|
65
|
+
Traces sent to its Alloy OTLP receiver on port 4317 land in Tempo, log records in Loki and metrics in Mimir. Tempo's metrics generator turns the spans into RED and service graph metrics. Feeding those is why this library sets the `peer.service` attribute.
|
|
66
66
|
|
|
67
67
|
## Documentation
|
|
68
68
|
|