Skip to content

Commit d7d69ad

Browse files
authored
docs: update README with API documentation and minor text improvements (#102)
1 parent 6f37814 commit d7d69ad

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
This package goal is to make the experience of configuring and working with OpenTelemetry easier.
44

55
## [Manual for easy local grafana deployment](./localManual.md)
6+
7+
## API documentation
8+
Check the autogenerated documentation [here](https://mapcolonies.github.io/telemetry/).
9+
610
## example
711
Below are short examples for tracing and metrics. More examples are available at the [examples folder](examples/), and the various opentelemetry repos.
812
### Tracing
@@ -29,7 +33,7 @@ span.end();
2933
tracing.stop().then(() => console.log('done'));
3034
```
3135

32-
Another way for initialize tracing with custom resource:
36+
Another way to initialize tracing with custom resource:
3337

3438
```typescript
3539
import { Tracing } from '@map-colonies/telemetry';
@@ -59,8 +63,8 @@ metrics.stop().then(() => console.log('done'));
5963
```
6064

6165
## Metrics middleware
62-
The package provides a middleware for express that will automatically measure the duration of each request and the number of requests.
63-
In addition the middleware can be configured to collect NodeJS metrics.
66+
The package provides a middleware for Express that will automatically measure the duration of each request and the number of requests.
67+
In addition, the middleware can be configured to collect NodeJS metrics.
6468

6569
```typescript
6670
import { collectMetricsExpressMiddleware } from '@map-colonies/telemetry/prom-metrics';
@@ -92,17 +96,18 @@ Based on the [official OpenTelemetry conventions](https://opentelemetry.io/docs/
9296
### Common configuration
9397
| name |allowed value| default value | description
9498
|---|---|---|---|
95-
|TELEMETRY_SERVICE_NAME|string|from package.json| The service name
96-
|TELEMETRY_SERVICE_VERSION|string| from package.json| The service version
97-
|TELEMETRY_HOST_NAME|string|`os.hostname()`|The host name
99+
|TELEMETRY_SERVICE_NAME|string|package.json name| The name of the service to put as attribute
100+
|TELEMETRY_SERVICE_VERSION|string|package.json version| The version of the service to put as attribute
101+
|TELEMETRY_HOST_NAME|string|`os.hostname()`|The value of the hostname attribute to use, will override the hostname
98102
<br/>
99103

100104
### Tracing configuration
101105
| name |allowed value| default value | description
102106
|---|---|---|---|
103107
|TELEMETRY_TRACING_ENABLED|'true', 'false'|'false'|Should Tracing be enabled
104108
|TELEMETRY_TRACING_URL<span style="color:red">*</span>|string|http://localhost:4318/v1/traces|The URL to the OpenTelemetry Collector
105-
|TELEMETRY_TRACING_RATIO|float|1|The amount of traces to sample
109+
|TELEMETRY_TRACING_RATIO|float|1|The amount of traces to sample (0-1)
110+
|TELEMETRY_TRACING_DEBUG|'true', 'false'|'false'|Enable debug mode for tracing which enables opentelemetry debug log and console trace export
106111

107112
<span style="color:red">*</span> required (only when tracing is enabled).
108113
<br/>
@@ -111,7 +116,7 @@ Based on the [official OpenTelemetry conventions](https://opentelemetry.io/docs/
111116
|---|---|---|---|
112117
|TELEMETRY_METRICS_ENABLED|'true', 'false'|'false'|Should Metrics be enabled|
113118
|TELEMETRY_METRICS_URL<span style="color:red">*</span>|string|http://localhost:4318/v1/metrics|The URL to the OpenTelemetry Collector
114-
|TELEMETRY_METRICS_INTERVAL|number|15000|The interval in miliseconds between sending data to the collector
119+
|TELEMETRY_METRICS_INTERVAL|number|15000|The interval in milliseconds between sending data to the collector
115120

116121
<span style="color:red">*</span> required (only when metrics is enabled).
117122

0 commit comments

Comments
 (0)