Skip to content
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added configurable metric kind weights in OpenTelemetry metrics payload generator.
- Added new telemetry to OpenTelemetry metrics generation: data points per
second. This opens the door for doing the same for other payloads.
- HTTP blackhole now supports an OtlpMetric body variant and will always respond
with a full success.

## [0.25.9]
## Added
Expand Down
6 changes: 2 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ metrics-exporter-prometheus = { version = "0.15", default-features = false, feat
"http-listener",
"uds-listener",
] }
opentelemetry-proto = { version = "0.29", default-features = false }
prost = "0.13"
rand = { version = "0.9", default-features = false }
rustc-hash = { version = "1.1" }
Expand Down
2 changes: 2 additions & 0 deletions lading/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ nix = { version = "0.30", default-features = false, features = [
num_cpus = { version = "1.16" }
num-traits = { version = "0.2", default-features = false }
once_cell = { workspace = true }
opentelemetry-proto = { workspace = true, features = ["gen-tonic", "metrics"]}
prost = { workspace = true }
rand = { workspace = true, default-features = false, features = [
"small_rng",
"std",
Expand Down
8 changes: 8 additions & 0 deletions lading/src/blackhole/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use http::{HeaderMap, header::InvalidHeaderValue, status::InvalidStatusCode};
use http_body_util::{BodyExt, combinators::BoxBody};
use hyper::{Request, Response, StatusCode, header};
use metrics::counter;
use opentelemetry_proto::tonic::collector::metrics::v1::ExportMetricsServiceResponse;
use prost::Message;
use serde::{Deserialize, Serialize};
use std::{net::SocketAddr, time::Duration};
use tracing::error;
Expand Down Expand Up @@ -54,6 +56,8 @@ pub enum BodyVariant {
RawBytes,
/// Respond with a hardcoded string value
Static(String),
/// Respond with Otlp Metric Full Success, see <https://opentelemetry.io/docs/specs/otlp/#full-success-1>
OtlpMetric,
}

fn default_body_variant() -> BodyVariant {
Expand Down Expand Up @@ -210,6 +214,10 @@ impl Http {
BodyVariant::Nothing => vec![],
BodyVariant::RawBytes => config.raw_bytes.clone(),
BodyVariant::Static(val) => val.as_bytes().to_vec(),
BodyVariant::OtlpMetric => {
let response = ExportMetricsServiceResponse::default();
response.encode_to_vec()
}
};

Ok(Self {
Expand Down
2 changes: 1 addition & 1 deletion lading_payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description = "A tool for load testing daemons."
[dependencies]
bytes = { workspace = true }
byte-unit = { workspace = true, features = [] }
opentelemetry-proto = { version = "0.29.0", features = [
opentelemetry-proto = { workspace = true, features = [
"trace",
"metrics",
"logs",
Expand Down
Loading