@vercel/otel 0.0.1 → 0.0.2

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.
@@ -0,0 +1,2 @@
1
+ export declare const registerOTel: (serviceName: string) => void;
2
+ //# sourceMappingURL=index.edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.edge.d.ts","sourceRoot":"","sources":["../src/index.edge.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,gBAAiB,MAAM,SAG/C,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerOTel = void 0;
4
+ const registerOTel = (serviceName) => {
5
+ void serviceName;
6
+ // We don't support OpenTelemetry on edge.
7
+ };
8
+ exports.registerOTel = registerOTel;
9
+ //# sourceMappingURL=index.edge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.edge.js","sourceRoot":"","sources":["../src/index.edge.ts"],"names":[],"mappings":";;;AAAO,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAClD,KAAK,WAAW,CAAC;IACjB,0CAA0C;AAC5C,CAAC,CAAC;AAHW,QAAA,YAAY,gBAGvB"}
@@ -0,0 +1,4 @@
1
+ export * from "@opentelemetry/api";
2
+ import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
3
+ export declare const registerOTel: (serviceName: string) => NodeTracerProvider;
4
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAInC,OAAO,EACL,kBAAkB,EAEnB,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,YAAY,gBAAiB,MAAM,uBAY/C,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.registerOTel = void 0;
18
+ __exportStar(require("@opentelemetry/api"), exports);
19
+ const resources_1 = require("@opentelemetry/resources");
20
+ const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
21
+ const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
22
+ const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-http");
23
+ const registerOTel = (serviceName) => {
24
+ const provider = new sdk_trace_node_1.NodeTracerProvider({
25
+ resource: new resources_1.Resource({
26
+ [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: serviceName,
27
+ }),
28
+ });
29
+ provider.register();
30
+ provider.addSpanProcessor(new sdk_trace_node_1.SimpleSpanProcessor(new exporter_trace_otlp_http_1.OTLPTraceExporter({})));
31
+ return provider;
32
+ };
33
+ exports.registerOTel = registerOTel;
34
+ //# sourceMappingURL=index.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.js","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAmC;AAEnC,wDAAoD;AACpD,8EAAiF;AACjF,kEAGuC;AAEvC,sFAA4E;AAErE,MAAM,YAAY,GAAG,CAAC,WAAmB,EAAE,EAAE;IAClD,MAAM,QAAQ,GAAG,IAAI,mCAAkB,CAAC;QACtC,QAAQ,EAAE,IAAI,oBAAQ,CAAC;YACrB,CAAC,iDAA0B,CAAC,YAAY,CAAC,EAAE,WAAW;SACvD,CAAC;KACH,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAEpB,QAAQ,CAAC,gBAAgB,CAAC,IAAI,oCAAmB,CAAC,IAAI,4CAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAZW,QAAA,YAAY,gBAYvB"}
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@vercel/otel",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Vercel wrapper around OpenTelemetry APIs",
5
5
  "types": "./dist/index.node.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
6
9
  "exports": {
7
10
  ".": {
8
11
  "edge": {
@@ -1,33 +0,0 @@
1
- name: Tests
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- tags:
8
- - "!*"
9
- pull_request:
10
-
11
- env:
12
- NODE_VERSION: "16"
13
- TURBO_REMOTE_ONLY: "true"
14
- TURBO_TEAM: "vercel"
15
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
16
-
17
- concurrency:
18
- group: ${{ github.workflow }}-${{ github.ref }}
19
- cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
20
-
21
- jobs:
22
- build:
23
- runs-on: ubuntu-latest
24
- steps:
25
- - uses: actions/checkout@v3
26
- with:
27
- fetch-depth: 2
28
- - uses: actions/setup-node@v3
29
- with:
30
- node-version: ${{ env.NODE_VERSION }}
31
- - run: npm i -g pnpm@7.24.2
32
- - run: pnpm install
33
- - run: pnpm build
package/src/index.edge.ts DELETED
@@ -1,4 +0,0 @@
1
- export const registerOTel = (serviceName: string) => {
2
- void serviceName;
3
- // We don't support OpenTelemetry on edge.
4
- };
package/src/index.node.ts DELETED
@@ -1,24 +0,0 @@
1
- export * from "@opentelemetry/api";
2
-
3
- import { Resource } from "@opentelemetry/resources";
4
- import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
5
- import {
6
- NodeTracerProvider,
7
- SimpleSpanProcessor,
8
- } from "@opentelemetry/sdk-trace-node";
9
-
10
- import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
11
-
12
- export const registerOTel = (serviceName: string) => {
13
- const provider = new NodeTracerProvider({
14
- resource: new Resource({
15
- [SemanticResourceAttributes.SERVICE_NAME]: serviceName,
16
- }),
17
- });
18
-
19
- provider.register();
20
-
21
- provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter({})));
22
-
23
- return provider;
24
- };
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "lib": ["ES2020", "dom"]
5
- },
6
- "files": ["./src/index.edge.ts"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "lib": ["ES2020", "dom"]
5
- },
6
- "files": ["./src/index.edge.ts"]
7
- }
package/tsconfig.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "declaration": true,
4
- "declarationMap": true,
5
- "esModuleInterop": true,
6
- "lib": ["ES2020"],
7
- "module": "commonjs",
8
- "moduleResolution": "node",
9
- "noEmitOnError": true,
10
- "noFallthroughCasesInSwitch": true,
11
- "noImplicitReturns": true,
12
- "noUnusedLocals": true,
13
- "noUnusedParameters": true,
14
- "outDir": "./dist",
15
- "types": ["node"],
16
- "strict": true,
17
- "sourceMap": true,
18
- "target": "ES2020"
19
- },
20
- "include": ["src/**/*"],
21
- "exclude": ["node_modules"]
22
- }
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- // There is a bug in OTEL that requires us to add dom types: https://github.com/open-telemetry/opentelemetry-js/issues/3580
5
- "lib": ["ES2020", "dom"]
6
- },
7
- "files": ["./src/index.node.ts"]
8
- }