Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 2.93 KB

readme.md

File metadata and controls

79 lines (56 loc) · 2.93 KB

Temporal Sample Metrics Application

This is a simple application has a single workflow that takes an input and runs two activities. The activities fail, causing some retries and then continue along successfully. This is so that the application has some non-zero SDK metrics.

The application uses Spring Boot to do a lot of auto-magic wiring up of components. It uses temporal-spring-boot-autoconfigurator-alpha to auto-configure temporal specific details.

Once the application is up and running, you can access a web page that provides a simple HTML client to start the workflow.

To start a local Temporal Server:

temporal server start-dev

To run this locally, without creating a container:

./gradlew bootRun

You can access the application using http://localhost:8080. Temmporal SDK Metric end point is located at http://localhost:8081/prometheus.

To run this within a Docker container, first build the Docker iamge with the following command:

./buildcontainer.sh

Running the application using your local Temporal Server first set the namespace environment variable:

export TEMPORAL_NAMESPACE=default # change if necessary

Now launch the container with the following command:

./runlocal.sh 

You might need to modify runlocal.sh if you are not using the default namespace. You can access the application using http://localhost:3030. Temmporal SDK Metric end point is located at http://localhost:3031/prometheus.

To run this in Temporal Cloud, you need to first configure your namespace with your MTLs certificates. More information can be found here. You can also use tcld command line to generate and upload your certificates. This blog post is a great tutorial to walk through.

To run this within a Docker container, using Temporal Cloud, set the following environment variables:

export TEMPORAL_ENDPOINT=<NAMESPACE>.tmprl.cloud:7233
export TEMPORAL_NAMESPACE=<NAMESPACE>
export TEMPORAL_CLIENT_KEY="/path/to/your.key"
export TEMPORAL_CLIENT_CERT="/path/to/your/cert.pem"

If you are using self-signed certificates, you can either add your certificate authority public key (.pem) to java default truststore or set the following environment variable:

export TEMPORAL_INSECURE_TRUST_MANAGER="true"

Once the environment variables are set, run the docker image:

./runontc.sh

You can access the application using http://localhost:3030. Temmporal SDK Metric end point is located at http://localhost:3031/prometheus.