@temporalio/core-bridge
Advanced tools
Comparing version 1.8.6 to 1.9.0-rc.0
@@ -1,2 +0,1 @@ | ||
import { SpanContext } from '@opentelemetry/api'; | ||
import { LogLevel, Duration } from '@temporalio/common'; | ||
@@ -106,8 +105,2 @@ import type { TLSConfig } from '@temporalio/common/lib/internal-non-workflow'; | ||
/** @experimental */ | ||
export type CompiledOtelTraceExporter = Shadow<OtelCollectorExporter, { | ||
otel: { | ||
metricsExportInterval?: never; | ||
}; | ||
}>; | ||
/** @experimental */ | ||
export type CompiledOtelMetricsExporter = Shadow<OtelCollectorExporter, { | ||
@@ -146,8 +139,2 @@ otel: { | ||
} & (PrometheusMetricsExporter | OtelCollectorExporter); | ||
/** | ||
* Trace exporters supported by Core | ||
* | ||
* @experimental | ||
*/ | ||
export type TraceExporter = OtelCollectorExporter; | ||
/** @experimental */ | ||
@@ -161,3 +148,3 @@ export interface TelemetryOptions { | ||
* | ||
* @deprecated Use either `logging.filter` or `tracing.filter` instead | ||
* @deprecated Use `logging.filter` instead | ||
*/ | ||
@@ -195,25 +182,2 @@ tracingFilter?: string; | ||
/** | ||
* Control where to send traces generated by Rust Core, optional and turned off by default. | ||
* | ||
* This is typically used for profiling SDK internals. | ||
*/ | ||
tracing?: { | ||
/** | ||
* A string in (env filter format)[https://docs.rs/tracing-subscriber/0.2.20/tracing_subscriber/struct.EnvFilter.html] | ||
* which determines what tracing data is collected in the Core SDK. | ||
* | ||
* You can use {@link Runtime.makeTelemetryFilterString()} to easily build a correctly formatted filter | ||
* string based on desired log level for Core SDK and other native packages. | ||
* | ||
* **BACKWARD COMPATIBILITY** | ||
* | ||
* If `tracing.filter` is missing, the following legacy values (if present) will be used instead (in the given order): | ||
* - {@link TelemetryOptions.tracingFilter} | ||
* - Default value of `makeTelemetryFilterString({ core: 'INFO', other: 'INFO'})` | ||
* | ||
* @default `makeTelemetryFilterString({ core: 'INFO', other: 'INFO'})` (with some exceptions, as described in backward compatibility note above) | ||
*/ | ||
filter?: string; | ||
} & Partial<TraceExporter>; | ||
/** | ||
* Control exporting {@link NativeConnection} and {@link Worker} metrics. | ||
@@ -224,2 +188,6 @@ * | ||
metrics?: MetricsExporter; | ||
/** | ||
* @deprecated Core SDK tracing is no longer supported. This option is ignored. | ||
*/ | ||
tracing?: unknown; | ||
} | ||
@@ -236,5 +204,2 @@ /** @experimental */ | ||
}); | ||
tracing?: { | ||
filter: string; | ||
} & CompiledOtelTraceExporter; | ||
metrics?: { | ||
@@ -267,2 +232,3 @@ temporality?: 'cumulative' | 'delta'; | ||
maxConcurrentLocalActivityExecutions: number; | ||
nonStickyToStickyPollRatio: number; | ||
/** | ||
@@ -317,2 +283,5 @@ * Maximum number of Workflow tasks to poll concurrently. | ||
} | ||
export type LogEntryMetadata = { | ||
[key: string]: string | number | boolean | LogEntryMetadata; | ||
}; | ||
export interface LogEntry { | ||
@@ -329,2 +298,6 @@ /** Log message */ | ||
level: LogLevel; | ||
/** Name of the Core subsystem that emitted that log entry */ | ||
target: string; | ||
/*** Metadata fields */ | ||
fields: LogEntryMetadata; | ||
} | ||
@@ -458,6 +431,6 @@ /** | ||
export declare function pollLogs(runtime: Runtime, callback: LogsCallback): void; | ||
export declare function workerPollWorkflowActivation(worker: Worker, spanContext: SpanContext, callback: PollCallback): void; | ||
export declare function workerCompleteWorkflowActivation(worker: Worker, spanContext: SpanContext, result: ArrayBuffer, callback: VoidCallback): void; | ||
export declare function workerPollActivityTask(worker: Worker, spanContext: SpanContext, callback: PollCallback): void; | ||
export declare function workerCompleteActivityTask(worker: Worker, spanContext: SpanContext, result: ArrayBuffer, callback: VoidCallback): void; | ||
export declare function workerPollWorkflowActivation(worker: Worker, callback: PollCallback): void; | ||
export declare function workerCompleteWorkflowActivation(worker: Worker, result: ArrayBuffer, callback: VoidCallback): void; | ||
export declare function workerPollActivityTask(worker: Worker, callback: PollCallback): void; | ||
export declare function workerCompleteActivityTask(worker: Worker, result: ArrayBuffer, callback: VoidCallback): void; | ||
export declare function workerRecordActivityHeartbeat(worker: Worker, heartbeat: ArrayBuffer): void; | ||
@@ -464,0 +437,0 @@ export declare function getTimeOfDay(): [number, number]; |
{ | ||
"name": "@temporalio/core-bridge", | ||
"version": "1.8.6", | ||
"version": "1.9.0-rc.0", | ||
"description": "Temporal.io SDK Core<>Node bridge", | ||
@@ -25,4 +25,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@opentelemetry/api": "^1.4.1", | ||
"@temporalio/common": "1.8.6", | ||
"@temporalio/common": "1.9.0-rc.0", | ||
"arg": "^5.0.2", | ||
@@ -57,3 +56,3 @@ "cargo-cp-artifact": "^0.1.6", | ||
}, | ||
"gitHead": "1e95cf92ec5e6efffb7aedb064ea46be05df0c14" | ||
"gitHead": "ca3e508e62de02b2c9bb40d0d889003cebba282d" | ||
} |
@@ -69,3 +69,3 @@ Core SDK Architecture | ||
See the latest API definition [here](https://github.com/temporalio/sdk-core/tree/master/protos/local/temporal/sdk/core) | ||
See the latest API definition [here](https://github.com/temporalio/sdk-core/tree/master/sdk-core-protos/protos/local/temporal/sdk/core) | ||
@@ -72,0 +72,0 @@ |
[![Build status](https://badge.buildkite.com/c23f47f4a827f04daece909963bd3a248496f0cdbabfbecee4.svg?branch=master)](https://buildkite.com/temporal/core-sdk?branch=master) | ||
# Temporal Core SDK | ||
Core SDK that can be used as a base for other Temporal SDKs. It is currently used as the base of: | ||
@@ -10,20 +12,27 @@ | ||
For the reasoning behind the Core SDK, see: | ||
# Documentation | ||
- [Why Rust powers Temporal’s new Core SDK](https://temporal.io/blog/why-rust-powers-core-sdk). | ||
Core SDK documentation can be generated with `cargo doc`, output will be placed in the | ||
`target/doc` directory. | ||
See the [Architecture](ARCHITECTURE.md) doc for some high-level information about how Core works | ||
[Architecture](ARCHITECTURE.md) doc provides some high-level information about how Core SDK works | ||
and how language layers interact with it. | ||
For the reasoning behind the Core SDK, see blog post: | ||
- [Why Rust powers Temporal’s new Core SDK](https://temporal.io/blog/why-rust-powers-core-sdk). | ||
# Development | ||
You will need the `protoc` protobuf compiler installed to build Core. | ||
You will need the `protoc` [protobuf compiler](https://grpc.io/docs/protoc-installation) | ||
installed to build Core. | ||
This repo is composed of multiple crates: | ||
* temporal-sdk-core-protos `./sdk-core-protos` - Holds the generated proto code and extensions | ||
* temporal-client `./client` - Defines client(s) for interacting with the Temporal gRPC service | ||
* temporal-sdk-core-api `./core-api` - Defines the API surface exposed by Core | ||
* temporal-sdk-core `./core` - The Core implementation | ||
* temporal-sdk `./sdk` - A (currently prototype) Rust SDK built on top of Core. Used for testing. | ||
* rustfsm `./fsm` - Implements a procedural macro used by core for defining state machines | ||
- temporal-sdk-core-protos `./sdk-core-protos` - Holds the generated proto code and extensions | ||
- temporal-client `./client` - Defines client(s) for interacting with the Temporal gRPC service | ||
- temporal-sdk-core-api `./core-api` - Defines the API surface exposed by Core | ||
- temporal-sdk-core `./core` - The Core implementation | ||
- temporal-sdk `./sdk` - A (currently prototype) Rust SDK built on top of Core. Used for testing. | ||
- rustfsm `./fsm` - Implements a procedural macro used by core for defining state machines | ||
(contains subcrates). It is temporal agnostic. | ||
@@ -39,8 +48,8 @@ | ||
You can buld and test the project using cargo: | ||
You can build and test the project using cargo: | ||
`cargo build` | ||
`cargo test` | ||
Run integ tests with `cargo integ-test`. You will need to already be running the server: | ||
`docker-compose -f .buildkite/docker/docker-compose.yaml up` | ||
Run integ tests with `cargo integ-test`. By default it will start an ephemeral server. You can also | ||
use an already-running server by passing `-s external`. | ||
@@ -50,2 +59,3 @@ Run load tests with `cargo test --features=save_wf_inputs --test heavy_tests`. | ||
## Formatting | ||
To format all code run: | ||
@@ -55,2 +65,3 @@ `cargo fmt --all` | ||
## Linting | ||
We are using [clippy](https://github.com/rust-lang/rust-clippy) for linting. | ||
@@ -61,2 +72,3 @@ You can run it using: | ||
## Debugging | ||
The crate uses [tracing](https://github.com/tokio-rs/tracing) to help with debugging. To enable | ||
@@ -75,3 +87,3 @@ it for a test, insert the below snippet at the start of the test. By default, tracing data is output | ||
`docker-compose -f .buildkite/docker/docker-compose.yaml -f .buildkite/docker/docker-compose-telem.yaml up` | ||
`docker-compose -f docker/docker-compose.yaml -f docker/docker-compose-telem.yaml up` | ||
@@ -83,3 +95,3 @@ If you are working on a language SDK, you are expected to initialize tracing early in your `main` | ||
This repo uses a subtree for upstream protobuf files. The path `protos/api_upstream` is a | ||
This repo uses a subtree for upstream protobuf files. The path `sdk-core-protos/protos/api_upstream` is a | ||
subtree. To update it, use: | ||
@@ -93,2 +105,3 @@ | ||
subdirectory of that repo, we just copy the files with read-tree: | ||
```bash | ||
@@ -98,5 +111,5 @@ # add sdk-java as a remote if you have not already | ||
# delete existing protos | ||
git rm -rf protos/testsrv_upstream | ||
git rm -rf sdk-core-protos/protos/testsrv_upstream | ||
# pull from upstream & commit | ||
git read-tree --prefix protos/testsrv_upstream -u testsrv-protos/master:temporal-test-server/src/main/proto | ||
git read-tree --prefix sdk-core-protos/protos/testsrv_upstream -u testsrv-protos/master:temporal-test-server/src/main/proto | ||
git commit | ||
@@ -106,2 +119,3 @@ ``` | ||
## Fetching Histories | ||
Tests which would like to replay stored histories rely on that history being made available in | ||
@@ -117,10 +131,11 @@ binary format. You can fetch histories in that format like so (from a local docker server): | ||
### Error handling | ||
Any error which is returned from a public interface should be well-typed, and we use | ||
Any error which is returned from a public interface should be well-typed, and we use | ||
[thiserror](https://github.com/dtolnay/thiserror) for that purpose. | ||
Errors returned from things only used in testing are free to use | ||
Errors returned from things only used in testing are free to use | ||
[anyhow](https://github.com/dtolnay/anyhow) for less verbosity. | ||
# The Rust "SDK" | ||
# The Rust "SDK" | ||
This repo contains a *prototype* Rust sdk in the `sdk/` directory. This SDK should be considered | ||
@@ -130,2 +145,3 @@ pre-alpha in terms of its API surface. Since it's still using Core underneath, it is generally | ||
workflows and activities in Rust, feel free to use it - but be aware that the API may change at any | ||
time without warning and we do not provide any support guarantees. | ||
time without warning and we do not provide any support guarantees. | ||
@@ -1,2 +0,1 @@ | ||
import { SpanContext } from '@opentelemetry/api'; | ||
import { LogLevel, Duration } from '@temporalio/common'; | ||
@@ -130,5 +129,2 @@ import type { TLSConfig } from '@temporalio/common/lib/internal-non-workflow'; | ||
/** @experimental */ | ||
export type CompiledOtelTraceExporter = Shadow<OtelCollectorExporter, { otel: { metricsExportInterval?: never } }>; | ||
/** @experimental */ | ||
export type CompiledOtelMetricsExporter = Shadow<OtelCollectorExporter, { otel: { metricsExportInterval: number } }>; | ||
@@ -166,9 +162,2 @@ | ||
/** | ||
* Trace exporters supported by Core | ||
* | ||
* @experimental | ||
*/ | ||
export type TraceExporter = OtelCollectorExporter; | ||
/** @experimental */ | ||
@@ -182,3 +171,3 @@ export interface TelemetryOptions { | ||
* | ||
* @deprecated Use either `logging.filter` or `tracing.filter` instead | ||
* @deprecated Use `logging.filter` instead | ||
*/ | ||
@@ -219,31 +208,12 @@ tracingFilter?: string; | ||
/** | ||
* Control where to send traces generated by Rust Core, optional and turned off by default. | ||
* Control exporting {@link NativeConnection} and {@link Worker} metrics. | ||
* | ||
* This is typically used for profiling SDK internals. | ||
* Turned off by default | ||
*/ | ||
tracing?: { | ||
/** | ||
* A string in (env filter format)[https://docs.rs/tracing-subscriber/0.2.20/tracing_subscriber/struct.EnvFilter.html] | ||
* which determines what tracing data is collected in the Core SDK. | ||
* | ||
* You can use {@link Runtime.makeTelemetryFilterString()} to easily build a correctly formatted filter | ||
* string based on desired log level for Core SDK and other native packages. | ||
* | ||
* **BACKWARD COMPATIBILITY** | ||
* | ||
* If `tracing.filter` is missing, the following legacy values (if present) will be used instead (in the given order): | ||
* - {@link TelemetryOptions.tracingFilter} | ||
* - Default value of `makeTelemetryFilterString({ core: 'INFO', other: 'INFO'})` | ||
* | ||
* @default `makeTelemetryFilterString({ core: 'INFO', other: 'INFO'})` (with some exceptions, as described in backward compatibility note above) | ||
*/ | ||
filter?: string; | ||
} & Partial<TraceExporter>; | ||
metrics?: MetricsExporter; | ||
/** | ||
* Control exporting {@link NativeConnection} and {@link Worker} metrics. | ||
* | ||
* Turned off by default | ||
* @deprecated Core SDK tracing is no longer supported. This option is ignored. | ||
*/ | ||
metrics?: MetricsExporter; | ||
tracing?: unknown; | ||
} | ||
@@ -260,5 +230,2 @@ | ||
); | ||
tracing?: { | ||
filter: string; | ||
} & CompiledOtelTraceExporter; | ||
metrics?: { | ||
@@ -294,2 +261,3 @@ temporality?: 'cumulative' | 'delta'; | ||
maxConcurrentLocalActivityExecutions: number; | ||
nonStickyToStickyPollRatio: number; | ||
@@ -353,2 +321,6 @@ /** | ||
export type LogEntryMetadata = { | ||
[key: string]: string | number | boolean | LogEntryMetadata; | ||
}; | ||
export interface LogEntry { | ||
@@ -363,4 +335,11 @@ /** Log message */ | ||
timestamp: [number, number]; | ||
/** Log level */ | ||
level: LogLevel; | ||
/** Name of the Core subsystem that emitted that log entry */ | ||
target: string; | ||
/*** Metadata fields */ | ||
fields: LogEntryMetadata; | ||
} | ||
@@ -513,20 +492,10 @@ | ||
export declare function pollLogs(runtime: Runtime, callback: LogsCallback): void; | ||
export declare function workerPollWorkflowActivation( | ||
worker: Worker, | ||
spanContext: SpanContext, | ||
callback: PollCallback | ||
): void; | ||
export declare function workerPollWorkflowActivation(worker: Worker, callback: PollCallback): void; | ||
export declare function workerCompleteWorkflowActivation( | ||
worker: Worker, | ||
spanContext: SpanContext, | ||
result: ArrayBuffer, | ||
callback: VoidCallback | ||
): void; | ||
export declare function workerPollActivityTask(worker: Worker, spanContext: SpanContext, callback: PollCallback): void; | ||
export declare function workerCompleteActivityTask( | ||
worker: Worker, | ||
spanContext: SpanContext, | ||
result: ArrayBuffer, | ||
callback: VoidCallback | ||
): void; | ||
export declare function workerPollActivityTask(worker: Worker, callback: PollCallback): void; | ||
export declare function workerCompleteActivityTask(worker: Worker, result: ArrayBuffer, callback: VoidCallback): void; | ||
export declare function workerRecordActivityHeartbeat(worker: Worker, heartbeat: ArrayBuffer): void; | ||
@@ -533,0 +502,0 @@ export declare function getTimeOfDay(): [number, number]; |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
4
298
11
102429497
1207
1
+ Added@temporalio/common@1.9.0-rc.0(transitive)
+ Added@temporalio/proto@1.9.0-rc.0(transitive)
- Removed@opentelemetry/api@^1.4.1
- Removed@opentelemetry/api@1.9.0(transitive)
- Removed@temporalio/common@1.8.6(transitive)
- Removed@temporalio/proto@1.8.6(transitive)