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
From the Dynatrace menu, go to Settings > Service detection > Custom service detection.
Select whether your messaging service is based on Java, .NET, or Node.js, and then select Define messaging service.
Define the name of your messaging service, choose your messaging technology from the list, and then select Find entry point.
Select the process that contains your entry point from the list and select Continue.
Find the class you want to instrument, select the required class or file, and select Continue.
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.
Select the methods you want to instrument and select Finish.
The Define custom service page displays the newly added entry point and methods.
optional Add more entry points if needed.
optional Restrict the new custom service to certain process groups. See the Restrict a custom service to specific process groups section below.
Review the entry point and methods to be instrumented.
In the lower-right corner of the page, select Save.
.NET Node.js Restart your consumer application so that the custom messaging service can be detected.
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.
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
Activate or deactivate existing entry points.
Add or delete entry points.
Add or delete methods in entry points.
- Restrict the custom service to certain process groups. See the Restrict a custom service to specific process groups section below.
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
- On the Define custom service or Edit service page, expand the Optionally restrict custom service rules by process groups dropdown menu.
- Select Add process group and select the process group where you want to apply the custom service.
- Select Add.
- In the lower-right corner of the Define custom service or Edit service page, select Save.