@orion-js/telemetry 4.0.0-alpha.3 → 4.0.0-next.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.
- package/dist/index.cjs +35 -74063
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +7 -9
- package/dist/index.js +19 -74029
- package/dist/index.js.map +1 -0
- package/package.json +12 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {getNodeAutoInstrumentations} from '@opentelemetry/auto-instrumentations-node'\nimport {NodeSDK, NodeSDKConfiguration} from '@opentelemetry/sdk-node'\nconst {PrometheusExporter} = require('@opentelemetry/exporter-prometheus')\nconst {HostMetrics} = require('@opentelemetry/host-metrics')\n\nfunction setupTelemetry({\n nodeSDKConfig,\n metrics,\n}: {\n nodeSDKConfig?: Partial<NodeSDKConfiguration>\n metrics?: {\n disable?: boolean\n port?: number\n }\n}) {\n const metricReader = metrics?.disable\n ? undefined\n : new PrometheusExporter({port: metrics?.port || 9465})\n const sdk = new NodeSDK({\n instrumentations: [\n getNodeAutoInstrumentations({\n '@opentelemetry/instrumentation-graphql': {\n ignoreResolveSpans: true,\n },\n }),\n ],\n metricReader,\n ...nodeSDKConfig,\n })\n\n if (metricReader) {\n const hostMetrics = new HostMetrics()\n hostMetrics.start()\n }\n\n sdk.start()\n}\n\nexport {setupTelemetry}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;wCAA0C;AAC1C,sBAA4C;AAC5C,IAAM,EAACA,mBAAkB,IAAIC,QAAQ,oCAAA;AACrC,IAAM,EAACC,YAAW,IAAID,QAAQ,6BAAA;AAE9B,SAASE,eAAe,EACtBC,eACAC,QAAO,GAOR;AACC,QAAMC,gBAAeD,mCAASE,WAC1BC,SACA,IAAIR,mBAAmB;IAACS,OAAMJ,mCAASI,SAAQ;EAAI,CAAA;AACvD,QAAMC,MAAM,IAAIC,wBAAQ;IACtBC,kBAAkB;UAChBC,+DAA4B;QAC1B,0CAA0C;UACxCC,oBAAoB;QACtB;MACF,CAAA;;IAEFR;IACA,GAAGF;EACL,CAAA;AAEA,MAAIE,cAAc;AAChB,UAAMS,cAAc,IAAIb,YAAAA;AACxBa,gBAAYC,MAAK;EACnB;AAEAN,MAAIM,MAAK;AACX;AA/BSb;","names":["PrometheusExporter","require","HostMetrics","setupTelemetry","nodeSDKConfig","metrics","metricReader","disable","undefined","port","sdk","NodeSDK","instrumentations","getNodeAutoInstrumentations","ignoreResolveSpans","hostMetrics","start"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeSDKConfiguration } from '@opentelemetry/sdk-node';
|
|
2
|
+
|
|
3
|
+
declare function setupTelemetry({ nodeSDKConfig, metrics, }: {
|
|
4
|
+
nodeSDKConfig?: Partial<NodeSDKConfiguration>;
|
|
5
|
+
metrics?: {
|
|
6
|
+
disable?: boolean;
|
|
7
|
+
port?: number;
|
|
8
|
+
};
|
|
9
|
+
}): void;
|
|
10
|
+
|
|
11
|
+
export { setupTelemetry };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
-
|
|
3
1
|
import { NodeSDKConfiguration } from '@opentelemetry/sdk-node';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
declare function setupTelemetry({ nodeSDKConfig, metrics, }: {
|
|
4
|
+
nodeSDKConfig?: Partial<NodeSDKConfiguration>;
|
|
5
|
+
metrics?: {
|
|
6
|
+
disable?: boolean;
|
|
7
|
+
port?: number;
|
|
8
|
+
};
|
|
11
9
|
}): void;
|
|
12
10
|
|
|
13
|
-
export {};
|
|
11
|
+
export { setupTelemetry };
|