Skip to content

Commit 88998fc

Browse files
authored
chore: Remove instrumentation from trivial functions (#1023)
* chore: Remove instrumentation from trivial functions Note: These functions are not cpu/io bound, so they are rather uninteresting in the context of tracing. * chore: Use fully-qualified tracing::warn! * chore: Update changelog * chore: Add missing changelog entry
1 parent 41f9832 commit 88998fc

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

crates/stackable-operator/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Removed
8+
9+
- Remove instrumenation from uninteresting funtions ([#1023]).
10+
11+
[#1023]: https://github.com/stackabletech/operator-rs/pull/1023
12+
713
## [0.93.1] - 2025-05-20
814

915
### Added
@@ -23,6 +29,7 @@ All notable changes to this project will be documented in this file.
2329
- Import are now more granular in general.
2430
- BREAKING: Update to `kube` to `1.0.0` and `k8s-openapi` to `0.25.0`.
2531
Use k8s `1.33` for compilation ([#1037]).
32+
- Separate some developer docs from CRD descriptions ([#1040]).
2633

2734
### Fixed
2835

@@ -33,6 +40,7 @@ All notable changes to this project will be documented in this file.
3340
[#1025]: https://github.com/stackabletech/operator-rs/pull/1025
3441
[#1029]: https://github.com/stackabletech/operator-rs/pull/1029
3542
[#1037]: https://github.com/stackabletech/operator-rs/pull/1037
43+
[#1040]: https://github.com/stackabletech/operator-rs/pull/1040
3644

3745
## [0.92.0] - 2025-04-14
3846

crates/stackable-operator/src/builder/pod/container.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use k8s_openapi::api::core::v1::{
77
SecurityContext, VolumeMount,
88
};
99
use snafu::{ResultExt as _, Snafu};
10-
use tracing::instrument;
1110
#[cfg(doc)]
1211
use {k8s_openapi::api::core::v1::PodSpec, std::collections::BTreeMap};
1312

@@ -211,7 +210,6 @@ impl ContainerBuilder {
211210
///
212211
/// Previously, this function unconditionally added [`VolumeMount`]s, which resulted in invalid
213212
/// [`PodSpec`]s.
214-
#[instrument(skip(self))]
215213
fn add_volume_mount_impl(&mut self, volume_mount: VolumeMount) -> Result<&mut Self> {
216214
if let Some(existing_volume_mount) = self.volume_mounts.get(&volume_mount.mount_path) {
217215
if existing_volume_mount != &volume_mount {

crates/stackable-operator/src/builder/pod/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use k8s_openapi::{
1010
apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::ObjectMeta},
1111
};
1212
use snafu::{OptionExt, ResultExt, Snafu};
13-
use tracing::{instrument, warn};
1413

1514
use crate::{
1615
builder::{
@@ -291,7 +290,6 @@ impl PodBuilder {
291290
///
292291
/// Previously, this function unconditionally added [`Volume`]s, which resulted in invalid
293292
/// [`PodSpec`]s.
294-
#[instrument(skip(self))]
295293
pub fn add_volume(&mut self, volume: Volume) -> Result<&mut Self> {
296294
if let Some(existing_volume) = self.volumes.get(&volume.name) {
297295
if existing_volume != &volume {
@@ -610,19 +608,19 @@ impl PodBuilder {
610608

611609
pod_spec
612610
.check_resource_requirement(ResourceRequirementsType::Limits, "cpu")
613-
.unwrap_or_else(|err| warn!("{}", err));
611+
.unwrap_or_else(|err| tracing::warn!("{err}"));
614612

615613
pod_spec
616614
.check_resource_requirement(ResourceRequirementsType::Limits, "memory")
617-
.unwrap_or_else(|err| warn!("{}", err));
615+
.unwrap_or_else(|err| tracing::warn!("{err}"));
618616

619617
pod_spec
620618
.check_limit_to_request_ratio(&ComputeResource::Cpu, LIMIT_REQUEST_RATIO_CPU)
621-
.unwrap_or_else(|err| warn!("{}", err));
619+
.unwrap_or_else(|err| tracing::warn!("{err}"));
622620

623621
pod_spec
624622
.check_limit_to_request_ratio(&ComputeResource::Memory, LIMIT_REQUEST_RATIO_MEMORY)
625-
.unwrap_or_else(|err| warn!("{}", err));
623+
.unwrap_or_else(|err| tracing::warn!("{err}"));
626624

627625
pod_spec
628626
}

0 commit comments

Comments
 (0)