https://github.com/signoz/temporal-typescript-opentelemetry
Instrument temporal application using opentelemetry
https://github.com/signoz/temporal-typescript-opentelemetry
Last synced: about 1 month ago
JSON representation
Instrument temporal application using opentelemetry
- Host: GitHub
- URL: https://github.com/signoz/temporal-typescript-opentelemetry
- Owner: SigNoz
- Created: 2025-04-20T12:36:36.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-23T09:32:36.000Z (6 months ago)
- Last Synced: 2025-06-12T00:55:55.435Z (4 months ago)
- Language: TypeScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Steps to run
1. Run a local temporal service or signup for a cloud account
Read about connecting to the account at https://docs.temporal.io/develop/typescript/temporal-clients
We use a very similar setup for connecting to temporal in this repo. Most of you would already have this connection implemented in your application.
We need to set envs to connect to your temporal namespace in the cloud account. Checkout `.env` file to replace values
2. Run `npm install` to install dependencies
3. Run the following command to start the worker
```
OTEL_EXPORTER_OTLP_ENDPOINT='https://ingest..signoz.cloud:443' OTEL_RESOURCE_ATTRIBUTES="service.name=temporal-worker-typescript,deployment.environment=test" OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=" npm run start.watch
```4. Run the following command to start the client
```
OTEL_EXPORTER_OTLP_ENDPOINT='https://ingest..signoz.cloud:443' OTEL_RESOURCE_ATTRIBUTES="service.name=temporal-client-typescript" OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=" npm run workflow
```You should start seeing sdk metrics, traces and logs appearing in signoz. For logging, the repo uses winston logger which is passed to temporal config and also sends data in otel format to SigNoz
# Notes
If you want to send the metrics and traces to your local otelcollector, use the below run commands:
For Worker
```
OTEL_EXPORTER_OTLP_ENDPOINT='http://localhost:4317' OTEL_RESOURCE_ATTRIBUTES="service.name=temporal-worker-typescript" npm run start.watch
```
For Client
```
OTEL_EXPORTER_OTLP_ENDPOINT='http://localhost:4317' OTEL_RESOURCE_ATTRIBUTES="service.name=temporal-client-typescript" npm run workflow
```