{"id":14965342,"url":"https://github.com/datadog/datadog-formula","last_synced_at":"2025-04-06T12:10:33.504Z","repository":{"id":11252965,"uuid":"13652628","full_name":"DataDog/datadog-formula","owner":"DataDog","description":"A saltstack formula for Datadog","archived":false,"fork":false,"pushed_at":"2024-10-11T13:15:49.000Z","size":290,"stargazers_count":30,"open_issues_count":9,"forks_count":54,"subscribers_count":42,"default_branch":"main","last_synced_at":"2025-03-30T11:08:31.510Z","etag":null,"topics":["salt-formula","saltstack","saltstack-formula"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"SBarber95/PyKinect2","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-17T15:11:08.000Z","updated_at":"2024-10-11T13:15:55.000Z","dependencies_parsed_at":"2023-10-24T10:27:56.047Z","dependency_job_id":"d0f673aa-0144-43df-9504-c718eb9ccafc","html_url":"https://github.com/DataDog/datadog-formula","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/datadog-formula/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["salt-formula","saltstack","saltstack-formula"],"created_at":"2024-09-24T13:34:36.916Z","updated_at":"2025-04-06T12:10:33.484Z","avatar_url":"https://github.com/DataDog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Datadog Formula\n\nThe Datadog SaltStack formula is used to install the Datadog Agent and the Agent-based integrations (checks). For more details on SaltStack formulas, see the [Salt formulas installation and usage instructions][1].\n\n## Setup\n\n### Requirements\n\nThe Datadog SaltStack formula only supports installs on Debian-based and RedHat-based systems.\n\n### Installation\n\nThe following instructions add the Datadog formula to the `base` Salt environment. To add it to another Salt environment, change the `base` references to the name of your Salt environment.\n\n#### Option 1\n\nInstall the [Datadog formula][6] in the base environment of your Salt master node, using the `gitfs_remotes` option in your Salt master configuration file (defaults to `/etc/salt/master`):\n\n```text\nfileserver_backend:\n  - roots # Active by default, necessary to be able to use the local salt files we define in the next steps\n  - gitfs # Adds gitfs as a fileserver backend to be able to use gitfs_remotes\n\ngitfs_remotes:\n  - https://github.com/DataDog/datadog-formula.git:\n    - saltenv:\n      - base:\n        - ref: 3.0 # Pin the version of the formula you want to use\n```\n\nThen restart your Salt Master service to apply the configuration changes:\n\n```shell\nsystemctl restart salt-master\n# OR\nservice salt-master restart\n```\n\n#### Option 2\n\nAlternatively, clone the Datadog formula on your Salt master node:\n\n```shell\nmkdir -p /srv/formulas \u0026\u0026 cd /srv/formulas\ngit clone https://github.com/DataDog/datadog-formula.git\n```\n\nThen, add it to the base environment under `file_roots` of your Salt master configuration file (defaults to `/etc/salt/master`):\n\n```text\nfile_roots:\n  base:\n    - /srv/salt/\n    - /srv/formulas/datadog-formula/\n```\n\n### Deployment\n\nTo deploy the Datadog Agent on your hosts:\n\n1. Add the Datadog formula to your top file (defaults to `/srv/salt/top.sls`):\n\n    ```text\n    base:\n      '*':\n        - datadog\n    ```\n\n2. Create `datadog.sls` in your pillar directory (defaults to `/srv/pillar/`). Add the following and update your [Datadog API key][2]:\n\n    ```\n    datadog:\n      config:\n        api_key: \u003cYOUR_DD_API_KEY\u003e\n      install_settings:\n        agent_version: \u003cAGENT7_VERSION\u003e\n    ```\n\n3. Add `datadog.sls` to the top pillar file (defaults to `/srv/pillar/top.sls`):\n\n    ```text\n    base:\n      '*':\n        - datadog\n    ```\n\n### Configuration\n\nThe formula configuration must be written in the `datadog` key of the pillar file. It contains three parts: `config`, `install_settings`, and `checks`.\n\n#### Config\n\nUnder `config`, add the configuration options to write to the minions' Agent configuration file (`datadog.yaml` for Agent v6 \u0026 v7, `datadog.conf` for Agent v5).\n\nDepending on the Agent version installed, different options can be set:\n\n- Agent v6 \u0026 v7: all options supported by the Agent's configuration file are supported.\n- Agent v5: only the `api_key` option is supported.\n\nThe example below sets your Datadog API key and the Datadog site to `datadoghq.eu` (available for Agent v6 \u0026 v7).\n\n```text\n  datadog:\n    config:\n      api_key: \u003cYOUR_DD_API_KEY\u003e\n      site: datadoghq.eu\n```\n\n#### Install settings\n\nUnder `install_settings`, configure the Agent installation option:\n\n- `agent_version`: The version of the Agent to install (defaults to the latest Agent v7).\n\nThe example below installs Agent v6.14.1:\n\n```text\n  datadog:\n    install_settings:\n      agent_version: 6.14.1\n```\n\n#### Checks\n\nTo add an Agent integration to your host, use the `checks` variable with the check's name as the key. Each check has two options:\n\n| Option    | Description                                                                                                                                                             |\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `config`  | Add the configuration options to write to the check's configuration file:\u003cbr\u003eAgent v6 \u0026 v7: `\u003cconfd_path\u003e/\u003ccheck\u003e.d/conf.yaml`\u003cbr\u003eAgent v5: `\u003cconfd_path\u003e/\u003ccheck\u003e.yaml` |\n| `version` | For Agent v6 \u0026 v7, the version of the check to install (defaults to the version bundled with the Agent).                                                                |\n| `third_party` | For Agent v6 \u0026 v7 (versions v6.21.0/v7.21.0 and higher only), boolean to indicate that the integration to install is a third-party integration. Must be paired with the `version` option.                                                                |\n\nBelow is an example to use v1.4.0 of the [Directory][3] integration monitoring the `/srv/pillar` directory:\n\n```text\ndatadog:\n  config:\n    api_key: \u003cYOUR_DD_API_KEY\u003e\n  install_settings:\n    agent_version: \u003cAGENT7_VERSION\u003e\n  checks:\n    directory:\n      config:\n        instances:\n          - directory: \"/srv/pillar\"\n            name: \"pillars\"\n      version: 1.4.0\n```\n\nBelow is an example to use v1.0.0 of a sample third-party integration named \"third-party-integration\":\n\n```\ndatadog:\n  config:\n    api_key: \u003cYOUR_DD_API_KEY\u003e\n  install_settings:\n    agent_version: \u003cAGENT7_VERSION\u003e\n  checks:\n    third-party-integration:\n      config:\n        instances:\n          - some_config: \"some value\"\n      version: 1.0.0\n      third_party: true\n```\n\n##### Logs\n\nTo enable log collection, set `logs_enabled` to `true` in the main configuration:\n```text\ndatadog:\n  config:\n    logs_enabled: true\n```\n\nTo send logs to Datadog, use the `logs` key in a check (either an existing check to setup logs for an integration, or a custom check to setup custom log collection). The following example uses a custom check named `system_logs`.\n\nThe contents of the `config:` key of this check is written to the `/etc/datadog-agent/conf.d/\u003ccheck_name\u003e.d/conf.yaml` file (in this example: `/etc/datadog-agent/conf.d/system_logs.d/conf.yaml`).\n\nTo list the logs you want to collect, fill the `config` section the same way you'd fill the `conf.yaml` file of a custom log collection configuration file (see the section on [custom log collection](https://docs.datadoghq.com/agent/logs/?tab=tailfiles#custom-log-collection) in the official docs).\n\nFor instance, to collect logs from `/var/log/syslog` and `/var/log/auth.log`, the configuration would be:\n\n```text\ndatadog:\n[...]\n  checks:\n    system_logs:\n      config:\n        logs:\n          - type: file\n            path: \"/var/log/syslog\"\n            service: \"system\"\n          - type: file\n            path: \"/var/log/auth.log\"\n            service: \"system\"\n```\n\n\n## States\n\nSalt formulas are pre-written Salt states. The following states are available in the Datadog formula:\n\n| State               | Description                                                                                             |\n|---------------------|---------------------------------------------------------------------------------------------------------|\n| `datadog`           | Installs, configures, and starts the Datadog Agent service.                                             |\n| `datadog.install`   | Configures the correct repo and installs the Datadog Agent.                                             |\n| `datadog.config`    | Configures the Datadog Agent and integrations using pillar data (see [pillar.example][4]).              |\n| `datadog.service`   | Runs the Datadog Agent service, which watches for changes to the config files for the Agent and checks. |\n| `datadog.uninstall` | Stops the service and uninstalls the Datadog Agent.                                                     |\n\n**NOTE**: When using `datadog.config` to configure different check instances on different machines, [pillar_merge_lists][5] must be set to `True` in the Salt master config or the Salt minion config if running masterless.\n\n[1]: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html\n[2]: https://app.datadoghq.com/organization-settings/api-keys\n[3]: https://docs.datadoghq.com/integrations/directory/\n[4]: https://github.com/DataDog/datadog-formula/blob/master/pillar.example\n[5]: https://docs.saltstack.com/en/latest/ref/configuration/master.html#pillar-merge-lists\n[6]: https://github.com/DataDog/datadog-formula\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fdatadog-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-formula/lists"}