# Metrics ctlfish obtains and exposes multiple metrics from your locally running or cloud-based cluster. Below is an explanation of each of those metrics and what they indicate. ### Note about JSON payload output It is important to note that each of the metrics detailed below are outputted into stdout in raw JSON format. If you would like to visualized the JSON in an easy to interpret manner, use [ this tool ](http://jsonviewer.stack.hu/). Simply input a valid JSON payload into the *Text* box and click *view* to see a break-down of the payload. The information below lists off the name of a few key metrics and then the end text indicates where you can find that metric in the JSON payload. The payload exposes more metrics beyond this, but the ones below are the most useful ones. ### Things to Keep In Mind - Quite a few metrics that were not deemed as critical are not listed below, so there is a lot more information exposed beyond what is below. - Several metrics have overlapping data (they exposed similarly named metrics), the best way to figure out what you are working with is to check ***jsonPayload.metadata.annotations.kubectl_kubernetes_io_last_applied_configuration*** and note the "kind." - CronJob and Job metrics are more difficult to navigate through compared to others so it may take time to get comfortable using those. - Some metrics may not be populated until those metrics are hit at least once. Ex: No daemonset information will show up until there is at least one daemonset. ## Pod Information Pod Information exposes multiple metrics that you may find useful. None of them are particularly critical on their own beyond pod name ***jsonPayload.name***, any others you would like to obtain can be found by exploring the schema and stdout. ## Usage Information Usage Information only lists off 2 metrics, mentioned here: - *cpu_usage*: The number of cores used in Nanocores ***jsonPayload.cpu.value*** - *memory_usage*: The amount of memory used in Kilobytes (Ki) or Millibytes (Mi) ***jsonPayload.mem.value*** ## Deployment Information Multiple metrics are exposed with Deployment Information, and the 12 key ones are: - *kube_deployment_created*: Unix creation timestamp ***jsonPayload.metadata.creationtimestamp*** - *kube_deployment_status_replicas*: The number of replicas per deployment ***jsonPayload.status.replicas*** - *kube_deployment_status_replicas_available*: The number of available replicas per deployment ***jsonPayload.status.availablereplicas*** - *kube_deployment_status_replicas_unavailable*: The number of unavailable replicas per deployment ***jsonPayload.status.unavailablereplicas*** - *kube_deployment_status_replicas_updated*: The number of updated replicas per deployment ***jsonPayload.status.updatedreplicas*** - *kube_deployment_status_observed_generation*: The generation observed by the deployment controller ***jsonPayload.status.observedgeneration*** - *kube_deployment_status_condition*: The current status conditions of a deployment ***jsonPayload.status.conditions.type*** - *kube_deployment_spec_replicas*: Number of desired pods for a deployment ***jsonPayload.spec.replicas*** - *kube_deployment_spec_paused*: Whether the deployment is paused and will not be processed by the deployment controller ***jsonPayload.paused*** - *kube_deployment_spec_strategy_rollingupdate_max_unavailable*: Maximum number of unavailable replicas during a rolling update of a deployment ***jsonPayload.spec.strategy.rollingupdate.maxunavailable*** - *kube_deployment_spec_strategy_rollingupdate_max_surge*: Maximum number of replicas that can be scheduled above the desired number of replicas during a rolling update of a deployment ***jsonPayload.spec.strategy.rollingupdate.maxsurge*** - *kube_deployment_metadata_generation*: Sequence number representing a specific generation of the desired state ***jsonPayload.metadata.generation*** ## CronJob Information Multiple metrics are exposed with CronJob Information, and the 5 key ones are: - *kube_cronjob_info*: Info about cronjob ***jsonPayload.spec.schedule//jsonPayload.spec.concurrencypolicy*** - *kube_cronjob_created*: Unix creation timestamp ***jsonPayload.metadata.creationtimestamp*** - *kube_cronjob_status_last_schedule_time*: LastScheduleTime keeps information of when was the last time the job was successfully scheduled ***jsonPayload.status.lastscheduletime*** - *kube_cronjob_spec_suspend*: Suspend flag tells the controller to suspend subsequent executions ***jsonPayload.spec.suspend*** - *kube_cronjob_metadata_resource_version*: Resource version representing a specific version of the cronjob ***jsonPayload.metadata.resourceversion*** ## StatefulSet Information Multiple metrics are exposed with StatefulSet Information, and the 10 key ones are: - *kube_statefulset_created*: Unix creation timestamp ***jsonPayload.metadata.creationtimestamp*** - *kube_statefulset_status_replicas*: The number of replicas per StatefulSet ***jsonPayload.status.replicas*** - *kube_statefulset_status_replicas_current*: The number of current replicas per StatefulSet ***jsonPayload.status.currentreplicas*** - *kube_statefulset_status_replicas_ready*: The number of ready replicas per StatefulSet ***jsonPayload.status.readyreplicas*** - *kube_statefulset_status_replicas_updated*: The number of updated replicas per StatefulSet ***jsonPayload.status.updatedreplicas*** - *kube_statefulset_status_observed_generation*: The generation observed by the StatefulSet controller ***jsonPayload.status.observedgeneration*** - *kube_statefulset_replicas*: Number of desired pods for a StatefulSet ***jsonPayload.spec.replicas*** - *kube_statefulset_metadata_generation*: Sequence number representing a specific generation of the desired state for the StatefulSet ***jsonPayload.metadata.generation*** - *kube_statefulset_status_current_revision*: Indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas) ***jsonPayload.status.currentrevision*** - *kube_statefulset_status_update_revision*: Indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas) ***jsonPayload.status.updaterevision*** ## DaemonSet Information Multiple metrics are exposed with DaemonSet Information, and the 10 key ones are: - *kube_daemonset_created*: Unix creation timestamp ***jsonPayload.metadata.creationtimestamp*** - *kube_daemonset_status_current_number_scheduled*: The number of nodes running at least one daemon pod and are supposed to ***jsonPayload.status.currentnumberscheduled*** - *kube_daemonset_status_desired_number_scheduled*: The number of nodes that should be running the daemon pod ***jsonPayload.status.desirednumberscheduled*** - *kube_daemonset_status_number_available*: The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available ***jsonPayload.status.numberavailable*** - *kube_daemonset_status_current_number_misscheduled*: The number of nodes running a daemon pod but are not supposed to ***jsonPayload.status.numbermisscheduled*** - *kube_daemonset_status_number_ready*: The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready ***jsonPayload.status.numberready*** - *kube_daemonset_status_number_unavailable*: The number of nodes that should be running the daemon pod and have none of the daemon pod running and available ***jsonPayload.status.numberunavailable*** - *kube_daemonset_status_observed_generation*: The most recent generation observed by the daemon set controller ***jsonPayload.status.observedgeneration*** - *kube_daemonset_status_updated_number_scheduled*: The total number of nodes that are running updated daemon pod ***jsonPayload.status.updatednumberscheduled*** - *kube_daemonset_metadata_generation*: Sequence number representing a specific generation of the desired state ***jsonPayload.metadata.generation*** ## Job Information Multiple metrics are exposed with Job Information, and the 8 key ones are: - *kube_job_name*: Name of the job ***jsonPayload.metadata.labels.job_name*** - *kube_job_created*: Unix creation timestamp ***jsonPayload.metadata.creationtimestamp*** - *kube_job_spec_parallelism*: The maximum desired number of pods the job should run at any given time ***jsonPayload.spec.parallelism*** - *kube_job_spec_completions*: The desired number of successfully finished pods the job should be run with ***jsonPayload.spec.completions*** - *kube_job_status_succeded*: The number of pods which reached Phase Succeeded ***jsonPayload.status.succeeded*** - *kube_job_status_terminated_reason*: The reason the job finished ***jsonPayload.status.containerstatuses.state.terminated.reason*** - *kube_job_status_start_time*: StartTime represents time when the job was acknowledged by the Job Manager ***jsonPayload.status.starttime*** - *kube_job_status_completion_time*: CompletionTime represents time when the job was completed ***jsonPayload.status.completiontime*** ## Event Information Multiple metrics are exposed with Event Information, and the 4 key ones are: - *kube_event_type*: A categorization about the type of event (error, normal, etc...) ***jsonPayload.type*** - *kube_event_reason*: A quick reason about why the event happened ***jsonPayload.reason*** - *kube_event_note*: An easily readable note about the event and key information ***jsonPayload.note*** - *kube_event_kind_regarding*: The kind of item the event is in regards to ***jsonPayload.regarding.kind***