feat: default the telemetry url
parent
a043433760
commit
b615ffd159
|
@ -53,6 +53,9 @@ pub const DEFAULT_DATA_DIRECTORY_NAME: &str = ".influxdb3";
|
|||
/// The default bind address for the HTTP API.
|
||||
pub const DEFAULT_HTTP_BIND_ADDR: &str = "0.0.0.0:8181";
|
||||
|
||||
pub const DEFAULT_TELMETRY_ENDPOINT: &str =
|
||||
"https://brs5g5kad1.execute-api.us-east-1.amazonaws.com/v1/";
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
#[error("Cannot parse object store config: {0}")]
|
||||
|
@ -271,15 +274,6 @@ pub struct Config {
|
|||
)]
|
||||
pub disable_parquet_mem_cache: bool,
|
||||
|
||||
/// telemetry server endpoint
|
||||
#[clap(
|
||||
long = "telemetry-endpoint",
|
||||
env = "INFLUXDB3_TELEMETRY_ENDPOINT",
|
||||
default_value = "http://127.0.0.1:9999",
|
||||
action
|
||||
)]
|
||||
pub telemetry_endpoint: String,
|
||||
|
||||
/// The interval on which to evict expired entries from the Last-N-Value cache, expressed as a
|
||||
/// human-readable time, e.g., "20s", "1m", "1h".
|
||||
#[clap(
|
||||
|
@ -501,7 +495,7 @@ pub async fn command(config: Config) -> Result<()> {
|
|||
catalog.instance_id(),
|
||||
num_cpus,
|
||||
Some(Arc::clone(&write_buffer_impl.persisted_files())),
|
||||
config.telemetry_endpoint,
|
||||
DEFAULT_TELMETRY_ENDPOINT,
|
||||
)
|
||||
.await;
|
||||
|
||||
|
@ -554,7 +548,7 @@ async fn setup_telemetry_store(
|
|||
instance_id: Arc<str>,
|
||||
num_cpus: usize,
|
||||
persisted_files: Option<Arc<PersistedFiles>>,
|
||||
telemetry_endpoint: String,
|
||||
telemetry_endpoint: &'static str,
|
||||
) -> Arc<TelemetryStore> {
|
||||
let os = std::env::consts::OS;
|
||||
let influxdb_pkg_version = env!("CARGO_PKG_VERSION");
|
||||
|
|
|
@ -20,7 +20,7 @@ impl TelemetrySender {
|
|||
Self {
|
||||
client,
|
||||
full_url: base_url
|
||||
.join("./v3")
|
||||
.join("./telemetry")
|
||||
.expect("Cannot set the telemetry request path"),
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ pub(crate) struct TelemetryPayload {
|
|||
/// This function runs in the background and if any call fails
|
||||
/// there is no retrying mechanism and it is ok to lose a few samples
|
||||
pub(crate) async fn send_telemetry_in_background(
|
||||
full_url: String,
|
||||
full_url: &'static str,
|
||||
store: Arc<TelemetryStore>,
|
||||
duration_secs: Duration,
|
||||
) -> tokio::task::JoinHandle<()> {
|
||||
|
@ -123,7 +123,7 @@ mod tests {
|
|||
let client = reqwest::Client::new();
|
||||
let mut mock_server = Server::new_async().await;
|
||||
let mut sender = TelemetrySender::new(client, mock_server.url());
|
||||
let mock = mock_server.mock("POST", "/v3").create_async().await;
|
||||
let mock = mock_server.mock("POST", "/telemetry").create_async().await;
|
||||
let telem_payload = create_sample_payload();
|
||||
|
||||
let result = sender.try_sending(&telem_payload).await;
|
||||
|
|
|
@ -40,7 +40,7 @@ impl TelemetryStore {
|
|||
storage_type: Arc<str>,
|
||||
cores: usize,
|
||||
persisted_files: Option<Arc<dyn ParquetMetrics>>,
|
||||
telemetry_endpoint: String,
|
||||
telemetry_endpoint: &'static str,
|
||||
) -> Arc<Self> {
|
||||
debug!(
|
||||
instance_id = ?instance_id,
|
||||
|
@ -308,7 +308,7 @@ mod tests {
|
|||
Arc::from("Memory"),
|
||||
10,
|
||||
Some(parqet_file_metrics),
|
||||
"http://localhost/telemetry".to_owned(),
|
||||
"http://localhost/telemetry",
|
||||
)
|
||||
.await;
|
||||
// check snapshot
|
||||
|
|
Loading…
Reference in New Issue