stackabletech / operator-rs

A simple wrapper/framework around kube-rs to make implementing Operators/Controllers easier
Apache License 2.0
112 stars 11 forks source link

feat(stackable-telemetry): Add support for env_var per configured subscriber #801

Closed NickLarsenNZ closed 1 month ago

NickLarsenNZ commented 1 month ago

Description

Part of https://github.com/stackabletech/issues/issues/531

Now each tracing subscriber log level can be configured via the given environment variable.

let trace_guard = Tracing::builder()
    .service_name("hdfs_operator")
    .with_console_output("HDFS_OPERATOR_LOG", LevelFilter::INFO)
    .with_otlp_log_exporter("HDFS_OPERATOR_OTLP_LOG", LevelFilter::DEBUG)
    .with_otlp_trace_exporter("HDFS_OPERATOR_OTLP_TRACE", LevelFilter::TRACE)
    .build();

Definition of Done Checklist

# Author
- [ ] Changes are OpenShift compatible
- [ ] CRD changes approved
- [ ] Integration tests passed (for non trivial changes)
# Reviewer
- [ ] Code contains useful comments
- [ ] (Integration-)Test cases added
- [ ] Documentation added or updated
- [ ] Changelog updated
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
# Acceptance
- [ ] Feature Tracker has been updated
- [ ] Proper release label has been added