Buscar incidencias de Error Tracking
https://api.datadoghq.com/api/v2/error-tracking/issues/searchhttps://api.us3.datadoghq.com/api/v2/error-tracking/issues/searchhttps://api.us5.datadoghq.com/api/v2/error-tracking/issues/searchhttps://api.datadoghq.eu/api/v2/error-tracking/issues/searchhttps://api.ap1.datadoghq.com/api/v2/error-tracking/issues/searchhttps://api.ap2.datadoghq.com/api/v2/error-tracking/issues/searchhttps://api.uk1.datadoghq.com/api/v2/error-tracking/issues/searchhttps://api.ddog-gov.com/api/v2/error-tracking/issues/searchhttps://api.us2.ddog-gov.com/api/v2/error-tracking/issues/searchDescripción general
El endpoint de búsqueda de incidencias te permite buscar programáticamente incidencias dentro de tu organización. Este endpoint devuelve una lista de incidencias que coinciden con una consulta de búsqueda dada, siguiendo la sintaxis de búsqueda de eventos. Los resultados de la búsqueda están limitados a un máximo de 100 incidencias por solicitud.
OAuth apps require the error_tracking_read authorization scope to access this endpoint.
Argumentos
Cadenas de consulta
includeComma-separated list of relationship objects that should be included in the response. Possible values are issue, issue.assignee, issue.case, and issue.team_owners.
Solicitud
Body Data (required)
Carga útil de la solicitud de incidencias de búsqueda.
data [required]Carga útil de la solicitud de incidencia de búsqueda.
attributes [required]Object describing a search issue request.
assignee_idsFilter issues by assignee IDs. Multiple values are combined with OR logic.
from [required]Start date (inclusive) of the query in milliseconds since the Unix epoch.
order_byThe attribute to sort the search results by.
TOTAL_COUNT, FIRST_SEEN, IMPACTED_SESSIONS, PRIORITYpersonaPersona for the search. Either track(s) or persona(s) must be specified.
ALL, BROWSER, MOBILE, BACKENDquery [required]Search query following the event search syntax.
statesFilter issues by state. Multiple values are combined with OR logic.
team_idsFilter issues by team IDs. Multiple values are combined with OR logic.
to [required]End date (exclusive) of the query in milliseconds since the Unix epoch.
trackTrack of the events to query. Either track(s) or persona(s) must be specified.
trace, logs, rumtype [required]Type of the object.
search_request{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}Respuesta
OK
Search issues response payload.
dataArray of results matching the search query.
attributes [required]Object containing the information of a search result.
impacted_sessionsCount of sessions impacted by the issue over the queried time window.
impacted_usersCount of users impacted by the issue over the queried time window.
total_countTotal count of errors that match the issue over the queried time window.
id [required]Search result identifier (matches the nested issue's identifier).
relationshipsRelationships between the search result and other resources.
issueRelationship between the search result and the corresponding issue.
data [required]The issue the search result corresponds to.
id [required]Issue identifier.
type [required]Type of the object.
issuetype [required]Type of the object.
error_tracking_search_resultincludedArray of resources related to the search results.
<type=issue>The issue matching the request.
attributes [required]Object containing the information of an issue.
error_messageError message associated with the issue.
error_typeType of the error that matches the issue.
file_pathPath of the file where the issue occurred.
first_seenTimestamp of the first seen error in milliseconds since the Unix epoch.
first_seen_versionThe application version (for example, git commit hash) where the issue was first observed.
function_nameName of the function where the issue occurred.
is_crashError is a crash.
languagesArray of programming languages associated with the issue.
last_seenTimestamp of the last seen error in milliseconds since the Unix epoch.
last_seen_versionThe application version (for example, git commit hash) where the issue was last observed.
platformPlatform associated with the issue.
ANDROID, BACKEND, BROWSER, FLUTTER, IOS, REACT_NATIVE, ROKU, UNKNOWNregressionRegression information for an issue that was previously resolved and then reopened.
regressed_at [required]Timestamp when the issue was reopened (regressed).
regressed_at_versionApplication version where the regression was observed.
resolved_at [required]Timestamp when the issue was resolved before the regression.
serviceService name.
stateState of the issue
OPEN, ACKNOWLEDGED, RESOLVED, IGNORED, EXCLUDEDid [required]Issue identifier.
relationshipsRelationship between the issue and an assignee, case and/or teams.
assigneeRelationship between the issue and assignee.
data [required]The user the issue is assigned to.
id [required]User identifier.
type [required]Type of the object
usercaseRelationship between the issue and case.
data [required]The case the issue is attached to.
id [required]Case identifier.
type [required]Type of the object.
caseteam_ownersRelationship between the issue and teams.
data [required]Array of teams that are owners of the issue.
id [required]Team identifier.
type [required]Type of the object.
teamtype [required]Type of the object.
issue<type=case>The case attached to the issue.
attributes [required]Object containing the information of a case.
archived_atTimestamp of when the case was archived.
closed_atTimestamp of when the case was closed.
created_atTimestamp of when the case was created.
creation_sourceSource of the case creation.
descriptionDescription of the case.
due_dateDue date of the case.
insightsInsights of the case.
refReference of the insight.
resource_idInsight identifier.
typeType of the insight.
jira_issueJira issue of the case.
error_messageError message set when the Jira issue creation fails.
resultContains the identifiers and URL for a successfully created Jira issue.
account_idJira account identifier.
issue_idJira issue identifier.
issue_keyJira issue key.
issue_urlJira issue URL.
project_idJira project identifier.
project_keyJira project key.
statusCreation status of the Jira issue.
keyKey of the case.
linear_issueLinear issue of the case.
error_messageError message set when the Linear issue creation fails.
resultContains the identifiers and URL for a successfully created Linear issue.
account_idLinear account identifier.
issue_idLinear issue identifier.
issue_keyLinear issue key.
issue_urlLinear issue URL.
team_idLinear team identifier.
statusCreation status of the Linear issue.
modified_atTimestamp of when the case was last modified.
priorityWork item priority
NOT_DEFINEDNOT_DEFINED, P1, P2, P3, P4, P5statusDEPRECATED Deprecated way of representing the work item status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead.
OPEN, IN_PROGRESS, CLOSEDtitleTitle of the case.
typeType of the case.
id [required]Case identifier.
relationshipsResources related to a case.
assigneeRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]User resource type.
userusercreated_byRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]User resource type.
userusermodified_byRelationship to user.
data [required]Relationship to user object.
id [required]A unique identifier that represents the user.
type [required]User resource type.
useruserprojectRelationship to project.
data [required]Relationship to project object.
id [required]A unique identifier that represents the project.
type [required]Project resource type.
projectprojecttype [required]Type of the object.
case<type=user>The user to whom the issue is assigned.
attributes [required]Object containing the information of a user.
emailEmail of the user.
handleHandle of the user.
nameName of the user.
id [required]User identifier.
type [required]Type of the object
user<type=team>A team that owns an issue.
attributes [required]Object containing the information of a team.
handleThe team's identifier.
nameThe name of the team.
summaryA brief summary of the team, derived from its description.
id [required]Team identifier.
type [required]Type of the object.
team{
"data": [
{
"attributes": {
"impacted_sessions": 12,
"impacted_users": 4,
"total_count": 82
},
"id": "c1726a66-1f64-11ee-b338-da7ad0900002",
"relationships": {
"issue": {
"data": {
"id": "c1726a66-1f64-11ee-b338-da7ad0900002",
"type": "issue"
}
}
},
"type": "error_tracking_search_result"
}
],
"included": [
{
"attributes": {
"error_message": "object of type 'NoneType' has no len()",
"error_type": "builtins.TypeError",
"file_path": "/django-email/conduit/apps/core/utils.py",
"first_seen": 1671612804001,
"first_seen_version": "aaf65cd0",
"function_name": "filter_forbidden_tags",
"is_crash": false,
"languages": [
"PYTHON",
"GO"
],
"last_seen": 1671620003100,
"last_seen_version": "b6199f80",
"platform": "BACKEND",
"regression": {
"regressed_at": "2024-01-03T08:00:00Z",
"regressed_at_version": "v2.5.2",
"resolved_at": "2024-01-01T10:00:00Z"
},
"service": "email-api-py",
"state": "RESOLVED"
},
"id": "c1726a66-1f64-11ee-b338-da7ad0900002",
"relationships": {
"assignee": {
"data": {
"id": "87cb11a0-278c-440a-99fe-701223c80296",
"type": "user"
}
},
"case": {
"data": {
"id": "2841440d-e780-4fe2-96cd-6a8c1d194da5",
"type": "case"
}
},
"team_owners": {
"data": [
{
"id": "221b0179-6447-4d03-91c3-3ca98bf60e8a",
"type": "team"
}
]
}
},
"type": "issue"
}
]
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Ejemplo de código
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"from": 1671612804000,
"order_by": "IMPACTED_SESSIONS",
"persona": "BACKEND",
"query": "service:orders-* AND @language:go",
"to": 1671620004000
},
"type": "search_request"
}
}
EOF// Search error tracking issues returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.IssuesSearchRequest{
Data: datadogV2.IssuesSearchRequestData{
Attributes: datadogV2.IssuesSearchRequestDataAttributes{
Query: "service:orders-* AND @language:go",
From: 1671612804000,
To: 1671620004000,
Track: datadogV2.ISSUESSEARCHREQUESTDATAATTRIBUTESTRACK_TRACE.Ptr(),
},
Type: datadogV2.ISSUESSEARCHREQUESTDATATYPE_SEARCH_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewErrorTrackingApi(apiClient)
resp, r, err := api.SearchIssues(ctx, body, *datadogV2.NewSearchIssuesOptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ErrorTrackingApi.SearchIssues`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `ErrorTrackingApi.SearchIssues`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Search error tracking issues returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ErrorTrackingApi;
import com.datadog.api.client.v2.model.IssuesSearchRequest;
import com.datadog.api.client.v2.model.IssuesSearchRequestData;
import com.datadog.api.client.v2.model.IssuesSearchRequestDataAttributes;
import com.datadog.api.client.v2.model.IssuesSearchRequestDataAttributesTrack;
import com.datadog.api.client.v2.model.IssuesSearchRequestDataType;
import com.datadog.api.client.v2.model.IssuesSearchResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
ErrorTrackingApi apiInstance = new ErrorTrackingApi(defaultClient);
IssuesSearchRequest body =
new IssuesSearchRequest()
.data(
new IssuesSearchRequestData()
.attributes(
new IssuesSearchRequestDataAttributes()
.query("service:orders-* AND @language:go")
.from(1671612804000L)
.to(1671620004000L)
.track(IssuesSearchRequestDataAttributesTrack.TRACE))
.type(IssuesSearchRequestDataType.SEARCH_REQUEST));
try {
IssuesSearchResponse result = apiInstance.searchIssues(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ErrorTrackingApi#searchIssues");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Search error tracking issues returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi
from datadog_api_client.v2.model.issues_search_request import IssuesSearchRequest
from datadog_api_client.v2.model.issues_search_request_data import IssuesSearchRequestData
from datadog_api_client.v2.model.issues_search_request_data_attributes import IssuesSearchRequestDataAttributes
from datadog_api_client.v2.model.issues_search_request_data_attributes_track import (
IssuesSearchRequestDataAttributesTrack,
)
from datadog_api_client.v2.model.issues_search_request_data_type import IssuesSearchRequestDataType
body = IssuesSearchRequest(
data=IssuesSearchRequestData(
attributes=IssuesSearchRequestDataAttributes(
query="service:orders-* AND @language:go",
_from=1671612804000,
to=1671620004000,
track=IssuesSearchRequestDataAttributesTrack.TRACE,
),
type=IssuesSearchRequestDataType.SEARCH_REQUEST,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = ErrorTrackingApi(api_client)
response = api_instance.search_issues(body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Search error tracking issues returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ErrorTrackingAPI.new
body = DatadogAPIClient::V2::IssuesSearchRequest.new({
data: DatadogAPIClient::V2::IssuesSearchRequestData.new({
attributes: DatadogAPIClient::V2::IssuesSearchRequestDataAttributes.new({
query: "service:orders-* AND @language:go",
from: 1671612804000,
to: 1671620004000,
track: DatadogAPIClient::V2::IssuesSearchRequestDataAttributesTrack::TRACE,
}),
type: DatadogAPIClient::V2::IssuesSearchRequestDataType::SEARCH_REQUEST,
}),
})
p api_instance.search_issues(body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Search error tracking issues returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_error_tracking::ErrorTrackingAPI;
use datadog_api_client::datadogV2::api_error_tracking::SearchIssuesOptionalParams;
use datadog_api_client::datadogV2::model::IssuesSearchRequest;
use datadog_api_client::datadogV2::model::IssuesSearchRequestData;
use datadog_api_client::datadogV2::model::IssuesSearchRequestDataAttributes;
use datadog_api_client::datadogV2::model::IssuesSearchRequestDataAttributesTrack;
use datadog_api_client::datadogV2::model::IssuesSearchRequestDataType;
#[tokio::main]
async fn main() {
let body = IssuesSearchRequest::new(IssuesSearchRequestData::new(
IssuesSearchRequestDataAttributes::new(
1671612804000,
"service:orders-* AND @language:go".to_string(),
1671620004000,
)
.track(IssuesSearchRequestDataAttributesTrack::TRACE),
IssuesSearchRequestDataType::SEARCH_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = ErrorTrackingAPI::with_config(configuration);
let resp = api
.search_issues(body, SearchIssuesOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Search error tracking issues returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ErrorTrackingApi(configuration);
const params: v2.ErrorTrackingApiSearchIssuesRequest = {
body: {
data: {
attributes: {
query: "service:orders-* AND @language:go",
from: 1671612804000,
to: 1671620004000,
track: "trace",
},
type: "search_request",
},
},
};
apiInstance
.searchIssues(params)
.then((data: v2.IssuesSearchResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"