Skip to content

Commit 0b63bd9

Browse files
chore: Upgrade opentelemetry dependencies (#1107)
Co-authored-by: Max Gurewitz <maxgurewitz@gmail.com>
1 parent 2073c53 commit 0b63bd9

File tree

14 files changed

+18590
-13992
lines changed

14 files changed

+18590
-13992
lines changed

package-lock.json

Lines changed: 18552 additions & 13964 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
"temporalio": "file:packages/meta"
5151
},
5252
"devDependencies": {
53-
"@opentelemetry/api": "^1.3.0",
54-
"@opentelemetry/core": "^1.8.0",
55-
"@opentelemetry/sdk-node": "^0.34.0",
56-
"@opentelemetry/semantic-conventions": "^1.8.0",
53+
"@opentelemetry/api": "^1.4.1",
54+
"@opentelemetry/core": "^1.12.0",
55+
"@opentelemetry/sdk-node": "^0.38.0",
56+
"@opentelemetry/semantic-conventions": "^1.12.0",
5757
"@tsconfig/node14": "^1.0.3",
5858
"@types/dedent": "^0.7.0",
5959
"@types/fs-extra": "^9.0.13",

packages/client/src/helpers.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
searchAttributePayloadConverter,
55
SearchAttributes,
66
} from '@temporalio/common';
7+
import { Replace } from '@temporalio/common/lib/type-helpers';
78
import { optionalTsToDate, tsToDate } from '@temporalio/common/lib/time';
89
import { decodeMapFromPayloads } from '@temporalio/common/lib/internal-non-workflow/codec-helpers';
910
import { temporal } from '@temporalio/proto';
@@ -39,10 +40,11 @@ function workflowStatusCodeToNameInternal(
3940
}
4041
}
4142

42-
export async function executionInfoFromRaw(
43+
export async function executionInfoFromRaw<T>(
4344
raw: RawWorkflowExecutionInfo,
44-
dataConverter: LoadedDataConverter
45-
): Promise<WorkflowExecutionInfo> {
45+
dataConverter: LoadedDataConverter,
46+
rawDataToEmbed: T
47+
): Promise<Replace<WorkflowExecutionInfo, { raw: T }>> {
4648
return {
4749
/* eslint-disable @typescript-eslint/no-non-null-assertion */
4850
type: raw.type!.name!,
@@ -70,6 +72,6 @@ export async function executionInfoFromRaw(
7072
runId: raw.parentExecution.runId!,
7173
}
7274
: undefined,
73-
raw,
75+
raw: rawDataToEmbed,
7476
};
7577
}

packages/client/src/schedule-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,13 +764,13 @@ export const MONTHS = [
764764
] as const;
765765

766766
/** @experimental */
767-
export type Month = typeof MONTHS[number];
767+
export type Month = (typeof MONTHS)[number];
768768

769769
/** @experimental */
770770
export const DAYS_OF_WEEK = ['SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY'] as const;
771771

772772
/** @experimental */
773-
export type DayOfWeek = typeof DAYS_OF_WEEK[number];
773+
export type DayOfWeek = (typeof DAYS_OF_WEEK)[number];
774774

775775
/** @experimental */
776776
export type ScheduleOptionsAction = ScheduleOptionsStartWorkflowAction<Workflow>;

packages/client/src/workflow-client.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,11 @@ export class WorkflowClient extends BaseClient {
841841
const raw = await fn({
842842
workflowExecution: { workflowId, runId },
843843
});
844-
const info = await executionInfoFromRaw(raw.workflowExecutionInfo ?? {}, this.client.dataConverter);
845-
(info as unknown as WorkflowExecutionDescription).raw = raw;
846-
return info;
844+
const info = await executionInfoFromRaw(raw.workflowExecutionInfo ?? {}, this.client.dataConverter, raw);
845+
return {
846+
...info,
847+
raw,
848+
};
847849
},
848850
async fetchHistory() {
849851
let nextPageToken: Uint8Array | undefined = undefined;
@@ -933,7 +935,7 @@ export class WorkflowClient extends BaseClient {
933935
// Decoding is done for `memo` fields which tend to be small.
934936
// We might decide to change that based on user feedback.
935937
for (const raw of response.executions) {
936-
yield await executionInfoFromRaw(raw, this.dataConverter);
938+
yield await executionInfoFromRaw(raw, this.dataConverter, raw);
937939
}
938940
nextPageToken = response.nextPageToken;
939941
if (nextPageToken == null || nextPageToken.length === 0) break;

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
1313
"license": "MIT",
1414
"dependencies": {
15-
"@opentelemetry/api": "^1.3.0",
15+
"@opentelemetry/api": "^1.4.1",
1616
"@temporalio/proto": "file:../proto",
1717
"long": "^5.2.0",
1818
"ms": "^2.1.3",

packages/common/src/converter/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const encodingTypes = {
88
METADATA_ENCODING_PROTOBUF_JSON: 'json/protobuf',
99
METADATA_ENCODING_PROTOBUF: 'binary/protobuf',
1010
} as const;
11-
export type EncodingType = typeof encodingTypes[keyof typeof encodingTypes];
11+
export type EncodingType = (typeof encodingTypes)[keyof typeof encodingTypes];
1212

1313
export const encodingKeys = {
1414
METADATA_ENCODING_NULL: encode(encodingTypes.METADATA_ENCODING_NULL),

packages/core-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
2323
"license": "MIT",
2424
"dependencies": {
25-
"@opentelemetry/api": "^1.3.0",
25+
"@opentelemetry/api": "^1.4.1",
2626
"@temporalio/common": "file:../common",
2727
"arg": "^5.0.2",
2828
"cargo-cp-artifact": "^0.1.6",

packages/interceptors-opentelemetry/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
1515
"license": "MIT",
1616
"dependencies": {
17-
"@opentelemetry/api": "^1.3.0",
18-
"@opentelemetry/core": "^1.8.0",
19-
"@opentelemetry/resources": "^1.8.0",
20-
"@opentelemetry/sdk-trace-base": "^1.8.0",
17+
"@opentelemetry/api": "^1.4.1",
18+
"@opentelemetry/core": "^1.12.0",
19+
"@opentelemetry/resources": "^1.12.0",
20+
"@opentelemetry/sdk-trace-base": "^1.12.0",
2121
"@temporalio/activity": "file:../activity",
2222
"@temporalio/client": "file:../client",
2323
"@temporalio/common": "file:../common",

packages/interceptors-opentelemetry/src/workflow/definitions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export interface SerializableSpan {
1919
readonly events: tracing.TimedEvent[];
2020
readonly duration: otel.HrTime;
2121
readonly ended: boolean;
22+
readonly droppedAttributesCount: number;
23+
readonly droppedLinksCount: number;
24+
readonly droppedEventsCount: number;
2225
// readonly resource: Resource;
2326
// eslint-disable-next-line deprecation/deprecation
2427
readonly instrumentationLibrary: InstrumentationLibrary;

packages/interceptors-opentelemetry/src/workflow/span-exporter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export class SpanExporter implements tracing.SpanExporter {
2929
events: span.events,
3030
duration: span.duration,
3131
ended: span.ended,
32+
droppedAttributesCount: span.droppedAttributesCount,
33+
droppedEventsCount: span.droppedEventsCount,
34+
droppedLinksCount: span.droppedLinksCount,
3235
instrumentationLibrary: span.instrumentationLibrary,
3336
};
3437
}

packages/test/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
"dependencies": {
2929
"@grpc/grpc-js": "~1.7.3",
3030
"@grpc/proto-loader": "^0.7.0",
31-
"@opentelemetry/api": "^1.3.0",
32-
"@opentelemetry/core": "^1.8.0",
33-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.34.0",
34-
"@opentelemetry/sdk-node": "^0.34.0",
35-
"@opentelemetry/semantic-conventions": "^1.8.0",
31+
"@opentelemetry/api": "^1.4.1",
32+
"@opentelemetry/core": "^1.12.0",
33+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.38.0",
34+
"@opentelemetry/sdk-node": "^0.38.0",
35+
"@opentelemetry/semantic-conventions": "^1.12.0",
3636
"@temporalio/activity": "file:../activity",
3737
"@temporalio/client": "file:../client",
3838
"@temporalio/common": "file:../common",

packages/worker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
1414
"license": "MIT",
1515
"dependencies": {
16-
"@opentelemetry/api": "^1.3.0",
16+
"@opentelemetry/api": "^1.4.1",
1717
"@swc/core": "^1.2.204",
1818
"@temporalio/activity": "file:../activity",
1919
"@temporalio/client": "file:../client",

packages/worker/src/workflow/vm-shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function formatCallsiteName(callsite: NodeJS.CallSite): string | null {
8383
*/
8484
export function injectConsole(context: vm.Context): void {
8585
const consoleMethods = ['log', 'warn', 'error', 'info', 'debug'] as const;
86-
type ConsoleMethod = typeof consoleMethods[number];
86+
type ConsoleMethod = (typeof consoleMethods)[number];
8787
function makeConsoleFn(level: ConsoleMethod) {
8888
return function (...args: unknown[]) {
8989
const { info } = context.__TEMPORAL_ACTIVATOR__;

0 commit comments

Comments
 (0)