Skip to content

Commit

Permalink
Agent tutorials: Move binary images to GCS and update metadata (grafa…
Browse files Browse the repository at this point in the history
…na#4711)

* Update metadata  and move images to GCS

* Update metadata

* Move binary assets to GCS and relink

* Delete unused binary image

* Simplify description text
  • Loading branch information
clayton-cornell committed Aug 4, 2023
1 parent 6f885c9 commit 52d855e
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 12 deletions.
Binary file not shown.
Binary file removed docs/sources/flow/tutorials/assets/comp_info.png
Binary file not shown.
Binary file removed docs/sources/flow/tutorials/assets/filter.png
Binary file not shown.
Binary file removed docs/sources/flow/tutorials/assets/graph.png
Binary file not shown.
Binary file removed docs/sources/flow/tutorials/assets/multiple.png
Binary file not shown.
Binary file removed docs/sources/flow/tutorials/assets/scrape_v2.png
Binary file not shown.
Binary file removed docs/sources/flow/tutorials/assets/transition.png
Binary file not shown.
10 changes: 7 additions & 3 deletions docs/sources/flow/tutorials/chaining.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
canonical: https://grafana.com/docs/agent/latest/flow/tutorials/chaining/
title: Chaining Prometheus components
description: Learn how to chain Prometheus components
title: Chain Prometheus components
menuTitle: Chain Prometheus components
aliases:
- ./chaining/
weight: 400
---

# Chaining Prometheus components
# Chain Prometheus components

This tutorial shows how to use [multiple-inputs.river](../assets/flow_configs/multiple-inputs.river) to send data to several different locations. This tutorial uses the same base as [Filtering metrics]({{< relref "filtering-metrics.md">}}).

Expand Down Expand Up @@ -68,4 +72,4 @@ In the above Flow block, `prometheus.relabel.service` is being forwarded metrics

In `multiple-input.river` add a new `prometheus.relabel` component that adds a `version` label with the value of `v2` to all metrics after the `prometheus.relabel.service`.

![](../assets/scrape_v2.png)
![Add a new label with the value v2](/media/docs/agent/screenshot-grafana-agent-chaining-scrape-v2.png)
14 changes: 9 additions & 5 deletions docs/sources/flow/tutorials/collecting-prometheus-metrics.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
canonical: https://grafana.com/docs/agent/latest/flow/tutorials/collecting-prometheus-metrics/
title: Collecting Prometheus metrics
description: Learn how to collect Prometheus metrics
title: Collect Prometheus metrics
menuTitle: Collect Prometheus metrics
aliases:
- ./collecting-prometheus-metrics/
weight: 200
---

# Collecting Prometheus metrics
# Collect Prometheus metrics

Grafana Agent is a telemetry collector with the primary goal of moving telemetry data from one location to another. In this tutorial, you'll set up a Grafana Agent in Flow mode.

Expand All @@ -24,18 +28,18 @@ The `runt.sh` script does:

Allow the Grafana Agent to run for two minutes, then navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22agent_build_info%7B%7D%22%7D%5D).

![](../assets/agent_build_info.png)
![Dashboard showing agent_build_info metrics](/media/docs/agent/screenshot-grafana-agent-collect-metrics-build-info.png)

This example scrapes the Grafana Agent's `http://localhost:12345/metrics` endpoint and pushes those metrics to the Mimir instance.

Navigate to `http://localhost:12345/graph` to view the Grafana Agent Flow UI.

![](../assets/graph.png)
![The Grafana Agent UI](/media/docs/agent/screenshot-grafana-agent-collect-metrics-graph.png)

The Agent displays the component pipeline in a dependency graph. See [Scraping component](#scraping-component) and [Remote Write component](#remote-write-component) for details about the components used in this configuration.
Click the nodes to navigate to the associated component page. There, you can view the state, health information, and, if applicable, the debug information.

![](../assets/comp_info.png)
![Component information](/media/docs/agent/screenshot-grafana-agent-collect-metrics-comp-info.png)

## Scraping component

Expand Down
12 changes: 8 additions & 4 deletions docs/sources/flow/tutorials/filtering-metrics.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
canonical: https://grafana.com/docs/agent/latest/flow/tutorials/filtering-metrics/
title: Filtering Prometheus metrics
description: Learn how to filter Prometheus metrics
title: Filter Prometheus metrics
menuTitle: Filter Prometheus metrics
aliases:
- ./filtering-metrics/
weight: 300
---

# Filtering Prometheus metrics
# Filter Prometheus metrics

In this tutorial, you'll add a new component [prometheus.relabel]({{< ref "../reference/components/prometheus.relabel.md" >}}) using [relabel.river](../assets/flow_configs/relabel.river) to filter metrics. This tutorial uses the same base as [Collecting Prometheus metrics]({{< relref "./collecting-prometheus-metrics.md">}}).

Expand All @@ -25,7 +29,7 @@ The `runt.sh` script does:

Allow the Grafana Agent to run for two minutes, then navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22agent_build_info%7B%7D%22%7D%5D) page and the `service` label will be there with the `api_server` value.

![](../assets/filter.png)
![Dashboard showing api_server](/media/docs/agent/screenshot-grafana-agent-filtering-metrics-filter.png)

## What's happening?

Expand All @@ -37,4 +41,4 @@ Allow the Grafana Agent to run for two minutes, then navigate to [Grafana](http:

Open the `relabel.river` file that was downloaded and change the name of the service to `api_server_v2`, then run `bash ./runt.sh relabel.river`. Allow the Grafana Agent to run for two minutes, then navigate to [Grafana](http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Mimir%22,%7B%22refId%22:%22A%22,%22instant%22:true,%22range%22:true,%22exemplar%22:true,%22expr%22:%22agent_build_info%7B%7D%22%7D%5D) page, and the new label will be updated. The old value `api_server` may still show up in the graph but hovering over the lines will show that that value stopped being scraped and was replaced with `api_server_v2`.

![](../assets/transition.png)
![Updated dashboard showing api_server_v2](/media/docs/agent/screenshot-grafana-agent-filtering-metrics-transition.png)

0 comments on commit 52d855e

Please sign in to comment.