-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: Add support for configuring observability via WasmCloudHostConfig #53
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "wasmcloud-operator-types" | ||
version = "0.1.5" | ||
version = "0.1.6" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,8 @@ pub struct WasmCloudHostConfigSpec { | |
pub policy_service: Option<PolicyService>, | ||
/// Kubernetes scheduling options for the wasmCloud host. | ||
pub scheduling_options: Option<KubernetesSchedulingOptions>, | ||
/// Observability options for configuring the OpenTelemetry integration | ||
pub observability: Option<ObservabilityConfiguration>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)] | ||
|
@@ -101,6 +103,45 @@ pub struct KubernetesSchedulingOptions { | |
pub pod_template_additions: Option<PodSpec>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ObservabilityConfiguration { | ||
#[serde(default)] | ||
pub enable: bool, | ||
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. Should we be adding the documentation to each of these options so people know what they do? I know we have the command line flags, but wasn't sure if we were documenting these or not 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. We should, I'll follow-up with a PR that does the documenting part, including the README |
||
pub endpoint: String, | ||
pub protocol: Option<OtelProtocol>, | ||
pub logs: Option<OtelSignalConfiguration>, | ||
pub metrics: Option<OtelSignalConfiguration>, | ||
pub traces: Option<OtelSignalConfiguration>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum OtelProtocol { | ||
Grpc, | ||
Http, | ||
} | ||
|
||
impl std::fmt::Display for OtelProtocol { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
write!( | ||
f, | ||
"{}", | ||
match self { | ||
OtelProtocol::Grpc => "grpc", | ||
OtelProtocol::Http => "http", | ||
} | ||
) | ||
} | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct OtelSignalConfiguration { | ||
pub enable: Option<bool>, | ||
pub endpoint: Option<String>, | ||
} | ||
|
||
/// This is a workaround for the fact that we can't override the PodSpec schema to make containers | ||
/// an optional field. It generates the OpenAPI schema for the PodSpec type the same way that | ||
/// kube.rs does while dropping any required fields. | ||
|
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.
Super Nit: Technically this should be 0.2.0 since you're adding new features
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.
you're absolutely right, this should probably be a 0.2.0, I think we've broken the rule about patch versions a number of times already, so I think we'll probably want to have that conversation when we do the work to move to v1alpha2.