> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/observability/monitoring-service/quick-start/send-metrics-to-platform.md).

# Send Metrics to the Platform

You can send metrics to the <code class="expression">space.vars.monitoring\_service</code> using agents such as Fluent Bit, Grafana Agent, Prometheus, and OpenTelemetry Collector.

This Quickstart shows how to create a pipeline, get an API key, and configure one of these agents.

## Prerequisites

* An <code class="expression">space.vars.ionos\_cloud</code> account with permissions to create monitoring pipelines.
* Outbound `HTTPS` access on port 443.
* The required agent or collector must be installed on your system.

Example endpoint:

`123456789-metrics.987654321.monitoring.de-txl.ionos.com`

{% hint style="info" %}
**Note:** To make a final and complete address, add `api/v1/push` to the end of the endpoint. For example: `123456789-metrics.987654321.monitoring.de-txl.ionos.com/api/v1/push`.
{% endhint %}

You can also find Prometheus configuration examples in our [<mark style="color:blue;">GitHub repository</mark>](https://github.com/ionos-cloud/observability-services-user-documentation/tree/main/monitoring).

{% stepper %}
{% step %}

## Create a pipeline

Send a `POST` request to the Monitoring Service API:

```bash
curl -X POST "https://monitoring.de-txl.ionos.com/pipelines"
  -H "Content-Type: application/json" \
  -d '{"name": "example-pipeline"}'
```

The response includes the `httpEndpoint`. Save this value.
{% endstep %}

{% step %}

## API key usage

Use the `API Key` returned when you created the pipeline for authentication.\
You only need to generate a new one in specific cases, such as:

* The key was accidentally shared
* The key was lost
* A team member with access left the company

To generate a new `API key`, run:

```bash
curl -X POST "https://monitoring.de-txl.ionos.com/pipelines/<PIPELINE_ID>/key"
```

This will issue a new `API Key` and replace the previous one.

The final endpoint for sending metrics is:

```perl
https://<HTTP_ENDPOINT>/api/v1/push
```

or

```perl
https://<HTTP_ENDPOINT>/otlp/v1/metrics
```

{% endstep %}
{% endstepper %}

## Configure an agent

Each agent requires the pipeline `httpEndpoint` and `API key`.

{% tabs %}
{% tab title="FluentBit Agent" %}
This example shows how to configure Fluent Bit to send metrics to the Monitoring Service.

1. Install the Fluent Bit package for your distribution.
2. Update the `fluentbit.conf` file with the `HTTP endpoint` and `API key`.
3. Run Fluent Bit.
4. Check the logs to confirm metrics are sent.

```ini
[OUTPUT]
    Name   http
    Match  *
    Host   <pipeline-endpoint-host>
    Port   443
    URI    /
    Header Authorization Bearer <apiKey>
    Format json
```

{% endtab %}

{% tab title="Grafana Agent" %}
You can configure Grafana Agent to send metrics to the monitoring pipeline.

1. Install the Grafana Agent package for your distribution. For more information, refer to the [<mark style="color:blue;">Grafana Documentation</mark>](https://grafana.com/docs/agent/latest/about/).
2. Update the HTTP endpoint and API key in the configuration file.

```river
  prometheus.remote_write "LABEL" {
    endpoint {
      url = "your pipeline's httpEndpoint"

      headers = {
        "APIKEY" = "<API_KEY>",
      }
  }
}
```

{% endtab %}

{% tab title="Prometheus Agent" %}
Prometheus is a monitoring and alerting toolkit designed for reliability and scalability. It is a pull-based system that scrapes metrics from instrumented jobs, either directly or through a push gateway for short-lived jobs.

1. Install the Prometheus package for your distribution.
2. Update the `prometheus.yml` file with the `HTTP endpoint` and `API key`.

```yaml
url: "your pipeline's httpEndpoint"
headers:
  APIKEY: "<APIKEY>"
```

{% endtab %}

{% tab title="OpenTelemetry Agent" %}
OpenTelemetry is a set of APIs, libraries, agents, and instrumentation for observability. It is a [<mark style="color:blue;">Cloud Native Computing Foundation (CNCF)</mark>](/cloud/observability/monitoring-service/monitoring-service-faqs.md#what-is-cloud-native-computing-foundation).

You can send metrics from the OpenTelemetry Collector either as Prometheus remote-write, or natively in the OpenTelemetry Protocol (OTLP) format.

### Prometheus remote-write

1. Install the OpenTelemetry Collector.
2. Update the configuration file with the `HTTP endpoint` and `API key`.

```yaml
exporters:
  prometheusremotewrite:
    endpoint: "your pipeline's httpEndpoint"
    external_labels:
      APIKEY: <API_KEY>
      label_name2: label_value2
```

### Native OTLP

1. Install the OpenTelemetry Collector.
2. Configure the `otlphttp` exporter to point at the pipeline's `/otlp/v1/metrics` endpoint.

```yaml
exporters:
  otlphttp:
    metrics_endpoint: "your pipeline's httpEndpoint/otlp/v1/metrics"
    headers:
      APIKEY: <API_KEY>
```

{% hint style="info" %}
**Note:** OTel exponential histograms sent over OTLP are queryable as Prometheus native histograms in Grafana. For more information, see [<mark style="color:blue;">Metric Formats</mark>](/cloud/observability/monitoring-service/overview/metric-formats.md).
{% endhint %}
{% endtab %}
{% endtabs %}

## Troubleshooting

1. **Verify:** Open the Monitoring Service dashboard and confirm that metrics appear.
2. **Invalid API key:** Check that you copied the correct key.
3. **Connection errors:** Verify outbound `HTTPS` access on port 443.
4. **No metrics displayed:** Confirm that the agent is running and producing data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/observability/monitoring-service/quick-start/send-metrics-to-platform.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
