Synthetic Monitoring
Browser monitors, HTTP monitors, synthetic locations.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace Managed Synthetic HTTP Tests with JWT Token Chaining

GuyHalfon
Frequent Guest

Hi,

One of our customers is implementing HTTP synthetic tests that rely on a JWT token with a 5-minute lifespan.

Within a single test execution, all requests must use a valid token. When the token expires, it can only be refreshed using the most recently issued token (token chaining is strictly required).

The challenge is that synthetic test executions are stateless, so each run does not have access to the last token generated in the previous run, and there’s no built-in way to persist or share tokens between executions.

Is there a recommended way to handle this scenario?

Thanks!

3 REPLIES 3

HannahM
Dynatrace Guru
Dynatrace Guru

If you need to use the token for multiple requests in the same monitor, you can use variables to pass it between the requests. See https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/http-monitors-classi...
To persist between monitor executions, you'd be best using the credential vault. See https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/http-monitors-classi...

Synthetic SME and community advocate.

Hi HannahM,

We created a Synthetic HTTP monitor with multiple sequential requests.

In the first request, we retrieve the latest token from the Credential Vault, perform a refresh request, and then save the new token back to the vault for use in the next runs. The refresh works only with the latest token, so it’s critical that it gets updated each time.

However, after several runs, it seems the new token is not always saved, and the next execution uses an outdated token that no longer works.

Could there be a limitation on how frequently the Credential Vault can be updated, or a delay in persisting the new value? Or is this something we might be missing in our implementation?

Thanks.

Is it possible that one execution hasn't finished and updated the token before the next execution is picked up to be run? The CV token for the first request is retrieved when the monitor is picked up by the ActiveGate for execution, so if there isn't much time between executions, this could affect the token value retrieved. If you space the executions so there can be no overlaps, does this resolve the behavior?

Synthetic SME and community advocate.

Featured Posts