GithubHelp home page GithubHelp logo

isabella232 / datadog-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sansible/datadog

0.0 0.0 0.0 33 KB

See https://github.com/sansible/sansible for more information

License: MIT License

Makefile 80.02% Python 19.98%

datadog-1's Introduction

Datadog

Master: Build Status Develop: Build Status

This roles installs the Datadog agent.

The agent service is intentionally disabled on bootup; during boot a machine will most likelyconsume a high amount of resourc es whilst the OS and all of its services start which will trip any CPU or Memory usage alarms erroneously.

Installation and Dependencies

To install run ansible-galaxy install sansible.datadog or add this to your roles.yml.

- name: sansible.datadog
  version: v2.0

and run ansible-galaxy install -p ./roles -r roles.yml

Tags

This role uses one tag: build

  • build - Installs Datadog and all its dependencies.
  • configure - Configures datadog and install integrations

Integrations

The datadog/templates/conf.d directory contains the implemented integrations. The majority of them are self explanatory.

DNS Check

Sample data structure for DNS Check integration:

roles:
  - role: sansible.datadog
    sansible_datadog_integrations:
      dns_check:
        default_timeout: 1
        checks:
          - name: "Some Domain"
            hostname: "some.domain.com"
            nameserver: "127.0.0.1"
          - name: "Some Other Domain"
            hostname: "some.other.domain.com"
            nameserver: "10.1.1.2"

Gunicorn

For Gunicorn integration you need to supply a list of app names to be monitored, please see https://docs.datadoghq.com/integrations/gunicorn/ for more information on how to setup DataDog and Gunicorn.

roles:
  - role: sansible.datadog
    sansible_datadog_integrations:
      gunicorn:
        app_names:
          - my_app
          - another_app
    sansible_datadog_tags:
      - my_app
      - role:my_app

TCP Check

Sample data structure for TCP Check integration.

roles:
  - role: sansible.datadog
    sansible_datadog_integrations:
      tcp_check:
        - endpoint: "my.domain.com"
          name: "TCP Check for my.domain.com"
          port: "443"
        - endpoint: "your.domain.com"
          name: "TCP Check for your.domain.com"
          port: "80"
          timeout: 2
          collect_response_time: "false"
          min_collection_interval: 60
      sansible_datadog_tags:
        - some_app
        - role:some_app

Examples

To install:

- name: Install and Configure Datadog
  hosts: "somehost"

  roles:
    - role: sansible.datadog

Setup Datadog with some integrations and tags:

- name: Install and Configure Datadog
  hosts: "somehost"

  roles:
    - role: sansible.datadog
      sansible_datadog_integrations:
        php_fpm: {}
        nginx: {}
      sansible_datadog_tags:
        - some_app
        - role:some_app

You can disable the agent completely if desired, this can be used to build images that have DD installed with the option turn DD off in certain environments where monitoring is not needed (eg. dev or scratch environments):

# Environment var file eg. vars/dev/vars.yml

sansible_datadog_enabled: no
- name: Install and configure Datadog
  hosts: "somehost"

  vars_files:
    - vars/dev/vars.yml

  roles:
    - role: sansible.datadog

Note This behaviour requires hash_behaviour to be set to merge.

By default this role will start the DD agent in the [tasks/configure.yml] task file, this behaviour can be disabled however if you wish to start the agent within another role:

- name: Install and Configure Datadog
  hosts: "somehost"

  vars_files:
    - vars/dev/vars.yml

  roles:
    - role: sansible.datadog
      sansible_datadog_autostart_agent: no

    # The task of this role will be be to start the DD agent service
    role: my_service_role

Using .default_tags to set global tags, these get blended with .tags:

# Environment var file eg. vars/dev/vars.yml

sansible_datadog_default_tags:
  - environment:dev
- name: Install and Configure Datadog
  hosts: "somehost"

  vars_files:
    - vars/dev/vars.yml

  roles:
    - role: sansible.datadog
      sansible_datadog_tags:
        - some_app
        - role:some_app

Note This behaviour requires hash_behaviour to be set to merge.

This will result in the following tags:

- environment:dev
- some_app
- role:some_app

Disable Datadog service (useful for disabling in some environments):

- name: Install and Configure Datadog
  hosts: "somehost"

  roles:
    - role: sansible.datadog
      sansible_datadog_enabled: false

datadog-1's People

Contributors

dennisconrad avatar lobsterdore avatar quater avatar rsgoodall avatar wojtek-oledzki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.