Custom messaging services

Dynatrace automatically detects event-based message queue handlers. To get insight into applications using non-standard or non-event-based message queue handlers, you must first define a custom messaging service for your consumers.

Define a messaging service

To define a custom messaging service for your consumers

  1. Go to Settings > Service detection > Custom service detection.

  2. Select whether your messaging service is based on Java, .NET, or Node.js, and then select Define messaging service.

  3. Define the name of your messaging service, choose your messaging technology from the list, and then select Find entry point.

  4. Select the process that contains your entry point from the list and select Continue.

  5. Find the class you want to instrument, select the required class or file, and select Continue.

  6. Java .NET To instrument the class, you can

    • Use the selected class for instrumenting methods of the selected class only.
    • Use an implemented interface or superclass for instrumenting methods in any interface or superclass in the class hierarchy. In such cases, select Load inheritance to load all available superclasses and interfaces, and then select the one you need.

    Node.js Select the file containing the custom service. Dynatrace presents a list of methods that can be used as a custom service. Select the desired method to complete the configuration.

  7. Select the methods you want to instrument and select Finish.

    See the requirements for Apache Kafka, Amazon SQS SDK and Spring Cloud AWS SQS in the section below.

    The Define custom service page displays the newly added entry point and methods.

  8. optional Add more entry points if needed.

  9. optional Restrict the new custom service to certain process groups. See the Restrict a custom service to specific process groups section below.

  10. Review the entry point and methods to be instrumented.

  11. In the lower-right corner of the page, select Save.

  12. .NET Node.js Restart your consumer application so that the custom messaging service can be detected.

Amazon SQS SDK

Apache Kafka

Custom messaging services for Apache Kafka must define a method in your code that is responsible for processing a single Kafka message. Only such methods can be used as an entry point for Kafka messaging services.

Spring Cloud AWS SQS

Priority of messaging services

If you have several custom services defined, the evaluation goes from top to bottom, applying the first matching rule. If for some reason you have the same class and method defined in several custom services, make sure to prioritize the services accordingly.

Edit messaging service

You can edit any custom service at any time. For changes to take effect, you need to restart the affected processes, unless real-time updates are activated for Java and PHP. For .NET and Node.js, you must restart the process.

To edit a custom service, select the service's Edit button in the list of services. You can

Real-time updates

Updates to Java and PHP custom messaging services can be applied in near real time, without process restarts. To activate this feature, go to Settings > Server-side service detection > Deep monitoring > Real-time updates to Java and PHP services and enable the dedicated switches.

Note that with real-time updates, you do not need to restart processes; however, such updates might cause CPU spikes when deployed.

Restrict a messaging service to specific process groups

You can restrict usage of any custom service to certain process groups. Custom service rules apply in specified process groups only and are ignored in other process groups. You can restrict a custom service when you create it or edit it.

To restrict a custom service

  1. On the Define custom service or Edit service page, expand the Optionally restrict custom service rules by process groups dropdown menu.
  2. Select Add process group and select the process group where you want to apply the custom service.
  3. Select Add.
  4. In the lower-right corner of the Define custom service or Edit service page, select Save.