mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-13 08:05:23 +00:00
* [ee] improve analytics: add git sync & AI chat telemetry, HMAC-signed download
- Add ai_chat_usage table to track chat sessions (session_id, provider, model, mode, message_count)
- Add POST /w/{workspace}/workspaces/log_chat endpoint with upsert on session_id
- Frontend fires logAiChat on every sendRequest, using HistoryManager's existing chat ID
- EE stats: add git_sync_usage (sync vs promotion repo count) and ai_chat_usage (30-day aggregates)
- Replace RSA+AES-GCM encrypted telemetry download with plaintext JSON + HMAC-SHA256 signature
- Signature (12 hex chars) included in download filename for verification
- Update instance settings telemetry descriptions for both EE and CE
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: make StatsDownload struct pub to fix private-interfaces error
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: update ee-repo-ref to 878cc2044717e0177228529a50433fe2768e70b5
This commit updates the EE repository reference after PR #464 was merged in windmill-ee-private.
Previous ee-repo-ref: 33eb863b6b881bd54ed69a540e0c65d5fe125024
New ee-repo-ref: 878cc2044717e0177228529a50433fe2768e70b5
Automated by sync-ee-ref workflow.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
74 lines
1.6 KiB
Rust
74 lines
1.6 KiB
Rust
#[cfg(feature = "private")]
|
|
#[allow(unused)]
|
|
pub use crate::stats_ee::*;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use sqlx::Postgres;
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
use crate::{error::Result, DB};
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn get_disable_stats_setting(_db: &DB) -> bool {
|
|
// stats details are closed source
|
|
|
|
false
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn schedule_stats(_db: &DB, _http_client: &reqwest::Client) -> () {
|
|
// stats details are closed source
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub enum SendStatsReason {
|
|
Manual,
|
|
Schedule,
|
|
OnStart,
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn send_stats(
|
|
_http_client: &reqwest::Client,
|
|
_db: &DB,
|
|
_reason: SendStatsReason,
|
|
_minimal: bool,
|
|
) -> Result<()> {
|
|
// stats details are closed source
|
|
Ok(())
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub struct ActiveUserUsage {
|
|
pub author_count: Option<i32>,
|
|
pub operator_count: Option<i32>,
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn get_user_usage<'c, E: sqlx::Executor<'c, Database = Postgres>>(
|
|
_db: E,
|
|
) -> Result<ActiveUserUsage> {
|
|
let usage = ActiveUserUsage { author_count: None, operator_count: None };
|
|
Ok(usage)
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
#[derive(serde::Serialize)]
|
|
pub struct Stats {}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub async fn get_stats_payload(
|
|
_db: &DB,
|
|
_reason: &SendStatsReason,
|
|
_minimal: bool,
|
|
) -> Result<Stats> {
|
|
// stats details are closed source
|
|
Ok(Stats {})
|
|
}
|
|
|
|
#[cfg(not(feature = "private"))]
|
|
pub fn sign_stats(_json: &str) -> String {
|
|
// stats details are closed source
|
|
String::new()
|
|
}
|