DORAMetricsAPI

Struct DORAMetricsAPI 

Source
pub struct DORAMetricsAPI { /* private fields */ }
Expand description

Search, send, or delete events for DORA Metrics to measure and improve your software delivery performance. See the DORA Metrics page for more information.

Note: DORA Metrics are not available in the US1-FED site.

Implementations§

Source§

impl DORAMetricsAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_dora-metrics_GetDORAFailure.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.get_dora_failure("failure_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_dora-metrics_DeleteDORAFailure.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.delete_dora_failure("NO_VALUE".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_dora-metrics_DeleteDORADeployment.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.delete_dora_deployment("NO_VALUE".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_dora-metrics_GetDORADeployment.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.get_dora_deployment("deployment_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_dora-metrics_CreateDORADeployment.rs (line 24)
10async fn main() {
11    let body = DORADeploymentRequest::new(DORADeploymentRequestData::new(
12        DORADeploymentRequestAttributes::new(
13            1693491984000000000,
14            "shopist".to_string(),
15            1693491974000000000,
16        )
17        .git(DORAGitInfo::new(
18            "66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
19            "https://github.com/organization/example-repository".to_string(),
20        ))
21        .version("v1.12.07".to_string()),
22    ));
23    let configuration = datadog::Configuration::new();
24    let api = DORAMetricsAPI::with_config(configuration);
25    let resp = api.create_dora_deployment(body).await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
examples/v2_dora-metrics_CreateDORAIncident_1768887482.rs (line 25)
10async fn main() {
11    let body = DORAFailureRequest::new(DORAFailureRequestData::new(
12        DORAFailureRequestAttributes::new(1707842944500000000)
13            .finished_at(1707842944600000000)
14            .git(DORAGitInfo::new(
15                "66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
16                "https://github.com/organization/example-repository".to_string(),
17            ))
18            .name("Webserver is down failing all requests".to_string())
19            .services(vec!["shopist".to_string()])
20            .severity("High".to_string())
21            .team("backend".to_string())
22            .version("v1.12.07".to_string()),
23    ));
24    let configuration = datadog::Configuration::new();
25    let api = DORAMetricsAPI::with_config(configuration);
26    let resp = api.create_dora_incident(body).await;
27    if let Ok(value) = resp {
28        println!("{:#?}", value);
29    } else {
30        println!("{:#?}", resp.unwrap_err());
31    }
32}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

pub async fn create_dora_deployment( &self, body: DORADeploymentRequest, ) -> Result<DORADeploymentResponse, Error<CreateDORADeploymentError>>

Use this API endpoint to provide data about deployments for DORA metrics.

This is necessary for:

  • Deployment Frequency
  • Change Lead Time
  • Change Failure Rate
Examples found in repository?
examples/v2_dora-metrics_CreateDORADeployment.rs (line 25)
10async fn main() {
11    let body = DORADeploymentRequest::new(DORADeploymentRequestData::new(
12        DORADeploymentRequestAttributes::new(
13            1693491984000000000,
14            "shopist".to_string(),
15            1693491974000000000,
16        )
17        .git(DORAGitInfo::new(
18            "66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
19            "https://github.com/organization/example-repository".to_string(),
20        ))
21        .version("v1.12.07".to_string()),
22    ));
23    let configuration = datadog::Configuration::new();
24    let api = DORAMetricsAPI::with_config(configuration);
25    let resp = api.create_dora_deployment(body).await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
Source

pub async fn create_dora_deployment_with_http_info( &self, body: DORADeploymentRequest, ) -> Result<ResponseContent<DORADeploymentResponse>, Error<CreateDORADeploymentError>>

Use this API endpoint to provide data about deployments for DORA metrics.

This is necessary for:

  • Deployment Frequency
  • Change Lead Time
  • Change Failure Rate
Source

pub async fn create_dora_failure( &self, body: DORAFailureRequest, ) -> Result<DORAFailureResponse, Error<CreateDORAFailureError>>

Use this API endpoint to provide failure data for DORA metrics.

This is necessary for:

  • Change Failure Rate
  • Time to Restore
Examples found in repository?
examples/v2_dora-metrics_CreateDORAFailure.rs (line 32)
11async fn main() {
12    let body = DORAFailureRequest::new(DORAFailureRequestData::new(
13        DORAFailureRequestAttributes::new(1693491974000000000)
14            .custom_tags(Some(vec![
15                "language:java".to_string(),
16                "department:engineering".to_string(),
17            ]))
18            .env("staging".to_string())
19            .finished_at(1693491984000000000)
20            .git(DORAGitInfo::new(
21                "66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
22                "https://github.com/organization/example-repository".to_string(),
23            ))
24            .name("Webserver is down failing all requests.".to_string())
25            .services(vec!["shopist".to_string()])
26            .severity("High".to_string())
27            .team("backend".to_string())
28            .version("v1.12.07".to_string()),
29    ));
30    let configuration = datadog::Configuration::new();
31    let api = DORAMetricsAPI::with_config(configuration);
32    let resp = api.create_dora_failure(body).await;
33    if let Ok(value) = resp {
34        println!("{:#?}", value);
35    } else {
36        println!("{:#?}", resp.unwrap_err());
37    }
38}
Source

pub async fn create_dora_failure_with_http_info( &self, body: DORAFailureRequest, ) -> Result<ResponseContent<DORAFailureResponse>, Error<CreateDORAFailureError>>

Use this API endpoint to provide failure data for DORA metrics.

This is necessary for:

  • Change Failure Rate
  • Time to Restore
Source

pub async fn create_dora_incident( &self, body: DORAFailureRequest, ) -> Result<DORAFailureResponse, Error<CreateDORAIncidentError>>

Note: This endpoint is deprecated. Please use /api/v2/dora/failure instead.

Use this API endpoint to provide failure data for DORA metrics.

This is necessary for:

  • Change Failure Rate
  • Time to Restore
Examples found in repository?
examples/v2_dora-metrics_CreateDORAIncident_1768887482.rs (line 26)
10async fn main() {
11    let body = DORAFailureRequest::new(DORAFailureRequestData::new(
12        DORAFailureRequestAttributes::new(1707842944500000000)
13            .finished_at(1707842944600000000)
14            .git(DORAGitInfo::new(
15                "66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
16                "https://github.com/organization/example-repository".to_string(),
17            ))
18            .name("Webserver is down failing all requests".to_string())
19            .services(vec!["shopist".to_string()])
20            .severity("High".to_string())
21            .team("backend".to_string())
22            .version("v1.12.07".to_string()),
23    ));
24    let configuration = datadog::Configuration::new();
25    let api = DORAMetricsAPI::with_config(configuration);
26    let resp = api.create_dora_incident(body).await;
27    if let Ok(value) = resp {
28        println!("{:#?}", value);
29    } else {
30        println!("{:#?}", resp.unwrap_err());
31    }
32}
More examples
Hide additional examples
examples/v2_dora-metrics_CreateDORAIncident.rs (line 31)
10async fn main() {
11    let body = DORAFailureRequest::new(DORAFailureRequestData::new(
12        DORAFailureRequestAttributes::new(1693491974000000000)
13            .custom_tags(Some(vec![
14                "language:java".to_string(),
15                "department:engineering".to_string(),
16            ]))
17            .env("staging".to_string())
18            .finished_at(1693491984000000000)
19            .git(DORAGitInfo::new(
20                "66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
21                "https://github.com/organization/example-repository".to_string(),
22            ))
23            .name("Webserver is down failing all requests.".to_string())
24            .services(vec!["shopist".to_string()])
25            .severity("High".to_string())
26            .team("backend".to_string())
27            .version("v1.12.07".to_string()),
28    ));
29    let configuration = datadog::Configuration::new();
30    let api = DORAMetricsAPI::with_config(configuration);
31    let resp = api.create_dora_incident(body).await;
32    if let Ok(value) = resp {
33        println!("{:#?}", value);
34    } else {
35        println!("{:#?}", resp.unwrap_err());
36    }
37}
Source

pub async fn create_dora_incident_with_http_info( &self, body: DORAFailureRequest, ) -> Result<ResponseContent<DORAFailureResponse>, Error<CreateDORAIncidentError>>

Note: This endpoint is deprecated. Please use /api/v2/dora/failure instead.

Use this API endpoint to provide failure data for DORA metrics.

This is necessary for:

  • Change Failure Rate
  • Time to Restore
Source

pub async fn delete_dora_deployment( &self, deployment_id: String, ) -> Result<(), Error<DeleteDORADeploymentError>>

Use this API endpoint to delete a deployment event.

Examples found in repository?
examples/v2_dora-metrics_DeleteDORADeployment.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.delete_dora_deployment("NO_VALUE".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_dora_deployment_with_http_info( &self, deployment_id: String, ) -> Result<ResponseContent<()>, Error<DeleteDORADeploymentError>>

Use this API endpoint to delete a deployment event.

Source

pub async fn delete_dora_failure( &self, failure_id: String, ) -> Result<(), Error<DeleteDORAFailureError>>

Use this API endpoint to delete a failure event.

Examples found in repository?
examples/v2_dora-metrics_DeleteDORAFailure.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.delete_dora_failure("NO_VALUE".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_dora_failure_with_http_info( &self, failure_id: String, ) -> Result<ResponseContent<()>, Error<DeleteDORAFailureError>>

Use this API endpoint to delete a failure event.

Source

pub async fn get_dora_deployment( &self, deployment_id: String, ) -> Result<DORAFetchResponse, Error<GetDORADeploymentError>>

Use this API endpoint to get a deployment event.

Examples found in repository?
examples/v2_dora-metrics_GetDORADeployment.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.get_dora_deployment("deployment_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn get_dora_deployment_with_http_info( &self, deployment_id: String, ) -> Result<ResponseContent<DORAFetchResponse>, Error<GetDORADeploymentError>>

Use this API endpoint to get a deployment event.

Source

pub async fn get_dora_failure( &self, failure_id: String, ) -> Result<DORAFetchResponse, Error<GetDORAFailureError>>

Use this API endpoint to get a failure event.

Examples found in repository?
examples/v2_dora-metrics_GetDORAFailure.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DORAMetricsAPI::with_config(configuration);
9    let resp = api.get_dora_failure("failure_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn get_dora_failure_with_http_info( &self, failure_id: String, ) -> Result<ResponseContent<DORAFetchResponse>, Error<GetDORAFailureError>>

Use this API endpoint to get a failure event.

Source

pub async fn list_dora_deployments( &self, body: DORAListDeploymentsRequest, ) -> Result<DORAListResponse, Error<ListDORADeploymentsError>>

Use this API endpoint to get a list of deployment events.

Examples found in repository?
examples/v2_dora-metrics_ListDORADeployments.rs (line 29)
11async fn main() {
12    let body = DORAListDeploymentsRequest::new(
13        DORAListDeploymentsRequestData::new(
14            DORAListDeploymentsRequestAttributes::new()
15                .from(
16                    DateTime::parse_from_rfc3339("2025-03-23T00:00:00+00:00")
17                        .expect("Failed to parse datetime")
18                        .with_timezone(&Utc),
19                )
20                .limit(1)
21                .to(DateTime::parse_from_rfc3339("2025-03-24T00:00:00+00:00")
22                    .expect("Failed to parse datetime")
23                    .with_timezone(&Utc)),
24        )
25        .type_(DORAListDeploymentsRequestDataType::DORA_DEPLOYMENTS_LIST_REQUEST),
26    );
27    let configuration = datadog::Configuration::new();
28    let api = DORAMetricsAPI::with_config(configuration);
29    let resp = api.list_dora_deployments(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
Source

pub async fn list_dora_deployments_with_http_info( &self, body: DORAListDeploymentsRequest, ) -> Result<ResponseContent<DORAListResponse>, Error<ListDORADeploymentsError>>

Use this API endpoint to get a list of deployment events.

Source

pub async fn list_dora_failures( &self, body: DORAListFailuresRequest, ) -> Result<DORAListResponse, Error<ListDORAFailuresError>>

Use this API endpoint to get a list of failure events.

Examples found in repository?
examples/v2_dora-metrics_ListDORAFailures.rs (line 29)
11async fn main() {
12    let body = DORAListFailuresRequest::new(
13        DORAListFailuresRequestData::new(
14            DORAListFailuresRequestAttributes::new()
15                .from(
16                    DateTime::parse_from_rfc3339("2025-03-23T00:00:00+00:00")
17                        .expect("Failed to parse datetime")
18                        .with_timezone(&Utc),
19                )
20                .limit(1)
21                .to(DateTime::parse_from_rfc3339("2025-03-24T00:00:00+00:00")
22                    .expect("Failed to parse datetime")
23                    .with_timezone(&Utc)),
24        )
25        .type_(DORAListFailuresRequestDataType::DORA_FAILURES_LIST_REQUEST),
26    );
27    let configuration = datadog::Configuration::new();
28    let api = DORAMetricsAPI::with_config(configuration);
29    let resp = api.list_dora_failures(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
Source

pub async fn list_dora_failures_with_http_info( &self, body: DORAListFailuresRequest, ) -> Result<ResponseContent<DORAListResponse>, Error<ListDORAFailuresError>>

Use this API endpoint to get a list of failure events.

Trait Implementations§

Source§

impl Clone for DORAMetricsAPI

Source§

fn clone(&self) -> DORAMetricsAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DORAMetricsAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DORAMetricsAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,