diff --git a/helm-releases/parseable-1.6.1.tgz b/helm-releases/parseable-1.6.1.tgz new file mode 100644 index 000000000..8af99ed88 Binary files /dev/null and b/helm-releases/parseable-1.6.1.tgz differ diff --git a/helm/Chart.yaml b/helm/Chart.yaml index afdfc14a1..fc4bc1239 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: parseable description: Helm chart for Parseable Server type: application -version: 1.6.0 -appVersion: "v1.6.0" +version: 1.6.1 +appVersion: "v1.6.1" maintainers: - name: Parseable Team email: hi@parseable.com diff --git a/helm/values.yaml b/helm/values.yaml index f10b9b86f..7b3622819 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -1,7 +1,7 @@ parseable: image: repository: containers.parseable.com/parseable/parseable - tag: v1.6.0 + tag: v1.6.1 pullPolicy: Always ## object store can be local, s3 or blob. ## local needs to be false if set to object store. diff --git a/index.yaml b/index.yaml index 78443bc6a..94c1aca07 100644 --- a/index.yaml +++ b/index.yaml @@ -32,9 +32,32 @@ entries: - https://charts.parseable.com/helm-releases/operator-0.0.1.tgz version: 0.0.1 parseable: + - apiVersion: v2 + appVersion: v1.6.1 + created: "2024-11-10T19:55:43.241719159+05:30" + dependencies: + - condition: vector.enabled + name: vector + repository: https://helm.vector.dev + version: 0.20.1 + - condition: fluent-bit.enabled + name: fluent-bit + repository: https://fluent.github.io/helm-charts + version: 0.25.0 + description: Helm chart for Parseable Server + digest: e8f0de15dfc11ba54076f87fd60e168d8a9513fc777e99dd449738ac301aa5ce + maintainers: + - email: hi@parseable.com + name: Parseable Team + url: https://parseable.com + name: parseable + type: application + urls: + - https://charts.parseable.com/helm-releases/parseable-1.6.1.tgz + version: 1.6.1 - apiVersion: v2 appVersion: v1.6.0 - created: "2024-11-04T23:08:54.113415331+05:30" + created: "2024-11-10T19:55:43.232691271+05:30" dependencies: - condition: vector.enabled name: vector @@ -57,7 +80,7 @@ entries: version: 1.6.0 - apiVersion: v2 appVersion: v1.5.5 - created: "2024-11-04T23:08:54.105220003+05:30" + created: "2024-11-10T19:55:43.222316865+05:30" dependencies: - condition: vector.enabled name: vector @@ -80,7 +103,7 @@ entries: version: 1.5.5 - apiVersion: v2 appVersion: v1.5.4 - created: "2024-11-04T23:08:54.09647126+05:30" + created: "2024-11-10T19:55:43.213187209+05:30" dependencies: - condition: vector.enabled name: vector @@ -103,7 +126,7 @@ entries: version: 1.5.4 - apiVersion: v2 appVersion: v1.5.3 - created: "2024-11-04T23:08:54.085514103+05:30" + created: "2024-11-10T19:55:43.202516044+05:30" dependencies: - condition: vector.enabled name: vector @@ -126,7 +149,7 @@ entries: version: 1.5.3 - apiVersion: v2 appVersion: v1.5.2 - created: "2024-11-04T23:08:54.076280243+05:30" + created: "2024-11-10T19:55:43.193042167+05:30" dependencies: - condition: vector.enabled name: vector @@ -149,7 +172,7 @@ entries: version: 1.5.2 - apiVersion: v2 appVersion: v1.5.1 - created: "2024-11-04T23:08:54.067351842+05:30" + created: "2024-11-10T19:55:43.184004654+05:30" dependencies: - condition: vector.enabled name: vector @@ -172,7 +195,7 @@ entries: version: 1.5.1 - apiVersion: v2 appVersion: v1.5.0 - created: "2024-11-04T23:08:54.058847437+05:30" + created: "2024-11-10T19:55:43.172919793+05:30" dependencies: - condition: vector.enabled name: vector @@ -195,7 +218,7 @@ entries: version: 1.5.0 - apiVersion: v2 appVersion: v1.4.0 - created: "2024-11-04T23:08:54.049623362+05:30" + created: "2024-11-10T19:55:43.165130529+05:30" dependencies: - condition: vector.enabled name: vector @@ -218,7 +241,7 @@ entries: version: 1.4.1 - apiVersion: v2 appVersion: v1.4.0 - created: "2024-11-04T23:08:54.040046919+05:30" + created: "2024-11-10T19:55:43.155790972+05:30" dependencies: - condition: vector.enabled name: vector @@ -241,7 +264,7 @@ entries: version: 1.4.0 - apiVersion: v2 appVersion: v1.3.0 - created: "2024-11-04T23:08:54.033069399+05:30" + created: "2024-11-10T19:55:43.14523084+05:30" dependencies: - condition: vector.enabled name: vector @@ -264,7 +287,7 @@ entries: version: 1.3.1 - apiVersion: v2 appVersion: v1.3.0 - created: "2024-11-04T23:08:54.024111964+05:30" + created: "2024-11-10T19:55:43.136900385+05:30" dependencies: - condition: vector.enabled name: vector @@ -287,7 +310,7 @@ entries: version: 1.3.0 - apiVersion: v2 appVersion: v1.2.0 - created: "2024-11-04T23:08:54.014807406+05:30" + created: "2024-11-10T19:55:43.130864019+05:30" dependencies: - condition: vector.enabled name: vector @@ -310,7 +333,7 @@ entries: version: 1.2.0 - apiVersion: v2 appVersion: v1.1.0 - created: "2024-11-04T23:08:54.007909276+05:30" + created: "2024-11-10T19:55:43.125786816+05:30" dependencies: - condition: vector.enabled name: vector @@ -333,7 +356,7 @@ entries: version: 1.1.0 - apiVersion: v2 appVersion: v1.0.0 - created: "2024-11-04T23:08:54.001580981+05:30" + created: "2024-11-10T19:55:43.120117491+05:30" dependencies: - condition: vector.enabled name: vector @@ -356,7 +379,7 @@ entries: version: 1.0.0 - apiVersion: v2 appVersion: v0.9.0 - created: "2024-11-04T23:08:53.994323713+05:30" + created: "2024-11-10T19:55:43.113284276+05:30" dependencies: - condition: vector.enabled name: vector @@ -379,7 +402,7 @@ entries: version: 0.9.0 - apiVersion: v2 appVersion: v0.8.1 - created: "2024-11-04T23:08:53.988325533+05:30" + created: "2024-11-10T19:55:43.106648823+05:30" dependencies: - condition: vector.enabled name: vector @@ -402,7 +425,7 @@ entries: version: 0.8.1 - apiVersion: v2 appVersion: v0.8.0 - created: "2024-11-04T23:08:53.981439444+05:30" + created: "2024-11-10T19:55:43.098483569+05:30" dependencies: - condition: vector.enabled name: vector @@ -425,7 +448,7 @@ entries: version: 0.8.0 - apiVersion: v2 appVersion: v0.7.3 - created: "2024-11-04T23:08:53.972053686+05:30" + created: "2024-11-10T19:55:43.088127597+05:30" dependencies: - condition: vector.enabled name: vector @@ -448,7 +471,7 @@ entries: version: 0.7.3 - apiVersion: v2 appVersion: v0.7.2 - created: "2024-11-04T23:08:53.965339966+05:30" + created: "2024-11-10T19:55:43.079582861+05:30" dependencies: - condition: vector.enabled name: vector @@ -471,7 +494,7 @@ entries: version: 0.7.2 - apiVersion: v2 appVersion: v0.7.1 - created: "2024-11-04T23:08:53.95837925+05:30" + created: "2024-11-10T19:55:43.070410855+05:30" dependencies: - condition: vector.enabled name: vector @@ -494,7 +517,7 @@ entries: version: 0.7.1 - apiVersion: v2 appVersion: v0.7.0 - created: "2024-11-04T23:08:53.951242897+05:30" + created: "2024-11-10T19:55:43.059682741+05:30" dependencies: - condition: vector.enabled name: vector @@ -517,7 +540,7 @@ entries: version: 0.7.0 - apiVersion: v2 appVersion: v0.6.2 - created: "2024-11-04T23:08:53.946032461+05:30" + created: "2024-11-10T19:55:43.051286689+05:30" dependencies: - condition: vector.enabled name: vector @@ -540,7 +563,7 @@ entries: version: 0.6.2 - apiVersion: v2 appVersion: v0.6.1 - created: "2024-11-04T23:08:53.940288149+05:30" + created: "2024-11-10T19:55:43.041963961+05:30" dependencies: - condition: vector.enabled name: vector @@ -563,7 +586,7 @@ entries: version: 0.6.1 - apiVersion: v2 appVersion: v0.6.0 - created: "2024-11-04T23:08:53.933857141+05:30" + created: "2024-11-10T19:55:43.031688298+05:30" dependencies: - condition: vector.enabled name: vector @@ -586,7 +609,7 @@ entries: version: 0.6.0 - apiVersion: v2 appVersion: v0.5.1 - created: "2024-11-04T23:08:53.92850483+05:30" + created: "2024-11-10T19:55:43.023287506+05:30" dependencies: - condition: vector.enabled name: vector @@ -609,7 +632,7 @@ entries: version: 0.5.1 - apiVersion: v2 appVersion: v0.5.0 - created: "2024-11-04T23:08:53.922742901+05:30" + created: "2024-11-10T19:55:43.014276866+05:30" dependencies: - condition: vector.enabled name: vector @@ -632,7 +655,7 @@ entries: version: 0.5.0 - apiVersion: v2 appVersion: v0.4.4 - created: "2024-11-04T23:08:53.916415422+05:30" + created: "2024-11-10T19:55:43.003247314+05:30" dependencies: - condition: vector.enabled name: vector @@ -655,7 +678,7 @@ entries: version: 0.4.5 - apiVersion: v2 appVersion: v0.4.3 - created: "2024-11-04T23:08:53.910927641+05:30" + created: "2024-11-10T19:55:42.99339699+05:30" dependencies: - condition: vector.enabled name: vector @@ -678,7 +701,7 @@ entries: version: 0.4.4 - apiVersion: v2 appVersion: v0.4.2 - created: "2024-11-04T23:08:53.905440324+05:30" + created: "2024-11-10T19:55:42.985140983+05:30" dependencies: - condition: vector.enabled name: vector @@ -701,7 +724,7 @@ entries: version: 0.4.3 - apiVersion: v2 appVersion: v0.4.1 - created: "2024-11-04T23:08:53.89915637+05:30" + created: "2024-11-10T19:55:42.974483032+05:30" dependencies: - condition: vector.enabled name: vector @@ -724,7 +747,7 @@ entries: version: 0.4.2 - apiVersion: v2 appVersion: v0.4.0 - created: "2024-11-04T23:08:53.893406254+05:30" + created: "2024-11-10T19:55:42.966875613+05:30" dependencies: - condition: vector.enabled name: vector @@ -747,7 +770,7 @@ entries: version: 0.4.1 - apiVersion: v2 appVersion: v0.4.0 - created: "2024-11-04T23:08:53.886518285+05:30" + created: "2024-11-10T19:55:42.957800095+05:30" dependencies: - condition: vector.enabled name: vector @@ -770,7 +793,7 @@ entries: version: 0.4.0 - apiVersion: v2 appVersion: v0.3.1 - created: "2024-11-04T23:08:53.878992954+05:30" + created: "2024-11-10T19:55:42.947480743+05:30" dependencies: - condition: vector.enabled name: vector @@ -793,7 +816,7 @@ entries: version: 0.3.1 - apiVersion: v2 appVersion: v0.3.0 - created: "2024-11-04T23:08:53.872792391+05:30" + created: "2024-11-10T19:55:42.93903071+05:30" description: Helm chart for Parseable Server digest: ff30739229b727dc637f62fd4481c886a6080ce4556bae10cafe7642ddcfd937 name: parseable @@ -803,7 +826,7 @@ entries: version: 0.3.0 - apiVersion: v2 appVersion: v0.2.2 - created: "2024-11-04T23:08:53.872055018+05:30" + created: "2024-11-10T19:55:42.938252762+05:30" description: Helm chart for Parseable Server digest: 477d0dc2f0c07d4f4c32e105d4bdd70c71113add5c2a75ac5f1cb42aa0276db7 name: parseable @@ -813,7 +836,7 @@ entries: version: 0.2.2 - apiVersion: v2 appVersion: v0.2.1 - created: "2024-11-04T23:08:53.871308957+05:30" + created: "2024-11-10T19:55:42.937434222+05:30" description: Helm chart for Parseable Server digest: 84826fcd1b4c579f301569f43b0309c07e8082bad76f5cdd25f86e86ca2e8192 name: parseable @@ -823,7 +846,7 @@ entries: version: 0.2.1 - apiVersion: v2 appVersion: v0.2.0 - created: "2024-11-04T23:08:53.870674131+05:30" + created: "2024-11-10T19:55:42.936475832+05:30" description: Helm chart for Parseable Server digest: 7a759f7f9809f3935cba685e904c021a0b645f217f4e45b9be185900c467edff name: parseable @@ -833,7 +856,7 @@ entries: version: 0.2.0 - apiVersion: v2 appVersion: v0.1.1 - created: "2024-11-04T23:08:53.869942952+05:30" + created: "2024-11-10T19:55:42.935449677+05:30" description: Helm chart for Parseable Server digest: 37993cf392f662ec7b1fbfc9a2ba00ec906d98723e38f3c91ff1daca97c3d0b3 name: parseable @@ -843,7 +866,7 @@ entries: version: 0.1.1 - apiVersion: v2 appVersion: v0.1.0 - created: "2024-11-04T23:08:53.869214024+05:30" + created: "2024-11-10T19:55:42.934407948+05:30" description: Helm chart for Parseable Server digest: 1d580d072af8d6b1ebcbfee31c2e16c907d08db754780f913b5f0032b403789b name: parseable @@ -853,7 +876,7 @@ entries: version: 0.1.0 - apiVersion: v2 appVersion: v0.0.8 - created: "2024-11-04T23:08:53.868528282+05:30" + created: "2024-11-10T19:55:42.933412088+05:30" description: Helm chart for Parseable Server digest: c805254ffa634f96ecec448bcfff9973339aa9487dd8199b21b17b79a4de9345 name: parseable @@ -863,7 +886,7 @@ entries: version: 0.0.8 - apiVersion: v2 appVersion: v0.0.7 - created: "2024-11-04T23:08:53.867795024+05:30" + created: "2024-11-10T19:55:42.932460526+05:30" description: Helm chart for Parseable Server digest: c591f617ed1fe820bb2c72a4c976a78126f1d1095d552daa07c4700f46c4708a name: parseable @@ -873,7 +896,7 @@ entries: version: 0.0.7 - apiVersion: v2 appVersion: v0.0.6 - created: "2024-11-04T23:08:53.867068285+05:30" + created: "2024-11-10T19:55:42.931438402+05:30" description: Helm chart for Parseable Server digest: f9ae56a6fcd6a59e7bee0436200ddbedeb74ade6073deb435b8fcbaf08dda795 name: parseable @@ -883,7 +906,7 @@ entries: version: 0.0.6 - apiVersion: v2 appVersion: v0.0.5 - created: "2024-11-04T23:08:53.866283845+05:30" + created: "2024-11-10T19:55:42.930151921+05:30" description: Helm chart for Parseable Server digest: 4d6b08a064fba36e16feeb820b77e1e8e60fb6de48dbf7ec8410d03d10c26ad0 name: parseable @@ -893,7 +916,7 @@ entries: version: 0.0.5 - apiVersion: v2 appVersion: v0.0.2 - created: "2024-11-04T23:08:53.86559413+05:30" + created: "2024-11-10T19:55:42.925595731+05:30" description: Helm chart for Parseable Server digest: 38a0a3e4c498afbbcc76ebfcb9cb598fa2ca843a53cc93b3cb4f135b85c10844 name: parseable @@ -903,7 +926,7 @@ entries: version: 0.0.2 - apiVersion: v2 appVersion: v0.0.1 - created: "2024-11-04T23:08:53.86478338+05:30" + created: "2024-11-10T19:55:42.923931367+05:30" description: Helm chart for Parseable Server digest: 1f1142db092b9620ee38bb2294ccbb1c17f807b33bf56da43816af7fe89f301e name: parseable @@ -932,4 +955,4 @@ entries: urls: - https://charts.parseable.io/helm-releases/parseable-operator-0.0.1.tgz version: 0.0.1 -generated: "2024-11-04T23:08:53.86285479+05:30" +generated: "2024-11-10T19:55:42.913296562+05:30" diff --git a/server/src/about.rs b/server/src/about.rs index 81b612129..5a1d20e03 100644 --- a/server/src/about.rs +++ b/server/src/about.rs @@ -17,19 +17,20 @@ * */ +use crate::analytics; +use crate::option::Config; +use crate::storage::StorageMetadata; +use crate::utils::update::{self, LatestRelease}; use chrono::Duration; use chrono_humanize::{Accuracy, Tense}; use crossterm::style::Stylize; +use once_cell::sync::OnceCell; use std::env; use std::path::Path; use sysinfo::System; use ulid::Ulid; - -use crate::analytics; -use crate::option::Config; -use crate::storage::StorageMetadata; -use crate::utils::update; - +// Expose some static variables for internal usage +pub static LATEST_RELEASE: OnceCell> = OnceCell::new(); static K8S_ENV_TO_CHECK: &str = "KUBERNETES_SERVICE_HOST"; fn is_docker() -> bool { @@ -50,6 +51,18 @@ pub fn platform() -> &'static str { } } +pub fn set_latest_release(latest_release: Option) { + LATEST_RELEASE + .set(latest_release.clone()) + .expect("only set once") +} + +pub fn get_latest_release() -> &'static Option { + LATEST_RELEASE + .get() + .expect("latest release is fetched from global state") +} + // User Agent for Download API call // Format: Parseable/// (; ) pub fn user_agent(uid: &Ulid) -> String { @@ -122,7 +135,7 @@ pub async fn print(config: &Config, meta: &StorageMetadata) { } else { None }; - + set_latest_release(latest_release.clone()); print_about( current.released_version, latest_release, diff --git a/server/src/analytics.rs b/server/src/analytics.rs index c011b5961..9e6fca098 100644 --- a/server/src/analytics.rs +++ b/server/src/analytics.rs @@ -20,6 +20,7 @@ use crate::about::{current, platform}; use crate::handlers::http::cluster::utils::check_liveness; use crate::handlers::http::{base_path_without_preceding_slash, cluster}; +use crate::handlers::STREAM_NAME_HEADER_KEY; use crate::option::{Mode, CONFIG}; use crate::storage; use crate::{metadata, stats}; @@ -131,7 +132,13 @@ impl Report { pub async fn send(&self) { let client = reqwest::Client::new(); - let _ = client.post(ANALYTICS_SERVER_URL).json(&self).send().await; + + let _ = client + .post(ANALYTICS_SERVER_URL) + .header(STREAM_NAME_HEADER_KEY, "serverusageevent") + .json(&self) + .send() + .await; } } diff --git a/server/src/handlers.rs b/server/src/handlers.rs index a69847239..2232ce53a 100644 --- a/server/src/handlers.rs +++ b/server/src/handlers.rs @@ -22,7 +22,7 @@ pub mod livetail; const PREFIX_TAGS: &str = "x-p-tag-"; const PREFIX_META: &str = "x-p-meta-"; -const STREAM_NAME_HEADER_KEY: &str = "x-p-stream"; +pub const STREAM_NAME_HEADER_KEY: &str = "x-p-stream"; const CACHE_RESULTS_HEADER_KEY: &str = "x-p-cache-results"; const CACHE_VIEW_HEADER_KEY: &str = "x-p-show-cached"; const USER_ID_HEADER_KEY: &str = "x-p-user-id"; diff --git a/server/src/handlers/http/about.rs b/server/src/handlers/http/about.rs index 1b455d919..11b08e390 100644 --- a/server/src/handlers/http/about.rs +++ b/server/src/handlers/http/about.rs @@ -20,10 +20,9 @@ use actix_web::web::Json; use serde_json::json; use crate::{ - about, + about::{self, get_latest_release}, option::{Mode, CONFIG}, storage::StorageMetadata, - utils::update, }; use std::path::PathBuf; @@ -51,14 +50,13 @@ pub async fn about() -> Json { let meta = StorageMetadata::global(); let current_release = about::current(); - let latest_release = update::get_latest(&meta.deployment_id).await; - + let latest_release = get_latest_release(); let (update_available, latest_release) = match latest_release { - Ok(latest_release) => ( + Some(latest_release) => ( latest_release.version > current_release.released_version, Some(format!("v{}", latest_release.version)), ), - Err(_) => (false, None), + None => (false, None), }; let current_version = format!("v{}", current_release.released_version); diff --git a/server/src/utils/update.rs b/server/src/utils/update.rs index e063a1b82..f6fe8680f 100644 --- a/server/src/utils/update.rs +++ b/server/src/utils/update.rs @@ -25,7 +25,7 @@ use crate::about; use super::uid; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct LatestRelease { pub version: semver::Version, pub date: DateTime, @@ -37,20 +37,17 @@ pub async fn get_latest(deployment_id: &uid::Uid) -> Result