This is a guide to searching and viewing Agent and Skill runtime logs from the processor-gateway service using kubectl.
Runtime orchestration for Cortex Fabric happens in Kubernetes. System administrators can configure 3rd party logging tools like Splunk, Kibana, or Elasticsearch following the instructions in the Cortex Charts documentation.
If a log aggregator has not been configured, users can view and query unformatted runtime log data coming from the processor-gateway service using kubectl.
- Kubectl is installed
- Agents and/or Skills have been configured and invoked successfully in your Cortex Fabric instance.
Query processor-gateway runtime logs
To get all the stored logs for Agent runtime activations in the processor-gateway service run the following kubectl command:
You can filter your processor-gateway log query by any of the Agent fields provided in the response. The example below filters by Project ID and Agent name.
When you run the kubectl logs command, the following details are returned. (These are the same details returned when you run an Agent in Fabric Console.):
- "activationId" - same as
requestIdidentifier for the output of an Agent
- "agentName" - the unique system name for the Agent or Skill
- "serviceName" - the name of the input service
- "channelId" - the Skill mapping identifier
- "requestId" - the identifier for the processor-gateway run
- "sessionId" - same as the Request ID and Activation ID unless specified in the input payload to get cached session data
- "projectId" - the name of the project the Agent belongs to
- "username" - email of the user who invoked the Agent
- "level" - severity level, either "info" or "warn" ("warn" indicates that an error occurred)
- "label" - the type of event ("agent-events")
- "outputName" - name of the output service
- "inputName "- name of the input service
- "error" - error message if one is applicable
- "payload" - array with the agent/skill input payload
- "properties" - array with the configured agent/skill properties
- "status" - Activation (and Transit) status: PENDING (waiting to run), STARTED (queued to begin), COMPLETE (running or finished), ERROR (not running/not complete)
Filter Query by requestId (activationId)
To query runtime logs for an Agent you may want to filter by
activationId; they are the same). You can get this identifier by querying the CLI.
- Authenticate to the CLI.
- Request a list of Agents from your Project.cortex agents list --project myProject
- Use the name of an Agent from the list to request activationIds (the same as requestIds) for the agent.cortex agents list-activations agentName --project myProject
Log query with filter
Interpret Agent status
The "level" for an Agent is either "info" or "warn". If warn is displayed then a runtime error occurred and an error message may or may not be provided.
You know when an Agent is completed because an "agent.output event" is displayed, as in the example above. When the Agent is in progress, the logs will show one or more "skill.output events" but not an "agent.output event".
List and Describe Skills Statuses
true when you invoke the skill or agent using the
--json parameter to display the skill status when you query the response (with
cortex skills list or
cortex skills describe skillName)
To view a list of skills and their statuses in the CLI run:
To view the details (or description) of a Skill including its statuses in the CLI run:
Skill have the following Deploy statuses:
- Deployed: Saved in Cortex AND running on Kubernetes
- Not deployed: Save in Cortex BUT not running on Kubernetes
In addition, Skill with daemons can have the following Action statuses:
- Ready: Indicates that the web-service is up and running, followed by the number of daemons running over the configured replica count (e.g. (1/1))
- Not ready: Indicates that the service is not running in Kubernetes, followed by the number of daemons running over the configured replica count (e.g. (0/1))