Monitor Missions and Campaigns
This is a guide to monitoring missions and campaigns.
Monitor Runtime progress
Runtime may be monitored in the following ways:
View the KPI measure of the Mission goals in the Campaign Dashboard display. As the Mission runs the score should trend upward since the model is continuously trained to ensure optimal results. (See details below)
NOTE
If you have not configured a static Connection/Data Source/Profile with the feedback attributes, the Campaign Dashboard will NOT display an initial KPI measure. Instead, an error will be displayed until the first Cohort subset completes the runtime cycle, creating the system-generated feedback Connection/Data Source/Profile and returning the data that can be used to calculate the KPI.
View the system-generated Feedback Profile list-view that shows a unique count of the Profiles that have been cycled through. (Be sure to view the feedback profile that is created by the system durning runtime.)
Query the
activationID
(described below) to view the runtime status. The status remains as "PENDING" until all Cohort Profiles have been cycled through.Run the "Monitor Mission Execution" (Python Lib) scripts provided below.
View the Campaign Dashboard
After you have run a simulation or deployed a campaign, you can monitor its progress toward the KPI in the Campaign Dashboard in Console.
NOTE
Only the latest simulation or runtime data is reflected on the Dashboard.
- Log in to Fabric Console.
- Verify that the Project context is correct, and select a new Project if necessary. Click the Project button at the top of the left navigation panel and in the Projects list modal click the name of the Project under which the Campaign you wish to monitor is scoped.
- Click Campaigns in the left navigation panel.
- A list of Campaign tiles is displayed. Click the Campaign tile you wish to monitor.
- The Campaign summary (Cohorts, Goals, and Missions) tab opens by default. Above the Campaign component tiles, the SUMMARY and DASHBOARD tabs are displayed. Click DASHBOARD.
- The Dashboard display includes the following for active missions:
- The Campaign Name and Description
- The Mission status (in the orange pill):
- In Progress (KPI details reflect simulation results)
- Deployed (KPI details reflect deployment results)
- The Campaign Goal
- KPI details for the last simulation or deployment that include:
- KPI status (in the green pill)
- On Track
- At Risk
- The KPI percent achieved (in large font)
- The (daily, weekly, monthly, or yearly) target (specified in the KPI configuration)
- The (daily, weekly, monthly, or yearly) change from the last simulation or deployment run: + or - a percent of change
- The Cohort associated with the KPI (specified in the KPI configuration)
- KPI status (in the green pill)
Query Activation
As with any Cortex Fabric Agent, when the actions are complete the ActivationId
and success
boolean are returned.
To query the details of the activation run:
Response:
Monitor Mission Execution Scripts
Run the following python query:
import requestsimport pandas as pdimport cortex.utils as utilsimport urllib3urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)# get current config using default profilefabric_config = utils.get_cortex_profile()# generate a JWTtoken = utils.generate_token(fabric_config)project = 'myProject'requestId = 'xxxxx'baseurl = f'{fabric_config.get("url")}/fabric/v4/projects/{project}/activations'headers = {'content-type': 'application/json','Authorization': f'bearer {token}'}def getActivation(id):url = f'{baseurl}/{id}'r = requests.get(url, headers = headers, params={'report': True}, verify=False, allow_redirects=False);return r.json()def getInvoked(id):query = {'correlationId': id,'limit': 10000}r = requests.get(baseurl, headers = headers, params = query, verify=False, allow_redirects=False);return r.json()def printRun(id, tab):activation = getActivation(id)if not activation["success"]:print(activation["message"])exit(1)print(f'{tab}{activation["status"]} {id}')for t in activation["transits"]:print(f'{tab}- {t["title"]} {t["name"]} {t["status"]}')next = getInvoked(id)for i in next["activations"]:printRun(i["activationId"], tab+" ")printRun(requestId, "")Where:
project
is your Project name.requesId
is the activationId you want query.limit
is the number of records you want to view.
Example Response:
Click to view the Example Response
- Next,
grep
the processor-gateway logs by running the following command:
NOTE: When you have some sort of controller in k8s, (e.g. Deployment/Job/Replicaset/CronJob) the resource used by the controller contains a template, which is used to spawn pods. The hash is the unique identifier that the k8s controller creates to track the pods internally. For example deployment.apps/cortex-processor-gateway creates replicaset replicaset.apps/cortex-processor-gateway-765c78d9fb which then creates pods.
In k8s you can find the hashes displayed like this:
namespace | pod | # of pods | status | # commpleted | elapsed time |
---|---|---|---|---|---|
cortex | pod/cortex-processor-gateway-765c78d9fb-cdpcv | 2/2 | Running | 0 | 18h |
cortex | pod/cortex-processor-gateway-765c78d9fb-p5fnh | 2/2 | Running | 0 | 18h |
cortex | pod/cortex-processor-gateway-765c78d9fb-zkps9 | 2/2 | Running | 0 | 6d15h |
Example Response