Skip to content

Commit

Permalink
Merge branch 'main' into release-api-1.4.1-sdk-1.10-exp-0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Mar 13, 2023
2 parents 7ca9a22 + ecb5ebe commit fb0bbad
Show file tree
Hide file tree
Showing 37 changed files with 464 additions and 73 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
* perf(propagator-jaeger): improve deserializeSpanContext performance [#3541](https://github.com/open-telemetry/opentelemetry-js/pull/3541) @doochik
* feat: support TraceState in SamplingResult [#3530](https://github.com/open-telemetry/opentelemetry-js/pull/3530) @raphael-theriault-swi
* feat(sdk-trace-base): add diagnostic logging when spans are dropped [#3610](https://github.com/open-telemetry/opentelemetry-js/pull/3610) @neoeinstein
* feat: add unit to view instrument selection criteria [#3647](https://github.com/open-telemetry/opentelemetry-js/pull/3647) @jlabatut
* feat(tracing): expose dropped counts for attributes, events and links on span [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05

### :bug: (Bug Fix)

Expand All @@ -40,6 +42,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :house: (Internal)

* chore(exporter-jaeger): deprecate jaeger exporter [#3585](https://github.com/open-telemetry/opentelemetry-js/pull/3585) @pichlermarc
* fix(sdk-metrics): fix flaky LastValueAggregator test by using fake timer [#3587](https://github.com/open-telemetry/opentelemetry-js/pull/3587) @pichlermarc
* fix(test): fix failing tests by preventing source-map generation [#3642](https://github.com/open-telemetry/opentelemetry-js/pull/3642) @pichlermarc

Expand Down
1 change: 1 addition & 0 deletions api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
### :rocket: (Enhancement)

* feat(api): add `getActiveBaggage` API [#3385](https://github.com/open-telemetry/opentelemetry-js/pull/3385)
* feat(api): add optional `droppedAttributesCount` property in the `Link` interface [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05

### :bug: (Bug Fix)

Expand Down
2 changes: 2 additions & 0 deletions api/src/trace/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ export interface Link {
context: SpanContext;
/** A set of {@link SpanAttributes} on the link. */
attributes?: SpanAttributes;
/** Count of attributes of the link that were dropped due to collection limits */
droppedAttributesCount?: number;
}
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All notable changes to experimental packages in this project will be documented
* feat(sdk-node): install diag logger with OTEL_LOG_LEVEL [#3627](https://github.com/open-telemetry/opentelemetry-js/pull/3627) @legendecas
* feat(otlp-exporter-base): add retries [#3207](https://github.com/open-telemetry/opentelemetry-js/pull/3207) @svetlanabrennan
* feat(sdk-node): override IdGenerator when using NodeSDK [#3645](https://github.com/open-telemetry/opentelemetry-js/pull/3645) @haddasbronfman
* feat(otlp-transformer): expose dropped attributes, events and links counts on the transformed otlp span [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05

### :bug: (Bug Fix)

Expand Down
23 changes: 19 additions & 4 deletions experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,34 @@ export const mockedReadableSpan: ReadableSpan = {
},
],
events: [
{ name: 'fetchStart', time: [1574120165, 429803070] },
{
name: 'fetchStart',
time: [1574120165, 429803070],
},
{
name: 'domainLookupStart',
time: [1574120165, 429803070],
},
{ name: 'domainLookupEnd', time: [1574120165, 429803070] },
{
name: 'domainLookupEnd',
time: [1574120165, 429803070],
},
{
name: 'connectStart',
time: [1574120165, 429803070],
},
{ name: 'connectEnd', time: [1574120165, 429803070] },
{
name: 'connectEnd',
time: [1574120165, 429803070],
},
{
name: 'requestStart',
time: [1574120165, 435513070],
},
{ name: 'responseStart', time: [1574120165, 436923070] },
{
name: 'responseStart',
time: [1574120165, 436923070],
},
{
name: 'responseEnd',
time: [1574120165, 438688070],
Expand All @@ -91,6 +103,9 @@ export const mockedReadableSpan: ReadableSpan = {
})
),
instrumentationLibrary: { name: 'default', version: '0.0.1' },
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
};

export function ensureExportedEventsAreCorrect(events: IEvent[]) {
Expand Down
32 changes: 28 additions & 4 deletions experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,34 @@ export const mockedReadableSpan: ReadableSpan = {
},
],
events: [
{ name: 'fetchStart', time: [1574120165, 429803070] },
{
name: 'fetchStart',
time: [1574120165, 429803070],
},
{
name: 'domainLookupStart',
time: [1574120165, 429803070],
},
{ name: 'domainLookupEnd', time: [1574120165, 429803070] },
{
name: 'domainLookupEnd',
time: [1574120165, 429803070],
},
{
name: 'connectStart',
time: [1574120165, 429803070],
},
{ name: 'connectEnd', time: [1574120165, 429803070] },
{
name: 'connectEnd',
time: [1574120165, 429803070],
},
{
name: 'requestStart',
time: [1574120165, 435513070],
},
{ name: 'responseStart', time: [1574120165, 436923070] },
{
name: 'responseStart',
time: [1574120165, 436923070],
},
{
name: 'responseEnd',
time: [1574120165, 438688070],
Expand All @@ -102,6 +114,9 @@ export const mockedReadableSpan: ReadableSpan = {
})
),
instrumentationLibrary: { name: 'default', version: '0.0.1' },
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
};

export const mockedResources: Resource[] = [
Expand Down Expand Up @@ -142,6 +157,9 @@ export const basicTrace: ReadableSpan[] = [
duration: [0, 8885000],
resource: mockedResources[0],
instrumentationLibrary: mockedInstrumentationLibraries[0],
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
},
{
name: 'span2',
Expand All @@ -164,6 +182,9 @@ export const basicTrace: ReadableSpan[] = [
duration: [0, 8775000],
resource: mockedResources[0],
instrumentationLibrary: mockedInstrumentationLibraries[0],
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
},
{
name: 'span3',
Expand All @@ -186,6 +207,9 @@ export const basicTrace: ReadableSpan[] = [
duration: [0, 8775000],
resource: mockedResources[0],
instrumentationLibrary: mockedInstrumentationLibraries[0],
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,34 @@ export const mockedReadableSpan: ReadableSpan = {
},
],
events: [
{ name: 'fetchStart', time: [1574120165, 429803070] },
{
name: 'fetchStart',
time: [1574120165, 429803070],
},
{
name: 'domainLookupStart',
time: [1574120165, 429803070],
},
{ name: 'domainLookupEnd', time: [1574120165, 429803070] },
{
name: 'domainLookupEnd',
time: [1574120165, 429803070],
},
{
name: 'connectStart',
time: [1574120165, 429803070],
},
{ name: 'connectEnd', time: [1574120165, 429803070] },
{
name: 'connectEnd',
time: [1574120165, 429803070],
},
{
name: 'requestStart',
time: [1574120165, 435513070],
},
{ name: 'responseStart', time: [1574120165, 436923070] },
{
name: 'responseStart',
time: [1574120165, 436923070],
},
{
name: 'responseEnd',
time: [1574120165, 438688070],
Expand All @@ -87,6 +99,9 @@ export const mockedReadableSpan: ReadableSpan = {
cost: 112.12,
}),
instrumentationLibrary: { name: 'default', version: '0.0.1' },
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
};

export function ensureProtoEventsAreCorrect(events: IEvent[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export class FetchInstrumentation extends InstrumentationBase<
): Promise<Response> {
const self = this;
const url = web.parseUrl(
args[0] instanceof Request ? args[0].url : args[0]
args[0] instanceof Request ? args[0].url : String(args[0])
).href;

const options = args[0] instanceof Request ? args[0] : args[1] || {};
Expand Down
23 changes: 19 additions & 4 deletions experimental/packages/otlp-grpc-exporter-base/test/traceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,34 @@ export const mockedReadableSpan: ReadableSpan = {
},
],
events: [
{ name: 'fetchStart', time: [1574120165, 429803070] },
{
name: 'fetchStart',
time: [1574120165, 429803070],
},
{
name: 'domainLookupStart',
time: [1574120165, 429803070],
},
{ name: 'domainLookupEnd', time: [1574120165, 429803070] },
{
name: 'domainLookupEnd',
time: [1574120165, 429803070],
},
{
name: 'connectStart',
time: [1574120165, 429803070],
},
{ name: 'connectEnd', time: [1574120165, 429803070] },
{
name: 'connectEnd',
time: [1574120165, 429803070],
},
{
name: 'requestStart',
time: [1574120165, 435513070],
},
{ name: 'responseStart', time: [1574120165, 436923070] },
{
name: 'responseStart',
time: [1574120165, 436923070],
},
{
name: 'responseEnd',
time: [1574120165, 438688070],
Expand All @@ -91,6 +103,9 @@ export const mockedReadableSpan: ReadableSpan = {
})
),
instrumentationLibrary: { name: 'default', version: '0.0.1' },
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
};

export function ensureExportedEventsAreCorrect(events: IEvent[]) {
Expand Down
10 changes: 5 additions & 5 deletions experimental/packages/otlp-transformer/src/trace/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ export function sdkSpanToOtlpSpan(span: ReadableSpan, useHex?: boolean): ISpan {
startTimeUnixNano: hrTimeToNanoseconds(span.startTime),
endTimeUnixNano: hrTimeToNanoseconds(span.endTime),
attributes: toAttributes(span.attributes),
droppedAttributesCount: 0,
droppedAttributesCount: span.droppedAttributesCount,
events: span.events.map(toOtlpSpanEvent),
droppedEventsCount: 0,
droppedEventsCount: span.droppedEventsCount,
status: {
// API and proto enums share the same values
code: status.code as unknown as EStatusCode,
message: status.message,
},
links: span.links.map(link => toOtlpLink(link, useHex)),
droppedLinksCount: 0,
droppedLinksCount: span.droppedLinksCount,
};
}

Expand All @@ -62,7 +62,7 @@ export function toOtlpLink(link: Link, useHex?: boolean): ILink {
? link.context.traceId
: core.hexToBase64(link.context.traceId),
traceState: link.context.traceState?.serialize(),
droppedAttributesCount: 0,
droppedAttributesCount: link.droppedAttributesCount || 0,
};
}

Expand All @@ -73,6 +73,6 @@ export function toOtlpSpanEvent(timedEvent: TimedEvent): IEvent {
: [],
name: timedEvent.name,
timeUnixNano: hrTimeToNanoseconds(timedEvent.time),
droppedAttributesCount: 0,
droppedAttributesCount: timedEvent.droppedAttributesCount || 0,
};
}
3 changes: 3 additions & 0 deletions experimental/packages/otlp-transformer/test/trace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ describe('Trace', () => {
status: {
code: SpanStatusCode.OK,
},
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0,
};
});

Expand Down
9 changes: 4 additions & 5 deletions packages/opentelemetry-context-zone-peer-dep/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
* limitations under the License.
*/

import { TargetWithEvents } from './types';

/**
* check if an object has addEventListener and removeEventListener functions then it will return true
* @param obj
* check if an object has addEventListener and removeEventListener functions then it will return true.
* Generally only called with a `TargetWithEvents` but may be called with an unknown / any.
* @param obj - The object to check.
*/
export function isListenerObject(obj: TargetWithEvents = {}): boolean {
export function isListenerObject(obj: any = {}): boolean {
return (
typeof obj.addEventListener === 'function' &&
typeof obj.removeEventListener === 'function'
Expand Down
9 changes: 9 additions & 0 deletions packages/opentelemetry-core/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const ENVIRONMENT_NUMBERS_KEYS = [
'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT',
'OTEL_SPAN_EVENT_COUNT_LIMIT',
'OTEL_SPAN_LINK_COUNT_LIMIT',
'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT',
'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT',
'OTEL_EXPORTER_OTLP_TIMEOUT',
'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT',
'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT',
Expand Down Expand Up @@ -131,6 +133,9 @@ export const DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;

export const DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;

export const DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128;
export const DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128;

/**
* Default environment variables
*/
Expand Down Expand Up @@ -172,6 +177,10 @@ export const DEFAULT_ENVIRONMENT: Required<ENVIRONMENT> = {
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT,
OTEL_SPAN_EVENT_COUNT_LIMIT: 128,
OTEL_SPAN_LINK_COUNT_LIMIT: 128,
OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:
DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,
OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:
DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,
OTEL_TRACES_EXPORTER: '',
OTEL_TRACES_SAMPLER: TracesSamplerValues.ParentBasedAlwaysOn,
OTEL_TRACES_SAMPLER_ARG: '',
Expand Down
8 changes: 7 additions & 1 deletion packages/opentelemetry-exporter-jaeger/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# OpenTelemetry Jaeger Trace Exporter for Node.js
# (Deprecated) OpenTelemetry Jaeger Trace Exporter for Node.js

[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]

**NOTE: Support for `@opentelemetry/exporter-jaeger` will end March 2024, please use any of the following packages instead:**

- `@opentelemetry/exporter-trace-otlp-proto`
- `@opentelemetry/exporter-trace-otlp-grpc`
- `@opentelemetry/exporter-trace-otlp-http`

OpenTelemetry Jaeger Trace Exporter allows the user to send collected traces to Jaeger.

[Jaeger](https://jaeger.readthedocs.io/en/latest/), inspired by [Dapper](https://research.google.com/pubs/pub36356.html) and [OpenZipkin](http://zipkin.io/), is a distributed tracing system released as open source by [Uber Technologies](http://uber.github.io/). It is used for monitoring and troubleshooting microservices-based distributed systems, including:
Expand Down
Loading

0 comments on commit fb0bbad

Please sign in to comment.