Skip to content

Add semver check #2

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ jobs:
args: --all -- --check
- name: Lint
run: bash ./scripts/lint.sh
semver:
runs-on: ubuntu-latest
name: semver
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo-semver-checks
uses: obi1kenobi/[email protected]
external-types:
strategy:
matrix:
Expand Down
12 changes: 6 additions & 6 deletions opentelemetry-sdk/src/trace/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Default for Config {
Box::new(Sampler::TraceIdRatioBased(r))
} else {
handle_error(
Error::Other(String::from(
Error::Others(String::from(
"Missing or invalid OTEL_TRACES_SAMPLER_ARG value. Falling back to default: 1.0"))
);
Box::new(Sampler::TraceIdRatioBased(1.0))
Expand All @@ -148,7 +148,7 @@ impl Default for Config {
))))
} else {
handle_error(
Error::Other(String::from(
Error::Others(String::from(
"Missing or invalid OTEL_TRACES_SAMPLER_ARG value. Falling back to default: 1.0"
)));
Box::new(Sampler::ParentBased(Box::new(Sampler::TraceIdRatioBased(
Expand All @@ -158,24 +158,24 @@ impl Default for Config {
}
"parentbased_jaeger_remote" => {
handle_error(
Error::Other(String::from(
Error::Others(String::from(
"Unimplemented parentbased_jaeger_remote sampler. Falling back to default: parentbased_always_on"
)));
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
}
"jaeger_remote" => {
handle_error(
Error::Other(String::from("Unimplemented jaeger_remote sampler. Falling back to default: parentbased_always_on")));
Error::Others(String::from("Unimplemented jaeger_remote sampler. Falling back to default: parentbased_always_on")));
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
}
"xray" => {
handle_error(
Error::Other(String::from("Unimplemented xray sampler. Falling back to default: parentbased_always_on")));
Error::Others(String::from("Unimplemented xray sampler. Falling back to default: parentbased_always_on")));
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
}
s => {
handle_error(
Error::Other(format!("Unrecognised OTEL_TRACES_SAMPLER value: {}. Falling back to default: parentbased_always_on",
Error::Others(format!("Unrecognised OTEL_TRACES_SAMPLER value: {}. Falling back to default: parentbased_always_on",
s
)));
Box::new(Sampler::ParentBased(Box::new(Sampler::AlwaysOn)))
Expand Down
6 changes: 3 additions & 3 deletions opentelemetry/src/global/error_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ pub enum Error {

#[error("{0}")]
/// Other types of failures not covered by the variants above.
Other(String),
Others(String),
}

impl<T> From<PoisonError<T>> for Error {
fn from(err: PoisonError<T>) -> Self {
Error::Other(err.to_string())
Error::Others(err.to_string())
}
}

Expand All @@ -69,7 +69,7 @@ pub fn handle_error<T: Into<Error>>(err: T) {
Error::Propagation(err) => {
eprintln!("OpenTelemetry propagation error occurred. {}", err)
}
Error::Other(err_msg) => eprintln!("OpenTelemetry error occurred. {}", err_msg),
Error::Others(err_msg) => eprintln!("OpenTelemetry error occurred. {}", err_msg),
},
}
}
Expand Down
Loading