Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadman97 authored Aug 22, 2023
2 parents 94da919 + b400c2e commit bc8cf07
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :bug: (Bug Fix)

* fix(exporter-zipkin): rounding duration to the nearest int to be compliant with zipkin protocol [#4064](https://github.com/open-telemetry/opentelemetry-js/pull/4064) @n0cloud

### :books: (Refine Doc)

### :house: (Internal)
Expand Down
10 changes: 9 additions & 1 deletion experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ All notable changes to experimental packages in this project will be documented

### :boom: Breaking Change

* chore(sdk-node): deprecate methods in favor of constructor options [#3996](https://github.com/open-telemetry/opentelemetry-js/pull/3996) @pichlermarc
* The following methods are now deprecated and will be removed in `0.43.0`
* `NodeSDK.configureTracerProvider()`, please use constructor options instead
* `NodeSDK.configureMeterProvider()`, please use constructor options instead
* `NodeSDK.configureLoggerProvider()`, please use constructor options instead
* `NodeSDK.addResource()`, please use constructor options instead
* `NodeSDK.detectResources()`, this is not necessary anymore, resources are now auto-detected on startup.

### :rocket: (Enhancement)

### :bug: (Bug Fix)
Expand All @@ -18,7 +26,7 @@ All notable changes to experimental packages in this project will be documented

### :house: (Internal)

## 0.42.2
## 0.41.2

### :bug: (Bug Fix)

Expand Down
37 changes: 31 additions & 6 deletions experimental/packages/opentelemetry-sdk-node/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,14 @@ export class NodeSDK {
this._instrumentations = instrumentations;
}

/** Set configurations required to register a NodeTracerProvider */
/**
*
* @deprecated Please pass {@code sampler}, {@code generalLimits}, {@code spanLimits}, {@code resource},
* {@code IdGenerator}, {@code spanProcessor}, {@code contextManager} and {@code textMapPropagator},
* to the constructor options instead.
*
* Set configurations needed to register a TracerProvider
*/
public configureTracerProvider(
tracerConfig: NodeTracerConfig,
spanProcessor: SpanProcessor,
Expand All @@ -193,7 +200,11 @@ export class NodeSDK {
};
}

/**Set configurations needed to register a LoggerProvider */
/**
* @deprecated Please pass {@code logRecordProcessor} to the constructor options instead.
*
* Set configurations needed to register a LoggerProvider
*/
public configureLoggerProvider(config: LoggerProviderConfig): void {
// nothing is set yet, we can set config and then return
if (this._loggerProviderConfig == null) {
Expand All @@ -217,7 +228,11 @@ export class NodeSDK {
}
}

/** Set configurations needed to register a MeterProvider */
/**
* @deprecated Please pass {@code views} and {@code reader} to the constructor options instead.
*
* Set configurations needed to register a MeterProvider
*/
public configureMeterProvider(config: MeterProviderConfig): void {
// nothing is set yet, we can set config and return.
if (this._meterProviderConfig == null) {
Expand Down Expand Up @@ -248,7 +263,12 @@ export class NodeSDK {
}
}

/** Detect resource attributes */
/**
* @deprecated Resources are detected automatically on {@link NodeSDK.start()}, when the {@code autoDetectResources}
* constructor option is set to {@code true} or left {@code undefined}.
*
* Detect resource attributes
*/
public detectResources(): void {
if (this._disabled) {
return;
Expand All @@ -261,13 +281,18 @@ export class NodeSDK {
this.addResource(detectResourcesSync(internalConfig));
}

/** Manually add a resource */
/**
* @deprecated Please pre-merge resources and pass them to the constructor
*
* Manually add a Resource
* @param resource
*/
public addResource(resource: IResource): void {
this._resource = this._resource.merge(resource);
}

/**
* Once the SDK has been configured, call this method to construct SDK components and register them with the OpenTelemetry API.
* Call this method to construct SDK components and register them with the OpenTelemetry API.
*/
public start(): void {
if (this._disabled) {
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-exporter-zipkin/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function toZipkinSpan(
id: span.spanContext().spanId,
kind: ZIPKIN_SPAN_KIND_MAPPING[span.kind],
timestamp: hrTimeToMicroseconds(span.startTime),
duration: hrTimeToMicroseconds(span.duration),
duration: Math.round(hrTimeToMicroseconds(span.duration)),
localEndpoint: { serviceName },
tags: _toZipkinTags(span, statusCodeTagName, statusErrorTagName),
annotations: span.events.length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ describe('transform', () => {
timestamp: hrTimeToMicroseconds(span.events[0].time),
},
],
duration: hrTimeToMicroseconds(
hrTimeDuration(span.startTime, span.endTime)
duration: Math.round(
hrTimeToMicroseconds(hrTimeDuration(span.startTime, span.endTime))
),
id: span.spanContext().spanId,
localEndpoint: {
Expand Down Expand Up @@ -128,8 +128,8 @@ describe('transform', () => {
assert.deepStrictEqual(zipkinSpan, {
kind: 'SERVER',
annotations: undefined,
duration: hrTimeToMicroseconds(
hrTimeDuration(span.startTime, span.endTime)
duration: Math.round(
hrTimeToMicroseconds(hrTimeDuration(span.startTime, span.endTime))
),
id: span.spanContext().spanId,
localEndpoint: {
Expand Down Expand Up @@ -179,8 +179,8 @@ describe('transform', () => {
assert.deepStrictEqual(zipkinSpan, {
kind: item.zipkin,
annotations: undefined,
duration: hrTimeToMicroseconds(
hrTimeDuration(span.startTime, span.endTime)
duration: Math.round(
hrTimeToMicroseconds(hrTimeDuration(span.startTime, span.endTime))
),
id: span.spanContext().spanId,
localEndpoint: {
Expand Down

0 comments on commit bc8cf07

Please sign in to comment.