pub struct SpansAPI { /* private fields */ }Expand description
Search and aggregate your spans from your Datadog platform over HTTP.
Implementations§
source§impl SpansAPI
impl SpansAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let resp = api
.list_spans_get(ListSpansGetOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let response =
api.list_spans_get_with_pagination(ListSpansGetOptionalParams::default().page_limit(2));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
async fn main() {
let body = SpansListRequest::new().data(
SpansListRequestData::new()
.attributes(
SpansListRequestAttributes::new()
.filter(
SpansQueryFilter::new()
.from("now-15m".to_string())
.query("*".to_string())
.to("now".to_string()),
)
.options(SpansQueryOptions::new().timezone("GMT".to_string()))
.page(SpansListRequestPage::new().limit(25))
.sort(SpansSort::TIMESTAMP_ASCENDING),
)
.type_(SpansListRequestType::SEARCH_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let resp = api.list_spans(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
async fn main() {
let body = SpansAggregateRequest::new().data(
SpansAggregateData::new()
.attributes(
SpansAggregateRequestAttributes::new()
.compute(vec![SpansCompute::new(SpansAggregationFunction::COUNT)
.interval("5m".to_string())
.type_(SpansComputeType::TIMESERIES)])
.filter(
SpansQueryFilter::new()
.from("now-15m".to_string())
.query("*".to_string())
.to("now".to_string()),
),
)
.type_(SpansAggregateRequestType::AGGREGATE_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let resp = api.aggregate_spans(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
async fn main() {
let body = SpansListRequest::new().data(
SpansListRequestData::new()
.attributes(
SpansListRequestAttributes::new()
.filter(
SpansQueryFilter::new()
.from("now-15m".to_string())
.query("service:python*".to_string())
.to("now".to_string()),
)
.options(SpansQueryOptions::new().timezone("GMT".to_string()))
.page(SpansListRequestPage::new().limit(2))
.sort(SpansSort::TIMESTAMP_ASCENDING),
)
.type_(SpansListRequestType::SEARCH_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let response = api.list_spans_with_pagination(body);
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn aggregate_spans(
&self,
body: SpansAggregateRequest,
) -> Result<SpansAggregateResponse, Error<AggregateSpansError>>
pub async fn aggregate_spans( &self, body: SpansAggregateRequest, ) -> Result<SpansAggregateResponse, Error<AggregateSpansError>>
The API endpoint to aggregate spans into buckets and compute metrics and timeseries.
This endpoint is rate limited to 300 requests per hour.
Examples found in repository?
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
async fn main() {
let body = SpansAggregateRequest::new().data(
SpansAggregateData::new()
.attributes(
SpansAggregateRequestAttributes::new()
.compute(vec![SpansCompute::new(SpansAggregationFunction::COUNT)
.interval("5m".to_string())
.type_(SpansComputeType::TIMESERIES)])
.filter(
SpansQueryFilter::new()
.from("now-15m".to_string())
.query("*".to_string())
.to("now".to_string()),
),
)
.type_(SpansAggregateRequestType::AGGREGATE_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let resp = api.aggregate_spans(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn aggregate_spans_with_http_info(
&self,
body: SpansAggregateRequest,
) -> Result<ResponseContent<SpansAggregateResponse>, Error<AggregateSpansError>>
pub async fn aggregate_spans_with_http_info( &self, body: SpansAggregateRequest, ) -> Result<ResponseContent<SpansAggregateResponse>, Error<AggregateSpansError>>
The API endpoint to aggregate spans into buckets and compute metrics and timeseries.
This endpoint is rate limited to 300 requests per hour.
sourcepub async fn list_spans(
&self,
body: SpansListRequest,
) -> Result<SpansListResponse, Error<ListSpansError>>
pub async fn list_spans( &self, body: SpansListRequest, ) -> Result<SpansListResponse, Error<ListSpansError>>
List endpoint returns spans that match a span search query. Results are paginated.
Use this endpoint to build complex spans filtering and search.
This endpoint is rate limited to 300 requests per hour.
Examples found in repository?
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
async fn main() {
let body = SpansListRequest::new().data(
SpansListRequestData::new()
.attributes(
SpansListRequestAttributes::new()
.filter(
SpansQueryFilter::new()
.from("now-15m".to_string())
.query("*".to_string())
.to("now".to_string()),
)
.options(SpansQueryOptions::new().timezone("GMT".to_string()))
.page(SpansListRequestPage::new().limit(25))
.sort(SpansSort::TIMESTAMP_ASCENDING),
)
.type_(SpansListRequestType::SEARCH_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let resp = api.list_spans(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn list_spans_with_pagination(
&self,
body: SpansListRequest,
) -> impl Stream<Item = Result<Span, Error<ListSpansError>>> + '_
pub fn list_spans_with_pagination( &self, body: SpansListRequest, ) -> impl Stream<Item = Result<Span, Error<ListSpansError>>> + '_
Examples found in repository?
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
async fn main() {
let body = SpansListRequest::new().data(
SpansListRequestData::new()
.attributes(
SpansListRequestAttributes::new()
.filter(
SpansQueryFilter::new()
.from("now-15m".to_string())
.query("service:python*".to_string())
.to("now".to_string()),
)
.options(SpansQueryOptions::new().timezone("GMT".to_string()))
.page(SpansListRequestPage::new().limit(2))
.sort(SpansSort::TIMESTAMP_ASCENDING),
)
.type_(SpansListRequestType::SEARCH_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let response = api.list_spans_with_pagination(body);
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}sourcepub async fn list_spans_with_http_info(
&self,
body: SpansListRequest,
) -> Result<ResponseContent<SpansListResponse>, Error<ListSpansError>>
pub async fn list_spans_with_http_info( &self, body: SpansListRequest, ) -> Result<ResponseContent<SpansListResponse>, Error<ListSpansError>>
List endpoint returns spans that match a span search query. Results are paginated.
Use this endpoint to build complex spans filtering and search.
This endpoint is rate limited to 300 requests per hour.
sourcepub async fn list_spans_get(
&self,
params: ListSpansGetOptionalParams,
) -> Result<SpansListResponse, Error<ListSpansGetError>>
pub async fn list_spans_get( &self, params: ListSpansGetOptionalParams, ) -> Result<SpansListResponse, Error<ListSpansGetError>>
List endpoint returns spans that match a span search query. Results are paginated.
Use this endpoint to see your latest spans.
This endpoint is rate limited to 300 requests per hour.
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let resp = api
.list_spans_get(ListSpansGetOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn list_spans_get_with_pagination(
&self,
params: ListSpansGetOptionalParams,
) -> impl Stream<Item = Result<Span, Error<ListSpansGetError>>> + '_
pub fn list_spans_get_with_pagination( &self, params: ListSpansGetOptionalParams, ) -> impl Stream<Item = Result<Span, Error<ListSpansGetError>>> + '_
Examples found in repository?
9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let configuration = datadog::Configuration::new();
let api = SpansAPI::with_config(configuration);
let response =
api.list_spans_get_with_pagination(ListSpansGetOptionalParams::default().page_limit(2));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}sourcepub async fn list_spans_get_with_http_info(
&self,
params: ListSpansGetOptionalParams,
) -> Result<ResponseContent<SpansListResponse>, Error<ListSpansGetError>>
pub async fn list_spans_get_with_http_info( &self, params: ListSpansGetOptionalParams, ) -> Result<ResponseContent<SpansListResponse>, Error<ListSpansGetError>>
List endpoint returns spans that match a span search query. Results are paginated.
Use this endpoint to see your latest spans.
This endpoint is rate limited to 300 requests per hour.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpansAPI
impl !RefUnwindSafe for SpansAPI
impl Send for SpansAPI
impl Sync for SpansAPI
impl Unpin for SpansAPI
impl !UnwindSafe for SpansAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)