Response containing the Sensitive Data Scanner usage for each hour for a given organization.
Expand All
Field
Type
Description
usage
[object]
Get hourly usage for Sensitive Data Scanner.
apm_scanned_bytes
int64
The total number of bytes scanned of APM usage across all usage types by the Sensitive Data Scanner from the start of the given hour’s month until the given hour.
events_scanned_bytes
int64
The total number of bytes scanned of Events usage across all usage types by the Sensitive Data Scanner from the start of the given hour’s month until the given hour.
hour
date-time
The hour for the usage.
logs_scanned_bytes
int64
The total number of bytes scanned of logs usage by the Sensitive Data Scanner from the start of the given hour’s month until the given hour.
org_name
string
The organization name.
public_id
string
The organization public ID.
rum_scanned_bytes
int64
The total number of bytes scanned of RUM usage across all usage types by the Sensitive Data Scanner from the start of the given hour’s month until the given hour.
total_scanned_bytes
int64
The total number of bytes scanned across all usage types by the Sensitive Data Scanner from the start of the given hour’s month until the given hour.
# Required query arguments exportstart_hr="CHANGE_ME" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
"""
Get hourly usage for sensitive data scanner returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.usage_metering_apiimportUsageMeteringApifromdatetimeimportdatetimefromdateutil.tzimporttzutcconfiguration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]withApiClient(configuration)asapi_client:api_instance=UsageMeteringApi(api_client)response=api_instance.get_usage_sds(start_hr=datetime(2021,11,11,11,11,11,111000,tzinfo=tzutc()),)print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Get hourly usage for sensitive data scanner returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]endapi_instance=DatadogAPIClient::V1::UsageMeteringAPI.newpapi_instance.get_usage_sds("2021-11-11T11:11:11.111+00:00")
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// Get hourly usage for sensitive data scanner returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""time""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewUsageMeteringApi(apiClient)resp,r,err:=api.GetUsageSDS(ctx,time.Date(2021,11,11,11,11,11,111000,time.UTC),*datadogV1.NewGetUsageSDSOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `UsageMeteringApi.GetUsageSDS`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `UsageMeteringApi.GetUsageSDS`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Get hourly usage for sensitive data scanner returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.UsageMeteringApi;importcom.datadog.api.client.v1.model.UsageSDSResponse;importjava.time.OffsetDateTime;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));UsageMeteringApiapiInstance=newUsageMeteringApi(defaultClient);try{UsageSDSResponseresult=apiInstance.getUsageSDS(OffsetDateTime.parse("2021-11-11T11:11:11.111+00:00"));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling UsageMeteringApi#getUsageSDS");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// Get hourly usage for sensitive data scanner returns "OK" response
usechrono::{DateTime,Utc};usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_usage_metering::GetUsageSDSOptionalParams;usedatadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=UsageMeteringAPI::with_config(configuration);letresp=api.get_usage_sds(DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00").expect("Failed to parse datetime").with_timezone(&Utc),GetUsageSDSOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get hourly usage for sensitive data scanner returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});constapiInstance=newv1.UsageMeteringApi(configuration);constparams: v1.UsageMeteringApiGetUsageSDSRequest={startHr: newDate(2021,11,11,11,11,11,111000),};apiInstance.getUsageSDS(params).then((data: v1.UsageSDSResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.