# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: VictoriaLogs
spec:
    description: The simple & reliable logs solution that scales
    coverImage: https://cdn.zeabur.com/templates/cover-image/victorialogs.png
    icon: https://cdn.zeabur.com/templates/icon/victoriametrics.svg
    tags:
        - monitoring
        - observability
        - logging
    readme: |
        VictoriaLogs is an open source user-friendly database for logs from VictoriaMetrics, allowing you to store and query your logs in a simple and easy-to-use interface. It is a good alternative to ELK stack and Loki.

        For more information about VictoriaLogs, please refer to [their docs](https://docs.victoriametrics.com/victorialogs/).

        ## Usage

        You can find the port mapping (`9428`) from the “Networking” tab in the “Services” section.

        Usually, you ingest the logs to VictoriaLogs with [OpenTelemetry SDK](https://docs.victoriametrics.com/victorialogs/data-ingestion/opentelemetry/) (Zeabur doesn't have a log drain solution yet). Check [VictoriaLogs' docs](https://docs.victoriametrics.com/victorialogs/data-ingestion/opentelemetry/) for more information.

        Then, you can query the logs with VictoriaLogs's Web UI at `https://your-domain/select/vmui` (where `your-domain` binds to the port 9428), [Grafana](https://zeabur.com/templates/MDTTQR), and [the querying methods listed by VictoriaLogs](https://docs.victoriametrics.com/victorialogs/querying/).

        By default, the data retention period is 14 days. You can change it by modifying the `-retentionPeriod` argument in the Command section of the Settings tab of this service. See [Retention](https://docs.victoriametrics.com/victorialogs/#retention) section in VictoriaLogs' docs for more information.

        Check [VictoriaLogs' docs](https://docs.victoriametrics.com/victorialogs/) for more information.
    services:
        - name: victorialogs
          icon: https://cdn.zeabur.com/templates/icon/victoriametrics.svg
          template: PREBUILT
          spec:
            source:
                image: victoriametrics/victoria-logs:v1.43.1
                command:
                    - /victoria-logs-prod
                args:
                    - -storageDataPath=/victoria-logs-data
                    - -retentionPeriod=14d
            ports:
                - id: web
                  port: 9428
                  type: HTTP
            volumes:
                - id: data
                  dir: /victoria-logs-data
