---
title: "License metrics"
description: "Monitor Calico Enterprise license metrics such as nodes used, nodes available, and days until license expires."
product: "Calico Enterprise"
version: "3.21"
section: "Operations"
canonical_url: "https://docs.tigera.io/calico-enterprise/3.21/operations/monitor/metrics/license-agent"
---

# License metrics

## Big picture

Use the Prometheus monitoring and alerting tool to get Calico Enterprise license metrics.

## Value

Platform engineering teams need to report licensing usage on third-party software (like Calico Enterprise) for their CaaS/Kubernetes platforms. This is often driven by compliance, but also to mitigate risks from license expiration or usage that may impact operations. For teams to easily access these vital metrics, Calico Enterprise provides license metrics using the Prometheus monitoring and alerting tool.

## Concepts

### About Prometheus

The Prometheus monitoring tool scrapes metrics from instrumented jobs and displays time series data in a visualizer (such as Grafana). For Calico Enterprise, the “jobs” that Prometheus can harvest metrics from the License Agent component.

### About License Agent

The **License Agent** is a containerized application that monitors the following Calico Enterprise licensing information from the Kubernetes cluster, and exports the metrics through the Prometheus server:

- Days till expiration

### FAQ

### How long does it take to get a new Calico Enterprise license?

After you submit a sales purchase order to Tigera, 1-2 days.

### Is there a grace period?

Yes, there is a grace period of 30 days (as of April 2022).

### Does the web console display license expiration?

Yes. The license indicator in the web console (top right banner) turns red when the license expires.

![expiration](https://docs.tigera.io/assets/images/expiration-8dbd59696e3a85c6e108f665ae473ca6.png)

### What happens when a license expires or is invalid?

> **WARNING:** Calico Enterprise stops reporting flow logs, DNS logs, and Calico Enterprise metrics, which affects other UI elements like Service Graph and dashboards. Although some elements in the UI may appear to work, actions are not saved. We recommend that you proactively manage your license to avoid disruption.

### Do licenses cover free upgrades in Calico Enterprise?

Yes.

### How do I get information about my license? Monitor the expiration date?

- [Prometheus!](https://docs.tigera.io/calico-enterprise/3.21/operations/monitor/metrics/license-agent.md).
- Use `kubectl` to get [license key information](https://docs.tigera.io/calico-enterprise/3.21/reference/resources/licensekey.md#viewing-information-about-your-license-key)

## How to

- [Add license agent in your Kubernetes cluster](#add-license-agent-in-your-kubernetes-cluster)
- [Create alerts using Prometheus metrics](#create-alerts-using-prometheus-metrics)

### Add license agent in your Kubernetes cluster

To add the license-agent component in a Kubernetes cluster for license metrics, install the pull secret and apply the license-agent manifest.

1. Create a namespace for the license-agent.
   ```text
    kubectl create namespace tigera-license-agent
   ```
2. Install your pull secret.
   ```text
    kubectl create secret generic tigera-pull-secret \
      --type=kubernetes.io/dockerconfigjson -n tigera-license-agent \
      --from-file=.dockerconfigjson=<path/to/pull/secret>
   ```
3. Apply the manifest.
   ```text
    kubectl apply -f https://downloads.tigera.io/ee/v3.21.9/manifests/licenseagent.yaml
   ```

### Create alerts using Prometheus metrics

In the following example, an alert is configured when the license expiry is fewer than 15 days.

```yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: calico-prometheus-license
  namespace: tigera-prometheus
  labels:
    role: tigera-prometheus-rules
    prometheus: calico-node-prometheus
spec:
  groups:
    - name: tigera-license.rules
      rules:
        - alert: CriticalLicenseExpiry
          expr: license_number_of_days < 15
          labels:
            severity: Warning
          annotations:
            summary: 'Calico Enterprise License expires in less than 15 days'
            description: 'Calico Enterprise License expires in less than 15 days'
```

> **SECONDARY:** If the Kubernetes api-server serves on any port other than 6443 or 443, add that port in the Egress policy of the license agent manifest.

## Additional resources

- [LicenseKey resource](https://docs.tigera.io/calico-enterprise/3.21/reference/resources/licensekey.md)
- [Configure Alertmanager](https://docs.tigera.io/calico-enterprise/3.21/operations/monitor/prometheus/alertmanager.md)
