Ship audit logs to Logs & Metrics providers on self-hosted (enterprise)

Abierto
#6,126 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
postgresql, typescript

Línea de trabajo

Wait for #6123 to merge, then trace its audit stream and the telemetry provider form and adapter used for log shipping. Check how the local Vector agent routes container logs and how organization and license settings are represented. Done means licensed self-hosted organizations can opt in per log provider, and Vector sends only their audit events to those providers.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
What problem will this feature address?

On self-hosted Enterprise, audit logs stay in Dokploy's Postgres. You can browse them in the UI or export them by hand as CSV, TSV or JSON (#5797), but nothing sends them to the log platform where we keep everything else (OpenObserve in our case; Elasticsearch, Loki, Datadog or Splunk for others). To alert on them or keep them under the same retention, someone has to export and upload them manually.

Logs & Metrics already runs a Vector agent that ships container logs to these providers. #6123 adds a structured audit stream, written to stdout as log_type: "dokploy.audit" JSON lines, which Vector ships to ClickHouse. That stream is only enabled when IS_CLOUD is set.

Describe the solution you'd like

A self-hosted Enterprise organization should be able to send its audit events to the Logs & Metrics providers it has already configured.

In the telemetry provider form, when the provider sends logs ("Logs" or "Logs & Metrics"), show an "Also send audit logs" checkbox. It is available only with a valid enterprise license.

On the backend, reuse the audit stream from #6123 and turn it on for self-hosted when a licensed organization has at least one provider with the option enabled.

Vector needs a dedicated route for these events. The local agent currently keeps only container logs whose dokploy.organization.id label matches the organization that claimed it (dokploy_scope_local_only). The Dokploy container has no such label, so its stdout, where the audit lines go, is dropped. The new route would parse the Dokploy container's output, keep the log_type == "dokploy.audit" events that belong to that organization, and send them to the providers that have the option on. Filtering by organization keeps one organization's audit events out of another's provider.

The events go through the same adapter and sink as the provider's container logs, so any provider that supports logs works without provider-specific code. #6123 already redacts the events (keys, URL credentials, PEM blocks, inline command secrets), so this sends nothing the Cloud stream doesn't.

Describe alternatives you've considered
  • Exporting from the Audit Logs page and uploading periodically. It's manual, and alerts would always lag.
  • A scheduled job that reads the audit_log table and pushes new rows to the provider. It would duplicate what Vector already does, and the table only holds the explicit audit() calls, which cover less than the #6123 stream.
  • A separate "Audit logs" option next to Logs and Metrics in the provider select. That means a new signal type across the adapters, the schema and the UI, while the data is just another log stream.
Additional context

This builds on #6123, so we'd wait for it to be merged before starting. If the team already has plans for the self-hosted side of the audit stream, we're happy to follow a different design.

We run Dokploy self-hosted with an Enterprise license and ship our logs to OpenObserve (#5991).

Will you send a PR to implement it?

Yes

Lenguaje dominante
TypeScript
Estrellas
38.8k
Forks
3.2k
Merge medio
1 d 10 h
PR fusionados (30 d)
110

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Dokploy/dokploy

Todos los issues de Dokploy/dokploy

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.