cw-infra-apps/grafana/charts/feature-integrations/README.md.gotmpl
2025-05-28 10:01:42 +03:00

111 lines
4.9 KiB
Go Template

<!--
(NOTE: Do not edit README.md directly. It is a generated file!)
( To make changes, please modify README.md.gotmpl and run `helm-docs`)
-->
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}
{{ template "chart.badgesSection" . }}
{{ template "chart.description" . }}
{{ template "chart.homepageLine" . }}
The Integrations feature builds in configuration for many common applications and services.
The current integrations that are available from this feature are:
| Integration | Description | Data Types | Docs |
| --- | --- | --- | --- |
| [Grafana Alloy](https://grafana.com/docs/alloy) | Telemetry data collector | Metrics | [Alloy doc](./docs/integrations/alloy.md) |
| [cert-manager](https://cert-manager.io/) | x.509 certificate management for Kubernetes | Metrics | [Cert manager doc](./docs/integrations/cert-manager.md) |
| [etcd](https://etcd.io/) | Distributed key-value store | Metrics | [etcd doc](./docs/integrations/etcd.md) |
## Usage
To enable an integration, create an instance of it with any configuration to aid in service discovery. For example:
```yaml
cert-manager:
instances:
- name: cert-manager
namespace: kube-system
labelSelectors:
app.kubernetes.io/name: cert-manager
```
You can specify multiple instances of the same integration to match multiple instances of that service. For example:
```yaml
alloy:
instances:
- name: alloy-metrics
labelSelectors:
app.kubernetes.io/name: alloy-metrics
- name: alloy-receivers
labelSelectors:
app.kubernetes.io/name: alloy-receivers
```
For all possible values for a specific integration, refer to the previous table for the link to the integration documentation.
## Testing
This chart contains unit tests to verify the generated configuration. The hidden value `deployAsConfigMap` will render
the generated configuration into a ConfigMap object. While this ConfigMap is not used during regular operation, you can
use it to show the outcome of a given values file.
The unit tests use this ConfigMap to create an object with the configuration that can be asserted against. To run the
tests, use `helm test`.
Be sure perform actual integration testing in a live environment in the main [k8s-monitoring](../..) chart.
{{ template "chart.maintainersSection" . }}
<!-- markdownlint-disable no-bare-urls -->
<!-- markdownlint-disable list-marker-space -->
{{ template "chart.sourcesSection" . }}
<!-- markdownlint-enable list-marker-space -->
<!-- markdownlint-enable no-bare-urls -->
{{ template "chart.requirementsSection" . }}
{{ template "chart.valuesSection" . }}
## Contributing
To contribute integrations to this feature, you must create or modify a few files:
* `values.yaml` - The main feature chart's values file. Add a section for your integration. It must contain an
`instance` array and any settings that apply to every instance of the integration. For example:
```yaml
<slug>:
instances: []
globalSetting: value
```
* `integrations/<slug>-values.yaml` - The values that will be used for each instance. This must include `name` to
differentiate it from other instances and any other settings that are specific to that instance. For example:
```yaml
name: ""
labelSelectors:
app.kubernetes.io/name: my-service
protocol: http
...
```
* `templates/_integration<=_<slug>.tpl` - The file that contains template functions that build the configuration to
discover, gather, process, and deliver the telemetry data. This file is required to implement the following template functions:
* `integrations.<slug>.type.metrics` - Returns true if this integration scrapes metrics.
* `integrations.<slug>.type.logs` - Returns true if this integration gathers logs.
* `integrations.<slug>.module` - Returns the configuration that is included once if this integration is used. This
is typically the module definition.
* `integrations.<slug>.include.metrics` - Returns the configuration that is included for each instance of the
integration that scrapes metrics.
* `integrations.<slug>.include.logs` - Returns the configuration that is included for each instance of the
integration that gathers logs.
* `integrations.<slug>.exclude.logs` - Returns a rule that can be used by other Log-gathering features to ensure
that logs that are gathered from this integration are not collected twice. Typically the inverse of a rule in
the `integrations.<slug>.include.logs` function.
* `default-allow-lists/<slug>.yaml` - If the integration scrapes metrics, a common pattern is to provide a list of
metrics that should be allowed. This reduces the amount of metrics delivered to a useful minimal set.
* When testing changes to this chart, from `/charts/k8s-monitoring` run `rm -rf Chart.lock && make build` to force the chart to be rebuilt.