Skip to content

Commit

Permalink
Add examples (#1174)
Browse files Browse the repository at this point in the history
* Add examples
* Specific image registry overriding
* Pod Labels and Annotations in metrics and logs
* Extra configuration example
* Tolerations

Signed-off-by: Pete Wall <[email protected]>

* Fix path for test checking for image registries

Signed-off-by: Pete Wall <[email protected]>

* Pin helm unittest to an older version before things broke

Signed-off-by: Pete Wall <[email protected]>

---------

Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
petewall authored Jan 28, 2025
1 parent 85a9b71 commit 7775909
Show file tree
Hide file tree
Showing 44 changed files with 12,773 additions and 37 deletions.
2 changes: 1 addition & 1 deletion charts/k8s-monitoring-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
2 changes: 1 addition & 1 deletion charts/k8s-monitoring/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ unittest: values.schema.json templates/destinations/_destination_types.tpl
ifdef HAS_HELM_UNITTEST
helm unittest --failfast --with-subchart=false .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest --failfast --with-subchart=false .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 --failfast --with-subchart=false .
endif
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Be sure perform actual integration testing in a live environment in the main [k8

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| connectors.grafanaCloudMetrics.enabled | bool | `true` | Generate host info metrics from telemetry data. These metrics are required for using Application Observability in Grafana Cloud. Note: Enabling this may incur additional costs. See https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/pricing/ |
| connectors.grafanaCloudMetrics.enabled | bool | `true` | Generate host info metrics from telemetry data. These metrics are required for using Application Observability in Grafana Cloud. Note: Enabling this may incur additional costs. See [Application Observability Pricing](https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/pricing/) |

### Connectors: Span Logs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ connectors:
grafanaCloudMetrics:
# -- Generate host info metrics from telemetry data. These metrics are required for using Application Observability
# in Grafana Cloud. Note: Enabling this may incur additional costs.
# See https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/pricing/
# See [Application Observability Pricing](https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/pricing/)
# @section -- Connectors: Grafana Cloud Host Info
enabled: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
2 changes: 1 addition & 1 deletion charts/k8s-monitoring/charts/feature-integrations/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif

2 changes: 1 addition & 1 deletion charts/k8s-monitoring/charts/feature-node-logs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
2 changes: 1 addition & 1 deletion charts/k8s-monitoring/charts/feature-pod-logs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
2 changes: 1 addition & 1 deletion charts/k8s-monitoring/charts/feature-profiling/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ test: build
ifdef HAS_HELM_UNITTEST
helm unittest .
else
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest .
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.17.0-0.7.1 .
endif
45 changes: 45 additions & 0 deletions charts/k8s-monitoring/docs/examples/extra-configuration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
(NOTE: Do not edit README.md directly. It is a generated file!)
( To make changes, please modify values.yaml or description.txt and run `make examples`)
-->
# Extra Configuration

This example shows how to include additional configuration components to the Alloy instances. These components are added
to any existing configuration and does not replace it or modify it in any way.

In the example below, note that the `discovery.kubernetes.animal_service` component discovers the Kubernetes Service by
namespace and label selectors. Metrics found are then forwarded to `prometheus.remote_write.<destination-name>.receiver`
for delivery.

## Values

```yaml
---
cluster:
name: extra-configuration-cluster

destinations:
- name: prometheus
type: prometheus
url: http://prometheus.prometheus.svc:9090/api/v1/write

alloy-metrics:
enabled: true
extraConfig: |
discovery.kubernetes "animal_service" {
role = "service"
namespaces {
names = ["zoo"]
}
selectors {
role = "service"
label = ["app.kubernetes.io/name=animal-service"]
}
}
prometheus.scrape "animal_service" {
job_name = "animal_service"
targets = discovery.kubernetes.animal_service.targets
forward_to = [prometheus.remote_write.prometheus.receiver]
}
```

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7775909

Please sign in to comment.