- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Queries populate your app with data from Datadog APIs or supported integrations. They take inputs from other queries or from UI components and return outputs for use in other queries or in UI components.
The Action Catalog within the Datadog App provides actions that can be performed as queries against your infrastructure and integrations using App Builder. You can orchestrate and automate your end-to-end processes by linking together actions that perform tasks in your cloud providers, SaaS tools, and Datadog accounts.
To add a query, click the plus (+) icon in the Queries section and search for an action to add to your app. After you’ve added the query action, it appears in the query list above the query editor. Click and drag queries to reorder them. Select a query to configure it.
Queries rely on Connections for authentication. App Builder shares connections with Workflow Automation.
Run Settings determine when a query is executed. There are two options:
Configuring debounce ensures that your query is only triggered once per user input. By default, debounce is set to 0
milliseconds (ms). To prevent a query from being called too frequently, increase the debounce. Configure debounce in the Advanced section of a query.
You can set a condition that must be met before a query can run. To set the condition for a query, enter an expression in the Condition field in the Advanced section of the query. This condition must evaluate to true before the query can run. For example, if you want a given query to run only if a UI component named select0
exists and is not empty, use the following expression:
${select0.value && select0.value.length > 0}
Perform a post-query transformation to simplify or transform the output of a query. Add a post-query transformation in the Advanced section of a query.
For example, the Slack List Channels action returns an array of dictionaries containing the ID and name for each channel. To discard the IDs and return only an array of names, add the following query transformation:
// Use `outputs` to reference the query's unformatted output.
// TODO: Apply transformations to the raw query output
arr = []
object = outputs.channels
for (var item in object) {
arr.push(object[item].name);
}
return arr
Similar to UI component events, you can configure a reaction to trigger after a query executes. A post-query hook can set a UI component state, open or close a modal, trigger another query, or even run custom JavaScript. For example, the ECS Task Manager blueprint’s scaleService
query uses a post-query hook to rerun the describeService
query after it executes.
You can use state functions in post-query hooks.
To display a toast (a brief notification message) to the user when the system returns an error, toggle Show Toast on Errors in the Advanced section of a query.
To prompt a user for confirmation before the query runs, toggle the Requires Confirmation option in the Advanced section of a query.
To run a query repeatedly at a set interval while the app is open on someone’s screen, enter the interval in milliseconds (ms) as the Polling interval in the Advanced section of a query.
Note: The query does not run in the background; it only runs when someone has the app open.
Sometimes when you are building or testing an app in the editor, you might want to avoid executing a real query, or avoid executing the same query repeatedly. When you enable Mocked outputs and run your query, App Builder populates outputs with mocked data instead of running the query action.
You can generate mocked outputs from a previous query run or provide them manually.
To generate mocked output data from a previous query run, perform the following steps:
To provide mocked outputs manually, perform the following steps:
Using the GUI
Using JSON
outputs
in the Inspect Data section of the query.When executing a query, App Builder performs the following steps in the order listed:
query.rawOutputs
.query.outputs
equal to the result. This process takes a snapshot of app data and passes it to the post query transformation.App Builder queries can trigger Workflow Automation workflows. Apps can then use the results of those workflows.
This app provides a button to trigger a workflow. The workflow sends a poll to a Slack channel asking the user to pick from one of two options. Based on the option the user chooses, the workflow issues one of two different HTTP GET requests, which then returns data that is displayed in the app.
https://catfact.ninja/fact
.https://dogapi.dog/api/v2/facts
.Content-Type
of application/json
const catFact = $.Steps.Get_cat_fact?.body?.fact;
const dogFactRaw = $.Steps.Get_dog_fact?.body;
let dogFact;
try {
const parsedDogFact = JSON.parse(dogFactRaw);
dogFact = parsedDogFact.data?.[0]?.attributes?.body;
} catch {
// Do nothing
}
return catFact != null ? catFact : dogFact;
output
with the value {{ Steps.Function.data }}
and the Data Type string
.To connect App Builder to the workflow, perform the following steps:
triggerWorkflow0
.${triggerWorkflow0?.outputs?.workflowOutputs?.output}
.${triggerWorkflow0.isLoading}
(click </> to enter an expression)triggerWorkflow0
After you get data from a query in App Builder, you can use data transformers to combine and transform that data.
This app provides buttons to fetch facts about two numbers from an API. It then uses a data transformer to calculate and display the sum of the two numbers.
mathFact1
http://numbersapi.com/random/trivia
mathFact2
http://numbersapi.com/random/trivia
numberTransformer
. Under Inputs, under function () {, enter the following:// get both random facts
const fact1 = mathFact1.outputs.body;
const fact2 = mathFact2.outputs.body;
// parse the facts to get the first number that appears in them
const num1 = fact1.match(/\d+/)[0];
const num2 = fact2.match(/\d+/)[0];
// complete arithmetic on the numbers to find the sum
const numSum = Number(num1) + Number(num2)
return numSum
${mathFact1.outputs.body}
.${mathFact2.outputs.body}
.${numberTransformer.outputs}
.추가 유용한 문서, 링크 및 기사:
Do you have questions or feedback? Join the #app-builder channel on the Datadog Community Slack.