-
Notifications
You must be signed in to change notification settings - Fork 21
feat(telemetry)!: Add Installation signature and AppProduct changes payloads #2213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,9 @@ pub enum MetricNamespace { | |
| Telemetry, | ||
| Apm, | ||
| Sidecar, | ||
| Civisibility, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because this enum uses Useful? React with 👍 / 👎. |
||
| Mlobs, | ||
| Ddtraceapi, | ||
| } | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use std::collections::HashMap; | ||
| use std::hash::Hasher; | ||
|
|
||
| use crate::data::metrics; | ||
|
|
@@ -11,6 +12,16 @@ use serde::{Deserialize, Serialize}; | |
| pub struct Dependency { | ||
| pub name: String, | ||
| pub version: Option<String>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub hash: Option<String>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub metadata: Option<Vec<DependencyMetadata>>, | ||
|
Comment on lines
+15
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Adding Useful? React with 👍 / 👎.
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, Hash, PartialEq, Eq, Clone, Default)] | ||
| pub struct DependencyMetadata { | ||
| pub r#type: String, | ||
| pub value: String, | ||
| } | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, Hash, PartialEq, Eq, Clone, Default)] | ||
|
|
@@ -36,27 +47,61 @@ pub struct Configuration { | |
| #[serde(rename_all = "snake_case")] | ||
| pub enum ConfigurationOrigin { | ||
| EnvVar, | ||
| OtelEnvVar, | ||
| Code, | ||
| DdConfig, | ||
| RemoteConfig, | ||
| Default, | ||
| LocalStableConfig, | ||
| FleetStableConfig, | ||
| Calculated, | ||
| Unknown, | ||
| } | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] | ||
| pub struct Error { | ||
| pub code: Option<i64>, | ||
| pub message: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Debug)] | ||
| pub struct AppStarted { | ||
| pub configuration: Vec<Configuration>, | ||
| pub dependencies: Vec<Dependency>, | ||
| pub integrations: Vec<Integration>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub install_signature: Option<InstallSignature>, | ||
| #[serde(skip_serializing_if = "HashMap::is_empty")] | ||
| pub products: HashMap<String, ProductState>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub error: Option<Error>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Debug, Clone)] | ||
| pub struct InstallSignature { | ||
| pub install_id: Option<String>, | ||
| pub install_type: Option<String>, | ||
| pub install_time: Option<String>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Debug)] | ||
| pub struct AppDependenciesLoaded { | ||
| pub dependencies: Vec<Dependency>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] | ||
| pub struct ProductState { | ||
| pub enabled: bool, | ||
| pub version: Option<String>, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub error: Option<Error>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Debug)] | ||
| pub struct AppProductChange { | ||
| pub products: HashMap<String, ProductState>, | ||
| } | ||
|
|
||
| #[derive(Serialize, Debug)] | ||
| pub struct AppIntegrationsChange { | ||
| pub integrations: Vec<Integration>, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,9 @@ pub mod info; | |
| pub mod metrics; | ||
| pub mod worker; | ||
|
|
||
| pub use libdd_common::tag::{parse_tags, Tag}; | ||
| pub use libdd_common::{parse_uri, Endpoint}; | ||
|
Comment on lines
+21
to
+22
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is here. But we expose |
||
|
|
||
| pub fn build_host() -> data::Host { | ||
| debug!("Building telemetry host information"); | ||
| let hostname = info::os::real_hostname().unwrap_or_else(|_| String::from("unknown_hostname")); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the default
telemetryfeature enabled, this newly added field is never initialized byTraceExporterBuilder::new(), so constructing the builder fails to compile (cargo check -p libdd-data-pipelinereports E0063 at theSelf { ... }initializer). Please addtelemetry_handle: Noneunder the same cfg gate innew()so the default data-pipeline build remains usable.Useful? React with 👍 / 👎.