1. Why an app #
When dashboards are no longer enough.
Use cases #
- A tailor-made business view (order journey, status of a fleet of stores) combining Dynatrace data and internal data.
- An operations tool (managing maintenance windows, guided actions) for support teams.
- An integration with a third-party system via app functions.
2. Developing #
The Dynatrace App Toolkit.
Commands #
npx dt-app@latest create --environment-url https://<env>.apps.dynatrace.com
cd mon-app
npm run start # développement local relié à l'environnement
npm run deploy # publication dans l'environnement// Requête Grail depuis l'interface
import { useDql } from '@dynatrace-sdk/react-hooks';
export const ErrorsByService = () => {
const { data, isLoading } = useDql({
query: 'fetch logs | filter loglevel == "ERROR" | summarize errors = count(), by: { service.name } | sort errors desc | limit 10',
});
return isLoading ? 'Chargement…' : <pre>{JSON.stringify(data?.records, null, 2)}</pre>;
};The required permissions (reading logs, documents...) are declared in app.config.json; the user must also have these rights for the app to read the data.
Good to know: Dynatrace evolves very quickly (new platform, Grail, apps): check screen names and API versions in your environment's documentation.
