# Prometheus agent

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fintegrations%2Fprometheus%2Fprometheus-agent.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fintegrations%2Fprometheus%2Fprometheus-agent.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

[Prometheus Agent](https://prometheus.io/blog/2021/11/16/agent/) is an operational mode built into the [Prometheus](https://prometheus.io/) binary that does one job: scrape metrics and remote-write them. Querying and alerting are switched off, which is exactly what you want when Coralogix is where the querying happens.

Agent mode buys you:

* Scraping and forwarding only, with querying and alerting disabled.
* Easier horizontal scaling for ingestion than server mode.
* A purpose-built TSDB write-ahead log in place of local storage.

## What you need [​](#what-you-need- "Direct link to what-you-need-")

* A Coralogix account on the [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md) matching the region your data should be stored in. [Sign up](https://signup.coralogix.com/#/) if you do not have one.
* A Coralogix [Send-Your-Data API key](https://coralogix.com/docs/user-guides/account-management/api-keys/send-your-data-api-key.md).
* The [Prometheus Operator](https://coralogix.com/docs/integrations/prometheus/prometheus-operator.md) installed and configured, at **v0.59.0 or later**. Agent mode collects ServiceMonitors and PodMonitors, which exist only under the Operator, and earlier Operator versions do not support agent mode at all.
* The Prometheus RemoteWrite [endpoint](https://coralogix.com/docs/integrations/coralogix-endpoints.md) for your domain. Use the domain selector at the top of this page to resolve it:
  <!-- -->
  https\://ingress./prometheus/v1

## Store the API key as a secret [​](#store-the-api-key-as-a-secret- "Direct link to store-the-api-key-as-a-secret-")

Keeping the key in a Kubernetes secret keeps it out of your chart values and out of anything you commit.

```
kubectl create secret generic coralogix-keys \

  --from-literal=PRIVATE_KEY=<private-key>
```

The result looks like this:

```
apiVersion: v1

data:

  PRIVATE_KEY: <encrypted-private-key>

kind: Secret

metadata:

  name: coralogix-keys

  namespace: <the-release-namespace>

type: Opaque
```

Warning

The secret and the Helm release must live in the same namespace. A secret in another namespace is invisible to the chart, and the agent starts but never authenticates.

## Install the chart [​](#install-the-chart- "Direct link to install-the-chart-")

1

<!-- -->

.

Add the Coralogix Helm repository

Add the repository and refresh the local chart index:

```
helm repo add coralogix-charts-virtual https://cgx.jfrog.io/artifactory/coralogix-charts-virtual

helm repo update
```

2

<!-- -->

.

Create an override file

Set the remote write target to the Prometheus RemoteWrite endpoint for your domain:

```
---

# override.yaml

prometheus:

  prometheusSpec:

    remoteWrite:

    - authorization:

        credentials:

          name: coralogix-keys

          key: PRIVATE_KEY

      name: prometheus-agent-coralogix

      queueConfig:

        capacity: 2500

        maxSamplesPerSend: 1000

        maxShards: 200

      remoteTimeout: 120s

      url: https://ingress.eu2.coralogix.com/prometheus/v1
```

3

<!-- -->

.

Install

Install or upgrade the release:

```
helm upgrade prometheus-agent coralogix-charts-virtual/prometheus-agent-coralogix \

  --install \

  --namespace=<your-namespace> \

  --create-namespace \

  -f override.yaml
```

## Use a persistent volume in production [​](#use-a-persistent-volume-in-production- "Direct link to use-a-persistent-volume-in-production-")

The agent defaults to ephemeral volumes, which lose buffered samples on restart. Define a persistent volume in your values file instead.

```
prometheus:

  prometheusSpec:

    storageSpec:

      volumeClaimTemplate:

        spec:

          accessModes: ["ReadWriteOnce"]

          resources:

            requests:

              storage: 50Gi
```

Omitting `storageClassName` makes Kubernetes use the cluster's default storage class.

## Limits and quotas [​](#limits-and-quotas- "Direct link to limits-and-quotas-")

These limits apply per request, regardless of the period the request covers.

| Endpoint               | Hard limit      | Recommended                   |
| ---------------------- | --------------- | ----------------------------- |
| OpenTelemetry          | 10 MB           | 2 MB                          |
| Prometheus RemoteWrite | 2,411,724 bytes | Anything below the hard limit |

## Related resources[​](#related-resources "Direct link to Related resources")

[Prometheus Operator](https://coralogix.com/docs/integrations/prometheus/prometheus-operator.md)[Coralogix endpoints](https://coralogix.com/docs/integrations/coralogix-endpoints.md)[Send-Your-Data API key](https://coralogix.com/docs/user-guides/account-management/api-keys/send-your-data-api-key.md)
