Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/sdk-node

Package Overview
Dependencies
Maintainers
2
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/sdk-node - npm Package Compare versions

Comparing version 0.32.0 to 0.33.0

10

build/src/sdk.d.ts
import { ContextManager, TextMapPropagator } from '@opentelemetry/api';
import { Resource, ResourceDetectionConfig } from '@opentelemetry/resources';
import { Resource } from '@opentelemetry/resources';
import { MetricReader, View } from '@opentelemetry/sdk-metrics';

@@ -14,6 +14,3 @@ import { SpanProcessor } from '@opentelemetry/sdk-trace-base';

/**
* Lists the views that should be passed when meterProvider
*
* Note: This is only getting used when NodeSDK is responsible for
* instantiated an instance of MeterProvider
* List of {@link View}s that should be passed to the MeterProvider
*/

@@ -27,2 +24,3 @@ views?: View[];

private _resource;
private _resourceDetectors;
private _autoDetectResources;

@@ -41,3 +39,3 @@ private _tracerProvider?;

/** Detect resource attributes */
detectResources(config?: ResourceDetectionConfig): Promise<void>;
detectResources(): Promise<void>;
/** Manually add a resource */

@@ -44,0 +42,0 @@ addResource(resource: Resource): void;

13

build/src/sdk.js

@@ -31,6 +31,7 @@ "use strict";

constructor(configuration = {}) {
var _a, _b, _c;
var _a, _b, _c, _d;
this._resource = (_a = configuration.resource) !== null && _a !== void 0 ? _a : new resources_1.Resource({});
this._resourceDetectors = (_b = configuration.resourceDetectors) !== null && _b !== void 0 ? _b : [resources_1.envDetector, resources_1.processDetector];
this._serviceName = configuration.serviceName;
this._autoDetectResources = (_b = configuration.autoDetectResources) !== null && _b !== void 0 ? _b : true;
this._autoDetectResources = (_c = configuration.autoDetectResources) !== null && _c !== void 0 ? _c : true;
if (configuration.spanProcessor || configuration.traceExporter) {

@@ -44,3 +45,3 @@ const tracerProviderConfig = {};

}
const spanProcessor = (_c = configuration.spanProcessor) !== null && _c !== void 0 ? _c : new sdk_trace_base_1.BatchSpanProcessor(configuration.traceExporter);
const spanProcessor = (_d = configuration.spanProcessor) !== null && _d !== void 0 ? _d : new sdk_trace_base_1.BatchSpanProcessor(configuration.traceExporter);
this.configureTracerProvider(tracerProviderConfig, spanProcessor, configuration.contextManager, configuration.textMapPropagator);

@@ -98,4 +99,6 @@ }

/** Detect resource attributes */
async detectResources(config) {
const internalConfig = Object.assign({ detectors: [resources_1.envDetector, resources_1.processDetector] }, config);
async detectResources() {
const internalConfig = {
detectors: this._resourceDetectors,
};
this.addResource(await (0, resources_1.detectResources)(internalConfig));

@@ -102,0 +105,0 @@ }

import type { ContextManager, SpanAttributes } from '@opentelemetry/api';
import { TextMapPropagator } from '@opentelemetry/api';
import { InstrumentationOption } from '@opentelemetry/instrumentation';
import { Resource } from '@opentelemetry/resources';
import { Detector, Resource } from '@opentelemetry/resources';
import { MetricReader, View } from '@opentelemetry/sdk-metrics';

@@ -16,2 +16,3 @@ import { Sampler, SpanExporter, SpanLimits, SpanProcessor } from '@opentelemetry/sdk-trace-base';

resource: Resource;
resourceDetectors: Detector[];
sampler: Sampler;

@@ -18,0 +19,0 @@ serviceName?: string;

@@ -1,2 +0,2 @@

export declare const VERSION = "0.32.0";
export declare const VERSION = "0.33.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.32.0';
exports.VERSION = '0.33.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/sdk-node",
"version": "0.32.0",
"version": "0.33.0",
"description": "OpenTelemetry SDK for Node.js",

@@ -47,9 +47,9 @@ "main": "build/src/index.js",

"dependencies": {
"@opentelemetry/api-metrics": "0.32.0",
"@opentelemetry/core": "1.6.0",
"@opentelemetry/instrumentation": "0.32.0",
"@opentelemetry/resources": "1.6.0",
"@opentelemetry/sdk-metrics": "0.32.0",
"@opentelemetry/sdk-trace-base": "1.6.0",
"@opentelemetry/sdk-trace-node": "1.6.0"
"@opentelemetry/api-metrics": "0.33.0",
"@opentelemetry/core": "1.7.0",
"@opentelemetry/instrumentation": "0.33.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-metrics": "0.33.0",
"@opentelemetry/sdk-trace-base": "1.7.0",
"@opentelemetry/sdk-trace-node": "1.7.0"
},

@@ -61,4 +61,4 @@ "peerDependencies": {

"@opentelemetry/api": ">=1.0.0 <1.3.0",
"@opentelemetry/context-async-hooks": "1.6.0",
"@opentelemetry/semantic-conventions": "1.6.0",
"@opentelemetry/context-async-hooks": "1.7.0",
"@opentelemetry/semantic-conventions": "1.7.0",
"@types/mocha": "9.1.1",

@@ -79,3 +79,3 @@ "@types/node": "18.6.5",

"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-node",
"gitHead": "a5abee69119cc41d9d34f6beb5c1826eef1ac0dd"
"gitHead": "ad88c3d9aa0100fe259b93f4b660e84417b757ac"
}

@@ -6,2 +6,4 @@ # OpenTelemetry SDK for Node.js

**Note: This is an experimental package under active development. New releases may include breaking changes.**
This package provides the full OpenTelemetry SDK for Node.js including tracing and metrics.

@@ -22,3 +24,3 @@

@opentelemetry/exporter-jaeger \ # add tracing exporters as needed
@opentelemetry/exporter-prometheus # add metrics exporters as needed
@opentelemetry/exporter-prometheus \ # add metrics exporters as needed
@opentelemetry/instrumentation-http # add instrumentations as needed

@@ -31,3 +33,3 @@

> Note: this example is for Node.js. See [examples/tracer-web](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web) for a browser example.
> Note: this example is for Node.js. See [examples/opentelemetry-web](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/opentelemetry-web) for a browser example.

@@ -56,3 +58,3 @@ ### Initialize the SDK

// Optional - If omitted, the metrics SDK will not be initialized
metricExporter: prometheusExporter,
metricReader: prometheusExporter,
// Optional - you can use the metapackage or load each instrumentation individually

@@ -99,14 +101,14 @@ instrumentations: [getNodeAutoInstrumentations()],

### metricProcessor
### metricReader
Use a custom processor for metrics. Default: UngroupedProcessor
Add a [MetricReader](../opentelemetry-sdk-metrics/src/export/MetricReader.ts)
that will be passed to the `MeterProvider`. If `metricReader` is not configured,
the metrics SDK will not be initialized and registered.
### metricExporter
### views
Configure a metric exporter. If an exporter is not configured, the metrics SDK will not be initialized and registered.
A list of views to be passed to the `MeterProvider`.
Accepts an array of [View](../opentelemetry-sdk-metrics/src/view/View.ts)-instances.
This parameter can be used to configure explicit bucket sizes of histogram metrics.
### metricInterval
Configure an interval for metrics export in ms. Default: 60,000 (60 seconds)
### instrumentations

@@ -122,5 +124,10 @@

### resourceDetectors
Configure resource detectors. By default, the resource detectors are [envDetector, processDetector].
NOTE: In order to enable the detection, the parameter `autoDetectResources` has to be `true`.
### sampler
Configure a custom sampler. By default all traces will be sampled.
Configure a custom sampler. By default, all traces will be sampled.

@@ -137,6 +144,2 @@ ### spanProcessor

### views
Configure views of your instruments and accepts an array of [View](../opentelemetry-sdk-metrics-base/src/view/View.ts)-instances. The parameter can be used to configure the explicit bucket sizes of histogram metrics.
### serviceName

@@ -143,0 +146,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc