Skip to content

Conversation

@simonhammes
Copy link
Collaborator

@simonhammes simonhammes commented Aug 29, 2024

Docs:

  • Directory permissions must be fixed before starting the container:

    mkdir /opt/seafile-grafana
    chown -R 472:472 /opt/seafile-grafana
  • Required environment variables

    SEAFILE_LOG_TO_STDOUT=true
    GRAFANA_HOSTNAME=
    GRAFANA_ADMIN_USER=admin
    GRAFANA_ADMIN_PASSWORD=
    
    SEAFEVENTS__INDEX0x20FILES__logfile=/dev/stdout
  • Data sources must be manually configured

    • loki: http://loki:3100
    • prometheus: http://prometheus:9090
  • Examples

    • prometheus: container_memory_usage_bytes{name=~"caddy|seafile-server|seafile-memcached|seafile-elasticsearch|mariadb"} / (1024*1024)


# 1) Remove "--logfile" argument from start_seafevents(). This forces seafevents to log to stdout (which is the default it --logfile is not specified).
# 2) FileUpdateSender should log to stdout
RUN sed -i 's/--logfile \${TOPDIR}\/logs\/seafevents\.log //g' /opt/seafile/seafile-pro-server-11.0.14/seafile-monitor.sh && \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# 1) Remove "--logfile" argument from start_seafevents(). This forces seafevents to log to stdout (which is the default it --logfile is not specified).
# 2) FileUpdateSender should log to stdout
RUN sed -i 's/--logfile \${TOPDIR}\/logs\/seafevents\.log //g' /opt/seafile/seafile-pro-server-11.0.14/seafile-monitor.sh && \
sed -i 's/run_and_wait(cmd, cwd=SEAHUB_DIR, output=fp)/run_and_wait(cmd, cwd=SEAHUB_DIR)/g' /opt/seafile/seafile-pro-server-11.0.14/pro/python/seafevents/tasks/file_updates_sender.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonhammes simonhammes changed the title Add Grafana/Loki/Promtail Add Grafana/Loki/Promtail/Prometheus Aug 30, 2024
restart: unless-stopped
container_name: prometheus
# TODO: Is this necessary?
user: "root:root"
Copy link
Collaborator Author

@simonhammes simonhammes Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried fixing the directory permissions before starting the container instead of using root:root using

mkdir /opt/seafile-prometheus
chown -R 99:99 /opt/seafile-prometheus/

but this did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants