github.com/observiq/bindplane-agent@v1.51.0/config/google_cloud_exporter/docker/README.md (about)

     1  # Docker Metrics with Google Cloud
     2  
     3  The Docker Receiver can be used to send Docker metrics to Google Cloud Monitoring.
     4  
     5  ## Prerequisites
     6  
     7  **Google Cloud**
     8  
     9  See the [prerequisites](../prerequisites.md) doc for Google Cloud prerequisites.
    10  
    11  **Docker Socket**
    12  
    13  The provided configuration assumes the agent is running on the Docker system. By default, the `endpoint` collected from is `unix:///var/run/docker.sock`.
    14  
    15  The user running the agent must have permission to read the [docker socket](https://docs.docker.com/engine/install/linux-postinstall/).
    16  
    17  ```bash
    18  sudo usermod -aG docker observiq-otel-collector
    19  ```
    20  
    21  ## Deployment
    22  
    23  **On Host**
    24  
    25  If the agent is running on the Docker host (not within a container), deployment is as simple as installing the agent and updating the configuration.
    26  
    27  **Docker Container**
    28  
    29  If running the agent as a container, you will need to mount the Docker socket with a read only volume mount. Additionally, configuration and credentials will need to be mounted.
    30  
    31  Run as a container
    32  
    33  ```bash
    34  docker run -d \
    35      --restart=always \
    36      --volume="/var/run/docker.sock:/var/run/docker.sock:ro"  \
    37      --volume="$(pwd)/config.yaml:/etc/otel/config.yaml" \
    38      --volume="$(pwd)/credentials.json:/etc/otel/credentials.json" \
    39      -e "GOOGLE_APPLICATION_CREDENTIALS=/etc/otel/credentials.json" \
    40      -e "DOCKER_AGENT_HOSTNAME=$(hostname)" \
    41      observiq/bindplane-agent:v1.30.0
    42  ```
    43  
    44  Run with Docker Compose
    45  
    46  ```yaml
    47  version: "3.9"
    48  services:
    49    agent:
    50      restart: always
    51      # Run as root if using a configuration that requires
    52      # root privileges.
    53      #user: root
    54      image: observiq/bindplane-agent:v1.30.0
    55      restart: always
    56      deploy:
    57        resources:
    58          limits:
    59            cpus: 0.50
    60            memory: 256M
    61      environment:
    62        - GOOGLE_APPLICATION_CREDENTIALS=/etc/otel/credentials.json
    63        - DOCKER_AGENT_HOSTNAME=${HOSTNAME}
    64      volumes:
    65        - /var/run/docker.sock:/var/run/docker.sock:ro
    66        - ${PWD}/config.yaml:/etc/otel/config.yaml
    67        - ${PWD}/credentials.json:/etc/otel/credentials.json
    68  ```