# Dynatrace Monitor and observe your SDK with Dynatrace. [Dynatrace](https://docs.dynatrace.com/docs) provides real-time monitoring of user interactions, backend services, and infrastructure. Dynatrace supports various environments including cloud, on-premise, and hybrid setups. ## Java SDK ### Prerequisites - Version 17.3 (or later) of the Java SDK ### Dynatrace OneAgent To monitor your application using [Dynatrace OneAgent](https://docs.dynatrace.com/docs/discover-dynatrace/platform/oneagent), there is no need to change the SDK. Follow the steps to [install the OneAgent](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/installation-and-operation) on your host and configure it to monitor your application. To test an application with Java SDK and OneAgent, you can use the provided [example application](https://github.com/commercetools/commercetools-sdk-java-v2/tree/main/examples/spring-dynatrace-oneagent). ### Dynatrace OpenTelemetry To monitor your application using OpenTelemetry, follow the steps for [OpenTelemetry in the Java SDK](/dev-tooling/observability/opentelemetry.md#java-sdk). ## TypeScript SDK ### Prerequisites - Version 3.0.0 (or later) of the [@commercetools/ts-client](https://www.npmjs.com/package/@commercetools/ts-client) - Version 1.0.0 (or later) of the [@commercetools/ts-sdk-apm](https://www.npmjs.com/package/@commercetools/ts-sdk-apm) - You must install the [required dependencies](https://docs.dynatrace.com/docs/shortlink/otel-wt-nodejs#initialize-opentelemetry). You can find the entire list of dependencies [here](https://github.com/commercetools/commercetools-sdk-typescript/blob/master/examples/dynatrace-express-apm/install.sh) - Install OneAgent or use the [OpenTelemetry collector](https://docs.dynatrace.com/docs/shortlink/otel-wt-nodejs#initialize-opentelemetry) ### Include the monitoring package in your SDK Create a `oneagent-tracer.js` file in your project to capture and send request and response data to Dynatrace using OpenTelemetry traces and metrics. You can find a sample `oneagent-tracer.js` file [here](https://github.com/commercetools/commercetools-sdk-typescript/blob/master/examples/dynatrace-express-apm/oneagent-tracer.js). For more information on configuring your tracer, check the [Dynatrace documentation](https://docs.dynatrace.com/docs). This file uses environment variables that you need to set up according to your commercetools and Dynatrace configurations. Check our [example environment file](https://github.com/commercetools/commercetools-sdk-typescript/blob/master/examples/dynatrace-express-apm/.env.sample) for guidance. You can use the [oneagent-metric.js](https://github.com/commercetools/commercetools-sdk-typescript/blob/master/examples/dynatrace-express-apm/oneagent-metric.js) module, which exposes metric tracking functions, to record specific function values or object properties. To integrate Dynatrace into your project, use the [@commercetools/ts-sdk-apm](https://www.npmjs.com/package/@commercetools/ts-sdk-apm) package with `withTelemetryMiddleware()` method in your SDK client setup. The following code demonstrates how to implement this middleware in your SDK client. ```typescript // Import the @commercetools/ts-sdk-apm package import { createTelemetryMiddleware } from '@commercetools/ts-sdk-apm' import { ClientBuilder } from '@commercetools/ts-client' // Configure the telemetry options const telemetryOptions = { tracer: () => require('./path/to/oneagent-tracer.js'), userAgent: 'typescript-sdk-middleware-dynatrace', createTelemetryMiddleware, customMetrics: { newrelic: false, datadog: false, }, } // Create the client with the withTelemetryMiddleware() middleware const client = new ClientBuilder() .withClientCredentialsFlow(...) .withHttpMiddleware(...) .withTelemetryMiddleware(telemetryOptions) // telemetry middleware ... .build() ``` For an example of integrating Dynatrace with the TypeScript SDK, refer to the [Dynatrace Express](https://github.com/commercetools/commercetools-sdk-typescript/blob/master/examples/dynatrace-express-apm) example application. ## PHP SDK ### Prerequisites - Version 10.5 (or later) of the PHP SDK ### Dynatrace OneAgent If you want to monitor your application by using [Dynatrace OneAgent](https://docs.dynatrace.com/docs/discover-dynatrace/platform/oneagent), then there is no need to change the SDK. To set up your Docker environment, follow the steps in the [README file](https://github.com/commercetools/commercetools-sdk-php-v2/blob/master/examples/symfony-app-dynatrace/README.md). To test an application with the PHP SDK and Dynatrace OneAgent, use the provided [example application](https://github.com/commercetools/commercetools-sdk-php-v2/blob/master/examples/symfony-app-dynatrace). ## .NET SDK ### Prerequisites - Version 11.0 (or later) of the .NET SDK ### Dynatrace OneAgent If you want to monitor your application by using [Dynatrace OneAgent](https://docs.dynatrace.com/docs/discover-dynatrace/platform/oneagent), then there is no need to change the SDK. To install Dynatrace OneAgent on your host and configure it to monitor your application, follow the steps mentioned in [Dynatrace's documentation](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/installation-and-operation). To test an application with .NET SDK and Dynatrace OneAgent, use the provided [example application](https://github.com/commercetools/commercetools-dotnet-core-sdk-v2/blob/master/commercetools.Sdk/Examples/commercetools.Api.ApmExample/README.md). ### Dynatrace OpenTelemetry To monitor your application by using OpenTelemetry, follow the steps for [OpenTelemetry in the .NET SDK](/dev-tooling/observability/opentelemetry.md#net-sdk). ## Use the Dynatrace dashboard You can now send requests in your application through the SDK and monitor the reported data on the Dynatrace visual dashboard. For more information on using Dynatrace dashboards, consult [Use dashboards](https://docs.dynatrace.com/docs/analyze-explore-automate/dashboards-and-notebooks/dashboards-new/get-started/dashboards-use) and other [Dynatrace documentation](https://docs.dynatrace.com/docs). ## Related pages - [Area overview page with navigation](/dev-tooling.md) - [Previous page: New Relic](/dev-tooling/observability/newrelic.md) - [Next page: OpenTelemetry](/dev-tooling/observability/opentelemetry.md)