# License Key

Pipekit will not function without a valid license key. You can obtain a license key and the associated terms by contacting us at <hello@pipekit.io> or through your Slack support channel.

Without a valid key, users will be prevented from authenticating with Pipekit, and the Pipekit Agent will not be able to communicate with the Pipekit service.

## Applying the License Key

To apply the license key, you will need to set the `global.licenseKey` value in your Helm Chart to the key provided by Pipekit.

## Monitoring for License Expiry

The `users` service within the Pipekit deployment will output the number of seconds until the license expires, as a metric. You can monitor this metric to ensure that your license does not expire. Metrics for the users service are available at the `/metrics` endpoint of the users service on port 9090.

### Example Prometheus Rules

The example below will issue a warning alert when your Pipekit license is due to expire in 30 days, and a critical alert if within 14 days. You can adjust the `expr` field to change the number of days before expiry that the alert is triggered.

```yaml
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: pipekit-license-expiry
spec:
  groups:
    - name: pipekit-license
      rules:
        - alert: expiresIn90Days
          annotations:
            description: "The license key for your Pipekit installation will expire in less than 30 days. Please renew the license key to avoid any disruptions. Email hello@pipekit.io for more information."
            summary: The Pipekit license key will expire in less than 30 days.
          expr: |-
            users_license_seconds_until_expiration / 86400 > 30
          labels:
            severity: warning
        - alert: expiresIn14Days
          annotations:
            description: "The license key for your Pipekit installation will expire in less than 14 days. Please renew the license key to avoid any disruptions. Email hello@pipekit.io for more information."
            summary: The Pipekit license key will expire in less than 14 days.
          expr: |-
            users_license_seconds_until_expiration / 86400 > 14
          labels:
            severity: critical
```
