Skip to content

Commit

Permalink
doc: updating doc for custom.yaml (#3352)
Browse files Browse the repository at this point in the history
* doc: updating doc for custom.yaml

* doc: explain that custom.yaml should be used for template customization (#3353)

---------

Co-authored-by: Chris Grindstaff <chris@gstaff.org>
  • Loading branch information
Hardikl and cgrinds authored Dec 5, 2024
1 parent 9fd5eaf commit d06a0e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/configure-templates.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## Creating/editing templates
## Templates customization

This document covers how to use [Collector](configure-templates.md#collector-templates)
and [Object](configure-templates.md#object-templates) templates to extend Harvest.
Customization of templates should use the `custom.yaml` approach
to avoid overwriting your changes when Harvest is upgraded, or you rerun the `generate` command.

1. [How to add a new object template](configure-templates.md#create-a-new-object-template)
2. [How to extend an existing object template](configure-templates.md#extend-an-existing-object-template)
1. [How to add a new object template via custom.yaml](configure-templates.md#create-a-new-object-template)
2. [How to extend an existing object template via custom.yaml](configure-templates.md#extend-an-existing-object-template)

There are a couple of ways to learn about ZAPIs and their attributes:

Expand Down Expand Up @@ -260,7 +262,7 @@ Let's say you want to extend `lun.yaml` to:
3. Add a new counter to the already collected lun metrics using the `value_to_num` plugin
4. Add a new `application` instance_keys and labels to the collected metrics

Let's assume the existing template is located at conf/zapi/cdot/9.8.0/lun.yaml and contains the following.
Let's assume the existing template is located at `conf/zapi/cdot/9.8.0/lun.yaml` and contains the following.

```yaml
name: Lun
Expand Down
4 changes: 4 additions & 0 deletions docs/install/containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ password: admin
### How do I add a new poller?
Note: All of your template customizations should follow the custom.yaml approach
mentioned in [template customization](../configure-templates.md#templates-customization),
otherwise any changes you've made in the `conf` directory will be overwritten.
1. Add poller to `harvest.yml`
2. Regenerate compose file by running [harvest generate](#generate-a-docker-compose-for-your-pollers)
3. Run [docker compose up](#start-everything), for example,
Expand Down
4 changes: 4 additions & 0 deletions docs/install/harvest-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ docker compose -f harvest-compose.yml up -d --remove-orphans

### How do I add a new poller?

Note: All of your template customizations should follow the custom.yaml approach
mentioned in [template customization](../configure-templates.md#templates-customization),
otherwise any changes you've made in the `conf` directory will be overwritten.

1. Add poller to `harvest.yml`
2. Regenerate compose file by running [harvest generate](#generate-a-docker-compose-for-your-pollers)
3. Run [docker compose up](#start-everything), for example,
Expand Down

0 comments on commit d06a0e4

Please sign in to comment.