@vercel/otel 0.0.15 → 0.0.17
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/README.md +3 -18
- package/dist/index.node.d.ts +0 -1
- package/dist/index.node.js +1 -2
- package/dist/index.node.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
PROMPT for GPT-4:
|
|
3
|
-
Write me a README.md for package vercel/otel that helps people get started by setting up their exporter and trace provider for them and false bundles all OPen Telemetry apis in a single package.
|
|
4
|
-
It's not a powerful as using raw APIS, but It should be enough for most cases.
|
|
5
|
-
|
|
6
|
-
This package exports function `register()` that registers open telemetry provider with a HTTP exporter.
|
|
7
|
-
Register function takes one argument, it's string and it's a service name. It will be used as the app name in many OpenTelemetry backends.
|
|
8
|
-
This package also reexports `@opentelemetry/api` and `@opentelemetry/semantics`.
|
|
9
|
-
|
|
10
|
-
Use that hip style for Readme that many JS devs use. Keep it concise.
|
|
11
|
-
-->
|
|
12
|
-
|
|
13
1
|
# 🚀 Vercel Otel
|
|
14
2
|
|
|
15
3
|
[](https://www.npmjs.com/package/@vercel/otel)
|
|
16
4
|
|
|
17
5
|
> **Note:** This package is experimental. Updates can contain breaking changes.
|
|
18
6
|
|
|
19
|
-
`vercel/otel` is a simple and easy-to-use package that sets up your trace provider and exporter
|
|
7
|
+
`vercel/otel` is a simple and easy-to-use package that sets up your trace provider and exporter.
|
|
20
8
|
|
|
21
9
|
💡 Use this package to quickly instrument your applications and get started with OpenTelemetry!
|
|
22
10
|
|
|
@@ -29,7 +17,8 @@ npm install vercel/otel
|
|
|
29
17
|
## 📚 Usage
|
|
30
18
|
|
|
31
19
|
```javascript
|
|
32
|
-
|
|
20
|
+
import { registerOTel } from "vercel/otel";
|
|
21
|
+
import { trace } from "@opentelemetry/api";
|
|
33
22
|
|
|
34
23
|
// Register the OpenTelemetry provider with an HTTP exporter
|
|
35
24
|
registerOTel("your-service-name");
|
|
@@ -47,10 +36,6 @@ This is all that is needed to trace your app on Vercel.
|
|
|
47
36
|
|
|
48
37
|
- `serviceName`: The name of your service, used as the app name in many OpenTelemetry backends.
|
|
49
38
|
|
|
50
|
-
### Re-exported APIs
|
|
51
|
-
|
|
52
|
-
This package re-exports everything from `@opentelemetry/api`. Refer to the official [OpenTelemetry API documentation](https://opentelemetry.io/docs/instrumentation/js/) for details on how to use these APIs.
|
|
53
|
-
|
|
54
39
|
## 📄 License
|
|
55
40
|
|
|
56
41
|
[MIT](LICENSE)
|
package/dist/index.node.d.ts
CHANGED
package/dist/index.node.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from "@opentelemetry/api";
|
|
2
1
|
import { Resource } from "@opentelemetry/resources";
|
|
3
2
|
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
|
|
4
3
|
import { NodeTracerProvider, SimpleSpanProcessor, } from "@opentelemetry/sdk-trace-node";
|
|
5
|
-
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-
|
|
4
|
+
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
6
5
|
export const registerOTel = (serviceName) => {
|
|
7
6
|
const provider = new NodeTracerProvider({
|
|
8
7
|
resource: new Resource({
|
package/dist/index.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAClD,MAAM,QAAQ,GAAG,IAAI,kBAAkB,CAAC;QACtC,QAAQ,EAAE,IAAI,QAAQ,CAAC;YACrB,CAAC,0BAA0B,CAAC,YAAY,CAAC,EAAE,WAAW;SACvD,CAAC;KACH,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAEpB,QAAQ,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/otel",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Vercel wrapper around OpenTelemetry APIs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"typescript": "^4.8.4"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@opentelemetry/
|
|
54
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.36.1",
|
|
53
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.36.1",
|
|
55
54
|
"@opentelemetry/resources": "^1.10.1",
|
|
56
55
|
"@opentelemetry/sdk-trace-base": "^1.10.1",
|
|
57
56
|
"@opentelemetry/sdk-trace-node": "^1.10.1",
|
|
58
|
-
"@opentelemetry/semantic-conventions": "^1.10.1"
|
|
57
|
+
"@opentelemetry/semantic-conventions": "^1.10.1",
|
|
58
|
+
"@opentelemetry/api": "^1.1.0"
|
|
59
59
|
},
|
|
60
60
|
"packageManager": "pnpm@7.24.0",
|
|
61
61
|
"engines": {
|