Skip to content

Commit

Permalink
Add telemetry.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassot committed Jan 16, 2024
1 parent 02eab07 commit 5bf4ca7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions quickwit/quickwit-lambda/src/indexer/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use quickwit_proto::indexing::CpuCapacity;
use quickwit_proto::metastore::{CreateIndexRequest, MetastoreError, MetastoreService};
use quickwit_proto::types::{NodeId, PipelineUid};
use quickwit_storage::StorageResolver;
use quickwit_telemetry::payload::{QuickwitFeature, QuickwitTelemetryInfo, TelemetryEvent};
use tracing::{debug, info, instrument};

use super::environment::{CONFIGURATION_TEMPLATE, DISABLE_MERGE, INDEX_CONFIG_URI, INDEX_ID};
Expand Down Expand Up @@ -186,6 +187,12 @@ pub async fn ingest(args: IngestArgs) -> anyhow::Result<IndexingStatistics> {
..Default::default()
};
let runtimes_config = RuntimesConfig::default();
let services: HashSet<String> =
HashSet::from_iter([QuickwitService::Indexer.as_str().to_string()]);
let telemetry_info =
QuickwitTelemetryInfo::new(services, HashSet::from_iter([QuickwitFeature::AwsLambda]));
let _telemetry_handle_opt = quickwit_telemetry::start_telemetry_loop(telemetry_info);
quickwit_telemetry::send_telemetry_event(TelemetryEvent::RunCommand).await;
start_actor_runtimes(
runtimes_config,
&HashSet::from_iter([QuickwitService::Indexer]),
Expand Down
9 changes: 9 additions & 0 deletions quickwit/quickwit-lambda/src/searcher/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::collections::HashSet;
use std::net::{Ipv4Addr, SocketAddr};
use std::sync::Arc;

use quickwit_config::service::QuickwitService;
use quickwit_config::SearcherConfig;
use quickwit_proto::metastore::MetastoreServiceClient;
use quickwit_proto::search::{SearchRequest, SearchResponse};
Expand All @@ -29,6 +31,7 @@ use quickwit_search::{
};
use quickwit_serve::{search_request_from_api_request, SearchRequestQueryString};
use quickwit_storage::StorageResolver;
use quickwit_telemetry::payload::{QuickwitFeature, QuickwitTelemetryInfo, TelemetryEvent};
use tokio::sync::OnceCell;
use tracing::debug;

Expand Down Expand Up @@ -104,6 +107,12 @@ pub async fn search(args: SearchArgs) -> anyhow::Result<SearchResponseRest> {
debug!(args=?args, "lambda-search");
let (node_config, storage_resolver, metastore) =
load_node_config(CONFIGURATION_TEMPLATE).await?;
let services: HashSet<String> =
HashSet::from_iter([QuickwitService::Searcher.as_str().to_string()]);
let telemetry_info =
QuickwitTelemetryInfo::new(services, HashSet::from_iter([QuickwitFeature::AwsLambda]));
let _telemetry_handle_opt = quickwit_telemetry::start_telemetry_loop(telemetry_info);
quickwit_telemetry::send_telemetry_event(TelemetryEvent::RunCommand).await;
let search_request = search_request_from_api_request(vec![INDEX_ID.clone()], args.query)?;
debug!(search_request=?search_request, "search-request");
let search_response: SearchResponse = single_node_search(
Expand Down
1 change: 1 addition & 0 deletions quickwit/quickwit-telemetry/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ pub enum QuickwitFeature {
Jaeger,
Otlp,
PostgresqMetastore,
AwsLambda,
}

fn hashed_host_username() -> String {
Expand Down

0 comments on commit 5bf4ca7

Please sign in to comment.