---
title: "Gets the health of the specified Service Fabric partition, by using the specified health policy."
method: POST
path: "/Partitions/{partitionId}/$/GetHealth"
tags: ["Partition"]
---

# Gets the health of the specified Service Fabric partition, by using the specified health policy.

`POST /Partitions/{partitionId}/$/GetHealth`

Gets the health information of the specified partition.
If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
If the policy is not specified, the health evaluation uses the application health policy defined in the application manifest, or the default health policy, if no policy is defined in the manifest.
Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health state.
Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health.
If you specify a partition that does not exist in the health store, this request returns an error.

## Path parameters

- `partitionId` string, uuid, required

## Query parameters

- `api-version` '6.0', required
- `EventsHealthStateFilter` integer
- `ReplicasHealthStateFilter` integer
- `ExcludeHealthStatistics` boolean
- `timeout` integer

## Request body

- ApplicationHealthPolicy — Defines a health policy used to evaluate the health of an application or one of its children entities.
  - `ConsiderWarningAsError` boolean — Indicates whether warnings are treated with the same severity as errors.
  - `MaxPercentUnhealthyDeployedApplications` integer — The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.
  - `DefaultServiceTypeHealthPolicy` ServiceTypeHealthPolicy — Represents the health policy used to evaluate the health of services belonging to a service type.
    - `MaxPercentUnhealthyPartitionsPerService` integer — The maximum allowed percentage of unhealthy partitions per service. Allowed values are Byte values from zero to 100 The percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered in error. If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. The computation rounds up to tolerate one failure on small numbers of partitions. Default percentage is zero.
    - `MaxPercentUnhealthyReplicasPerPartition` integer — The maximum allowed percentage of unhealthy replicas per partition. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered in error. If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. The computation rounds up to tolerate one failure on small numbers of replicas. Default percentage is zero.
    - `MaxPercentUnhealthyServices` integer — The maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero.
  - `ServiceTypeHealthPolicyMap` ServiceTypeHealthPolicyMapItem[] — Defines a ServiceTypeHealthPolicy per service type name. The entries in the map replace the default service type health policy for each specified service type. For example, in an application that contains both a stateless gateway service type and a stateful engine service type, the health policies for the stateless and stateful services can be configured differently. With policy per service type, there's more granular control of the health of the service. If no policy is specified for a service type name, the DefaultServiceTypeHealthPolicy is used for evaluation.
    - `Key` string, required — The key of the service type health policy map item. This is the name of the service type.
    - `Value` ServiceTypeHealthPolicy, required — Represents the health policy used to evaluate the health of services belonging to a service type.
      - `MaxPercentUnhealthyPartitionsPerService` integer — The maximum allowed percentage of unhealthy partitions per service. Allowed values are Byte values from zero to 100 The percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered in error. If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. The computation rounds up to tolerate one failure on small numbers of partitions. Default percentage is zero.
      - `MaxPercentUnhealthyReplicasPerPartition` integer — The maximum allowed percentage of unhealthy replicas per partition. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered in error. If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. The computation rounds up to tolerate one failure on small numbers of replicas. Default percentage is zero.
      - `MaxPercentUnhealthyServices` integer — The maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero.

## Response `200`

A successful operation will return 200 status code and the health information about the specified partition.

- PartitionHealth — Health information common to all entities in the cluster. It contains the aggregated health state, health events and unhealthy evaluation.
  - `AggregatedHealthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown' — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
  - `HealthEvents` HealthEvent[] — The list of health events reported on the entity.
    - `SourceId` string, required — The source name that identifies the client/watchdog/system component that generated the health information.
    - `Property` string, required — The property of the health information. An entity can have health reports for different properties. The property is a string and not a fixed enumeration to allow the reporter flexibility to categorize the state condition that triggers the report. For example, a reporter with SourceId "LocalWatchdog" can monitor the state of the available disk on a node, so it can report "AvailableDisk" property on that node. The same reporter can monitor the node connectivity, so it can report a property "Connectivity" on the same node. In the health store, these reports are treated as separate health events for the specified node. Together with the SourceId, the property uniquely identifies the health information.
    - `HealthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown', required — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
    - `TimeToLiveInMilliSeconds` string, duration — The duration for which this health report is valid. This field uses ISO8601 format for specifying the duration. When clients report periodically, they should send reports with higher frequency than time to live. If clients report on transition, they can set the time to live to infinite. When time to live expires, the health event that contains the health information is either removed from health store, if RemoveWhenExpired is true, or evaluated at error, if RemoveWhenExpired false. If not specified, time to live defaults to infinite value.
    - `Description` string — The description of the health information. It represents free text used to add human readable information about the report. The maximum string length for the description is 4096 characters. If the provided string is longer, it will be automatically truncated. When truncated, the last characters of the description contain a marker "[Truncated]", and total string size is 4096 characters. The presence of the marker indicates to users that truncation occurred. Note that when truncated, the description has less than 4096 characters from the original string.
    - `SequenceNumber` string — The sequence number for this health report as a numeric string. The report sequence number is used by the health store to detect stale reports. If not specified, a sequence number is auto-generated by the health client when a report is added.
    - `RemoveWhenExpired` boolean — Value that indicates whether the report is removed from health store when it expires. If set to true, the report is removed from the health store after it expires. If set to false, the report is treated as an error when expired. The value of this property is false by default. When clients report periodically, they should set RemoveWhenExpired false (default). This way, if the reporter has issues (e.g. deadlock) and can't report, the entity is evaluated at error when the health report expires. This flags the entity as being in Error health state.
    - `HealthReportId` string — A health report ID which identifies the health report and can be used to find more detailed information about a specific health event at aka.ms/sfhealthid
  - `UnhealthyEvaluations` HealthEvaluationWrapper[] — List of health evaluations that resulted in the current aggregated health state.
    - `HealthEvaluation` HealthEvaluation — Represents a health evaluation which describes the data and the algorithm used by health manager to evaluate the health of an entity.
      - `Kind` 'Invalid' | 'Event' | 'Replicas' | 'Partitions' | 'DeployedServicePackages' | 'DeployedApplications' | 'Services' | 'Nodes' | 'Applications' | 'SystemApplication' | 'UpgradeDomainDeployedApplications' | 'UpgradeDomainNodes' | 'Replica' | 'Partition' | 'DeployedServicePackage' | 'DeployedApplication' | 'Service' | 'Node' | 'Application' | 'DeltaNodesCheck' | 'UpgradeDomainDeltaNodesCheck' | 'ApplicationTypeApplications' | 'NodeTypeNodes', required — The health manager in the cluster performs health evaluations in determining the aggregated health state of an entity. This enumeration provides information on the kind of evaluation that was performed. Following are the possible values.
      - `AggregatedHealthState` 'Invalid' | 'Ok' | 'Warning' | 'Error' | 'Unknown' — The health state of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
      - `Description` string — Description of the health evaluation, which represents a summary of the evaluation process.
  - `HealthStatistics` HealthStatistics — The health statistics of an entity, returned as part of the health query result when the query description is configured to include statistics. The statistics include health state counts for all children types of the current entity. For example, for cluster, the health statistics include health state counts for nodes, applications, services, partitions, replicas, deployed applications and deployed service packages. For partition, the health statistics include health counts for replicas.
    - `HealthStateCountList` EntityKindHealthStateCount[] — List of health state counts per entity kind, which keeps track of how many children of the queried entity are in Ok, Warning and Error state.
      - `EntityKind` 'Invalid' | 'Node' | 'Partition' | 'Service' | 'Application' | 'Replica' | 'DeployedApplication' | 'DeployedServicePackage' | 'Cluster' — The entity type of a Service Fabric entity such as Cluster, Node, Application, Service, Partition, Replica etc.
      - `HealthStateCount` HealthStateCount — Represents information about how many health entities are in Ok, Warning and Error health state.
        - `OkCount` integer — The number of health entities with aggregated health state Ok.
        - `WarningCount` integer — The number of health entities with aggregated health state Warning.
        - `ErrorCount` integer — The number of health entities with aggregated health state Error.

## Other responses

- `default` — The detailed error response.

---

[API](https://skmtc.net/azure/apis/servicefabric-servicefabric.md) · [All operations](https://skmtc.net/azure/apis/servicefabric-servicefabric/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/servicefabric-servicefabric/revisions/8fd479ce0f16/schema)
