Skip to content

Commit

Permalink
Merge branch 'add_redis_integration_test' of github.com:grafana/agent…
Browse files Browse the repository at this point in the history
… into add_redis_integration_test
  • Loading branch information
marctc committed Feb 1, 2024
2 parents 6d94b93 + 1e6fa6e commit c3154c0
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 306 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Main (unreleased)

- Increased clustering alert periods to 10 minutes to improve the
signal-to-noise ratio in Grafana Agent Mixin. (@thampiotr)

- `mimir.rules.kubernetes` has a new `prometheus_http_prefix` argument to configure
the HTTP endpoint on which to connect to Mimir's API. (@hainenber)

### Bugfixes

Expand Down
9 changes: 5 additions & 4 deletions component/mimir/rules/kubernetes/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ func (c *Component) init() error {
httpClient := c.args.HTTPClientConfig.Convert()

c.mimirClient, err = mimirClient.New(c.log, mimirClient.Config{
ID: c.args.TenantID,
Address: c.args.Address,
UseLegacyRoutes: c.args.UseLegacyRoutes,
HTTPClientConfig: *httpClient,
ID: c.args.TenantID,
Address: c.args.Address,
UseLegacyRoutes: c.args.UseLegacyRoutes,
PrometheusHTTPPrefix: c.args.PrometheusHTTPPrefix,
HTTPClientConfig: *httpClient,
}, c.metrics.mimirClientTiming)
if err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions component/mimir/rules/kubernetes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Arguments struct {
Address string `river:"address,attr"`
TenantID string `river:"tenant_id,attr,optional"`
UseLegacyRoutes bool `river:"use_legacy_routes,attr,optional"`
PrometheusHTTPPrefix string `river:"prometheus_http_prefix,attr,optional"`
HTTPClientConfig config.HTTPClientConfig `river:",squash"`
SyncInterval time.Duration `river:"sync_interval,attr,optional"`
MimirNameSpacePrefix string `river:"mimir_namespace_prefix,attr,optional"`
Expand All @@ -23,6 +24,7 @@ var DefaultArguments = Arguments{
SyncInterval: 30 * time.Second,
MimirNameSpacePrefix: "agent",
HTTPClientConfig: config.DefaultHTTPClientConfig,
PrometheusHTTPPrefix: "/prometheus",
}

// SetToDefault implements river.Defaulter.
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/get-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ weight: 50
# Get started with {{% param "PRODUCT_NAME" %}}

This section covers topics that help you get started with {{< param "PRODUCT_NAME" >}},
including installation, running the agent, overview of deployment topologies, and more.
including installation, running {{< param "PRODUCT_NAME" >}}, overview of deployment topologies, and more.

{{< section >}}
2 changes: 1 addition & 1 deletion docs/sources/flow/get-started/install/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The following architectures are supported:
- FreeBSD: AMD64

{{% admonition type="note" %}}
Installing {{< param "PRODUCT_NAME" >}} on other operating systems is possible, but is not recommended or supported.
Installing {{< param "PRODUCT_NAME" >}} on other operating systems is possible, but isn't recommended or supported.
{{% /admonition %}}

{{< section >}}
Expand Down
18 changes: 10 additions & 8 deletions docs/sources/flow/get-started/install/chef.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can use Chef to install and manage {{< param "PRODUCT_NAME" >}}.
## Before you begin

- These steps assume you already have a working [Chef][] setup.
- You can add the following resources to any new or existing recipe you choose.
- You can add the following resources to any new or existing recipe.
- These tasks install {{< param "PRODUCT_NAME" >}} from the package repositories. The tasks target Linux systems from the following families:
- Debian (including Ubuntu)
- RedHat Enterprise Linux
Expand All @@ -27,6 +27,7 @@ You can use Chef to install and manage {{< param "PRODUCT_NAME" >}}.
To add {{% param "PRODUCT_NAME" %}} to a host:

1. Add the following resources to your [Chef][] recipe to add the Grafana package repositories to your system:

```ruby
if platform_family?('debian', 'rhel', 'amazon', 'fedora')
if platform_family?('debian')
Expand All @@ -35,13 +36,13 @@ To add {{% param "PRODUCT_NAME" %}} to a host:
mode '0644'
action :create
end

file '/etc/apt/sources.list.d/grafana.list' do
content "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com/ stable main"
mode '0644'
notifies :update, 'apt_update[update apt cache]', :immediately
end

apt_update 'update apt cache' do
action :nothing
end
Expand All @@ -55,7 +56,7 @@ To add {{% param "PRODUCT_NAME" %}} to a host:
action :create
notifies :run, 'execute[add-rhel-key]', :immediately
end

execute 'add-rhel-key' do
command "rpm --import https://rpm.grafana.com/gpg.key"
action :nothing
Expand All @@ -65,7 +66,9 @@ To add {{% param "PRODUCT_NAME" %}} to a host:
fail "The #{node['platform_family']} platform is not supported."
end
```

1. Add the following resources to install and enable the `grafana-agent-flow` service:

```ruby
package 'grafana-agent-flow' do
action :install
Expand All @@ -76,14 +79,14 @@ To add {{% param "PRODUCT_NAME" %}} to a host:
service 'grafana-agent-flow' do
service_name 'grafana-agent-flow'
action [:enable, :start]
end
end
```

## Configuration

The `grafana-agent-flow` package installs a default configuration file that doesn't send telemetry anywhere.
The default configuration file location is `/etc/grafana-agent-flow.river`. You can replace this file with your own configuration, or create a new configuration file for the service to use.
The default configuration file location is `/etc/grafana-agent-flow.river`. You can replace this file with your own configuration or create a new configuration file for the service to use.
## Next steps
Expand All @@ -92,7 +95,6 @@ The default configuration file location is `/etc/grafana-agent-flow.river`. You
[Chef]: https://www.chef.io/products/chef-infrastructure-management/
{{% docs/reference %}}
[Configure]: "/docs/agent/ -> /docs/agent/<AGENT_VERSION>/flow/tasks/configure/configure-linux.md"
[Configure]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/send-data/agent/flow/tasks/configure/configure-linux.md"
{{% /docs/reference %}}
{{% /docs/reference %}}
2 changes: 1 addition & 1 deletion docs/sources/flow/get-started/install/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To do a silent install of {{< param "PRODUCT_NAME" >}} on Windows, perform the f

1. Run the following command in PowerShell or Command Prompt:

```shell
```cmd
<PATH_TO_INSTALLER> /S
```

Expand Down
10 changes: 5 additions & 5 deletions docs/sources/flow/reference/cli/convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ The `convert` command converts a supported configuration format to {{< param "PR

Usage:

* `AGENT_MODE=flow grafana-agent convert [FLAG ...] FILE_NAME`
* `grafana-agent-flow convert [FLAG ...] FILE_NAME`
* `AGENT_MODE=flow grafana-agent convert [<FLAG> ...] <FILE_NAME>`
* `grafana-agent-flow convert [<FLAG> ...] <FILE_NAME>`

Replace the following:

* `FLAG`: One or more flags that define the input and output of the command.
* `FILE_NAME`: The {{< param "PRODUCT_ROOT_NAME" >}} configuration file.
* _`<FLAG>`_: One or more flags that define the input and output of the command.
* _`<FILE_NAME>`_: The {{< param "PRODUCT_ROOT_NAME" >}} configuration file.

If the `FILE_NAME` argument isn't provided or if the `FILE_NAME` argument is
equal to `-`, `convert` converts the contents of standard input. Otherwise,
Expand Down Expand Up @@ -70,7 +70,7 @@ where an output can still be generated. These can be bypassed using the

### Prometheus

Using the `--source-format=prometheus` will convert the source config from
Using the `--source-format=prometheus` will convert the source configuration from
[Prometheus v2.45](https://prometheus.io/docs/prometheus/2.45/configuration/configuration/)
to {{< param "PRODUCT_NAME" >}} configuration.

Expand Down
21 changes: 5 additions & 16 deletions docs/sources/flow/reference/compatibility/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,26 @@ aliases:
- /docs/grafana-cloud/monitor-infrastructure/agent/flow/reference/compatible-components/
- /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/reference/compatible-components/
- /docs/grafana-cloud/send-data/agent/flow/reference/compatible-components/
canonical: https://grafana.com/docs/agent/latest/flow/reference/compatible-components/
canonical: https://grafana.com/docs/agent/latest/flow/reference/compatibility/
description: Learn about which components are compatible with each other in Grafana Agent Flow
title: Compatible components
weight: 400
---

# Compatible components

This section provides an overview of _some_ of the possible connections between
compatible components in Grafana Agent Flow.
This section provides an overview of _some_ of the possible connections between compatible components in {{< param "PRODUCT_NAME" >}}.

For each common data type, we provide a list of compatible components
that can export or consume it.
For each common data type, we provide a list of compatible components that can export or consume it.

{{% admonition type="note" %}}

The type of export may not be the only requirement for chaining components together.
The value of an attribute may matter as well as its type.
Please refer to each component's documentation for more details on what values are acceptable.
Refer to each component's documentation for more details on what values are acceptable.

For example:
* A Prometheus component may always expect an `"__address__"` label inside a list of targets.
* A `string` argument may only accept certain values like "traceID" or "spanID".

{{% /admonition %}}

## Targets
Expand Down Expand Up @@ -155,7 +151,7 @@ The following components, grouped by namespace, _consume_ Targets.

## Prometheus `MetricsReceiver`

The Prometheus metrics are sent between components using `MetricsReceiver`s.
The Prometheus metrics are sent between components using `MetricsReceiver`s.
`MetricsReceiver`s are [capsules]({{< relref "../../concepts/config-language/expressions/types_and_values/#capsules" >}})
that are exported by components that can receive Prometheus metrics. Components that
can consume Prometheus metrics can be passed the `MetricsReceiver` as an argument. Use the
Expand All @@ -181,7 +177,6 @@ The following components, grouped by namespace, _export_ Prometheus `MetricsRece
<!-- NOTE: this title is used as an anchor in links. Do not change. -->
### Prometheus `MetricsReceiver` Consumers
The following components, grouped by namespace, _consume_ Prometheus `MetricsReceiver`.


<!-- START GENERATED SECTION: CONSUMERS OF Prometheus `MetricsReceiver` -->

Expand All @@ -200,8 +195,6 @@ The following components, grouped by namespace, _consume_ Prometheus `MetricsRec

<!-- END GENERATED SECTION: CONSUMERS OF Prometheus `MetricsReceiver` -->



## Loki `LogsReceiver`

`LogsReceiver` is a [capsule]({{< relref "../../concepts/config-language/expressions/types_and_values/#capsules" >}})
Expand Down Expand Up @@ -265,7 +258,6 @@ The following components, grouped by namespace, _consume_ Loki `LogsReceiver`.

<!-- END GENERATED SECTION: CONSUMERS OF Loki `LogsReceiver` -->


## OpenTelemetry `otelcol.Consumer`

The OpenTelemetry data is sent between components using `otelcol.Consumer`s.
Expand Down Expand Up @@ -343,8 +335,6 @@ The following components, grouped by namespace, _consume_ OpenTelemetry `otelcol

<!-- END GENERATED SECTION: CONSUMERS OF OpenTelemetry `otelcol.Consumer` -->



## Pyroscope `ProfilesReceiver`

The Pyroscope profiles are sent between components using `ProfilesReceiver`s.
Expand Down Expand Up @@ -378,4 +368,3 @@ The following components, grouped by namespace, _consume_ Pyroscope `ProfilesRec
{{< /collapse >}}

<!-- END GENERATED SECTION: CONSUMERS OF Pyroscope `ProfilesReceiver` -->

32 changes: 20 additions & 12 deletions docs/sources/flow/reference/components/mimir.rules.kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,19 @@ mimir.rules.kubernetes "LABEL" {

`mimir.rules.kubernetes` supports the following arguments:

Name | Type | Description | Default | Required
-------------------------|------------|---------------------------------------------------------------------------------|---------|---------
`address` | `string` | URL of the Mimir ruler. | | yes
`tenant_id` | `string` | Mimir tenant ID. | | no
`use_legacy_routes` | `bool` | Whether to use deprecated ruler API endpoints. | false | no
`sync_interval` | `duration` | Amount of time between reconciliations with Mimir. | "30s" | no
`mimir_namespace_prefix` | `string` | Prefix used to differentiate multiple {{< param "PRODUCT_NAME" >}} deployments. | "agent" | no
`bearer_token` | `secret` | Bearer token to authenticate with. | | no
`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no
`proxy_url` | `string` | HTTP proxy to proxy requests through. | | no
`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no
`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no
| Name | Type | Description | Default | Required |
| ------------------------ | ---------- | ------------------------------------------------------------------------------- | ------------- | -------- |
| `address` | `string` | URL of the Mimir ruler. | | yes |
| `tenant_id` | `string` | Mimir tenant ID. | | no |
| `use_legacy_routes` | `bool` | Whether to use [deprecated][gem-2_2] ruler API endpoints. | false | no |
| `prometheus_http_prefix` | `string` | Path prefix for [Mimir's Prometheus endpoint][gem-path-prefix]. | `/prometheus` | no |
| `sync_interval` | `duration` | Amount of time between reconciliations with Mimir. | "30s" | no |
| `mimir_namespace_prefix` | `string` | Prefix used to differentiate multiple {{< param "PRODUCT_NAME" >}} deployments. | "agent" | no |
| `bearer_token` | `secret` | Bearer token to authenticate with. | | no |
| `bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no |
| `proxy_url` | `string` | HTTP proxy to proxy requests through. | | no |
| `follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no |
| `enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no |

At most one of the following can be provided:
- [`bearer_token` argument](#arguments).
Expand All @@ -81,6 +82,13 @@ The `mimir_namespace_prefix` argument can be used to separate the rules managed
by multiple {{< param "PRODUCT_NAME" >}} deployments across your infrastructure. It should be set to a
unique value for each deployment.

If `use_legacy_routes` is set to `true`, `mimir.rules.kubernetes` contacts Mimir on a `/api/v1/rules` endpoint.

If `prometheus_http_prefix` is set to `/mimir`, `mimir.rules.kubernetes` contacts Mimir on a `/mimir/config/v1/rules` endpoint.
This is useful if you configure Mimir to use a different [prefix][gem-path-prefix] for its Prometheus endpoints than the default one.

`prometheus_http_prefix` is ignored if `use_legacy_routes` is set to `true`.

## Blocks

The following blocks are supported inside the definition of
Expand Down
Loading

0 comments on commit c3154c0

Please sign in to comment.