Skip to content
Snippets Groups Projects
monitoring.md 1.7 KiB
Newer Older
  • Learn to ignore specific revisions
  • Bastien DUMONT's avatar
    Bastien DUMONT committed
    # Monitoring
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    All logs printed by the Cozy stack can be displayed on a Grafana dashboard for easier sorting.
    
    Hugo's avatar
    Hugo committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    To start the monitoring system, connect to alpha and type the following command:
    
    Hugo's avatar
    Hugo committed
    
    
    Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    ```bash
    docker compose -f /root/monitoring/logs-monitoring/docker-compose.yaml up -d
    ```
    
    Then, you can access it [here](https://grafana.self-data.alpha.grandlyon.com/)
    
    :::info Login
    Ask for credentials to a team member
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    This monitoring system allow the team to parse more easily the cozy-stack logs when something goes wrong. For instance, test konnector or check from the proxy if an issue was coming from Enedis or Grdf.
    
    Hugo's avatar
    Hugo committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Learn more about how it works [in the project readme](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/logs-monitoring).
    
    :::tip Debug logs
    Enabling debug logs will print more logs and can be helpful. You can do so by running scripts :
    
    ```bash
    ./set_instance_debug_true.sh <instance>
    ./set_instance_debug_false.sh <instance>
    ```
    
    :::
    
    :::warning High volume
    
    Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    The service parses a very high amount of logs, most of all when debugging an instance. To limit our disk usage we tend to stop the service when not needed. To do so, type the following command:
    
    ```bash
    docker compose -f /root/monitoring/logs-monitoring/docker-compose.yaml down
    ```
    
     The docker volume will be persisted.
    
    Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    Some dashboards are already available, [ecolyodemo](https://grafana.self-data.alpha.grandlyon.com/d/f9685577-861d-4d44-883f-a9651dee147e/ecolyodemo?orgId=1) for example
    
    To connect a specific instance logs to Grafana:
    
    Rémi PAILHAREY's avatar
    Rémi PAILHAREY committed
    - Create a new dashboard
    - Select `Loki` as the data source
    - In the label filters select the `container_name` to be `cozy-stack-1`
    - add a `line contains` filter and type `domain=[specific-instance]`