Welcome!

Blog Feed Post

Request attributes: Java method argument capture is now supported

Dynatrace recently introduced request attributes, a valuable new service-monitoring feature that enables fine-grain service filtering and performance analysis. By defining request attributes for your service’s requests, you can enable advanced filtering for service requests across all Dynatrace analysis views. Once configured, request attributes help you to better understand the relationships between performance, errors, and application-specific meta data in your requests.

Until now this functionality was only available for web request data; we’ve now extended request attribute functionality to include Java methods argument and return values.

Capturing a method argument value

To configure a request attribute

  1. Go to Settings > Server-side monitoring > Request attributes.
  2. Click the Create new request attribute button.
  3. Click the Add new data source button.
  4. Optionally define the scope of the request attribute (for complete instructions, see our recent blog post).
  5. From the Request attribute source drop list, select Java method parameter(s).
  6. Click the Select method sources button to open the new Java class wizard. Here you can select the Java class of the method whose argument you want to set an attribute on.
  7. Begin by selecting the process group that contains the classes or interfaces you’re interested in and click Continue.
  8. Search for the Java class that includes the method you’re interested in. Simply begin typing the Java class name and click the Search button. The list may take a few seconds to populate.
  9. Pick a class from the displayed list. If the list doesn’t contain the class you’re looking for, refine the search string.
  10. Finally, pick one or more methods that you want to capture parameters from and click Finish.

The methods you select are listed in the method argument capture rule (see below). Now select which argument or return value you want to capture for each method.

You can always extend the list or remove methods later. Once saved, either restart the processes that you want this rule to apply to or go to Settings Server-side service monitoring Custom service detection and ensure that the Enable real-time updates to Java services switch is set to the On position.

Once your services begin calling the respective methods, you should see the request attribute appear on the service’s overview page, on the Request attributes tab.

You can now use your request attribute to filter your data. In the PurePath example below, note the new request attribute in the header and within the respective service call’s summary section.

Finally, notice that the code-level tree view also contains these methods. This view will be used later to display the argument values in case the method is called multiple times with different values.

Request attribute tips & tricks

In addition to argument values, you can also capture the Return value of any method, or simply the number of Occurrences. While return values should be clear, occurrences can be a bit tricky. You should only use a single method rule when capturing occurrences. Dynatrace will count the number of calls of this method within a single request.

Note: You can capture non-primitive and non-string objects. However, Dynatrace OneAgent will automatically call toString. In most cases, this should not be an issue. It can, however, result in performance overhead. Some objects may inadvertently change their state in toString, so be careful here. We will add more sophistication here in the coming weeks.

Multiple possible values

It is not hard to imagine that you could end up with multiple possible values. Simply define multiple data sources or multiple java methods. Even if you define a single java method, it might be executed multiple times in a single request.

At the moment only a single value is stored per service request and attribute. This means that if you capture multiple values in a single request only the first occurrence is used. The order is determined first by the order of data sources, second by the order of methods in the list and thirdly  by the execution order of a single method (if that method occurs multiple times).
We will enhance this to allow more flexibility soon.

Optional post processing

In many cases, a captured value will contain what it is you’re looking for. However, you may not want an entire value, or even every value. In such cases, you can use the optional fields shown below to enable some post processing.

Simple data extraction

The first part enables you to simply extract something from the resulting string. Extraction can be performed either before, after, or between values. The extraction happens in your application and is based on string searches. For example, if your value is <value>value1</value>, you can use the following to extract value1.

If the combination can’t be found in the captured value, then nothing will be captured. If the extraction is successful then only the extracted value will be captured.

Only capture specific values

Following simple extraction, you can decide if you really want to capture the specific value. This happens after the pre-processing mentioned above. This allows a simple string check that only captures values that fit a certain pattern.

Regex for advanced use cases

Finally, for the really complex use cases, you can use a regular expression to extract something from the captured value. This happens following the two other pre processing steps. You can use this regex in two different ways.

Simple match

Lets say you have a value Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0 Safari/537.36 and you want to capture the Windows version from this string. The regex Windows NT[^)]+ will capture Windows NT 10.0.

Group match

If you have more complicated needs you can use a group match. For example, if you want to extract the Chrome version without the word “Chrome,” use the regex Chrome\/([^ )]+) to extract 56.0. In this case only the group will be extracted and not the whole match.

Restrictions

Regular expressions are powerful, but they can lead to unexpected results (Lazy vs greedy matching) and they can quickly get expensive (Catastrophic Backtracking and repeated capture groups). For these reasons, we’ve decided to restrict regular expressions in the Dynatrace product:

  • Quantified groups aren’t allowed. Please solve this in another way.
  • Dynatrace doesn’t allow greedy matches within capture groups. Use lazy or possessive matching instead.
  • Dynatrace allows exactly one capture group in places where you need to extract a value. The logic here is that if the regular expression contains a group, Dynatrace will use it. Otherwise, the full match is used for extraction.
  • For pure matching cases, Dynatrace doesn’t allow any capture groups. Please use atomic groups instead.
  • Dynatrace doesn’t allow back references.

OneAgent Requirements

This feature requires OneAgent version 125 or above.

The post Request attributes: Java method argument capture is now supported appeared first on Dynatrace blog – monitoring redefined.

Read the original blog entry...

More Stories By Dynatrace Blog

Building a revolutionary approach to software performance monitoring takes an extraordinary team. With decades of combined experience and an impressive history of disruptive innovation, that’s exactly what we ruxit has.

Get to know ruxit, and get to know the future of data analytics.

Latest Stories
SYS-CON Events announced today that Massive Networks will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Massive Networks mission is simple. To help your business operate seamlessly with fast, reliable, and secure internet and network solutions. Improve your customer's experience with outstanding connections to your cloud.
DevOps is under attack because developers don’t want to mess with infrastructure. They will happily own their code into production, but want to use platforms instead of raw automation. That’s changing the landscape that we understand as DevOps with both architecture concepts (CloudNative) and process redefinition (SRE). Rob Hirschfeld’s recent work in Kubernetes operations has led to the conclusion that containers and related platforms have changed the way we should be thinking about DevOps and...
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution and join Akvelon expert and IoT industry leader, Sergey Grebnov, in his session at @ThingsExpo, for an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
Because IoT devices are deployed in mission-critical environments more than ever before, it’s increasingly imperative they be truly smart. IoT sensors simply stockpiling data isn’t useful. IoT must be artificially and naturally intelligent in order to provide more value In his session at @ThingsExpo, John Crupi, Vice President and Engineering System Architect at Greenwave Systems, will discuss how IoT artificial intelligence (AI) can be carried out via edge analytics and machine learning techn...
FinTechs use the cloud to operate at the speed and scale of digital financial activity, but are often hindered by the complexity of managing security and compliance in the cloud. In his session at 20th Cloud Expo, Sesh Murthy, co-founder and CTO of Cloud Raxak, showed how proactive and automated cloud security enables FinTechs to leverage the cloud to achieve their business goals. Through business-driven cloud security, FinTechs can speed time-to-market, diminish risk and costs, maintain continu...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
Existing Big Data solutions are mainly focused on the discovery and analysis of data. The solutions are scalable and highly available but tedious when swapping in and swapping out occurs in disarray and thrashing takes place. The resolution for thrashing through machine learning algorithms and support nomenclature is through simple techniques. Organizations that have been collecting large customer data are increasingly seeing the need to use the data for swapping in and out and thrashing occurs ...
When you focus on a journey from up-close, you look at your own technical and cultural history and how you changed it for the benefit of the customer. This was our starting point: too many integration issues, 13 SWP days and very long cycles. It was evident that in this fast-paced industry we could no longer afford this reality. We needed something that would take us beyond reducing the development lifecycles, CI and Agile methodologies. We made a fundamental difference, even changed our culture...
As many know, the first generation of Cloud Management Platform (CMP) solutions were designed for managing virtual infrastructure (IaaS) and traditional applications. But that’s no longer enough to satisfy evolving and complex business requirements. In his session at 21st Cloud Expo, Scott Davis, Embotics CTO, will explore how next-generation CMPs ensure organizations can manage cloud-native and microservice-based application architectures, while also facilitating agile DevOps methodology. He wi...
SYS-CON Events announced today that Datera, that offers a radically new data management architecture, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera is transforming the traditional datacenter model through modern cloud simplicity. The technology industry is at another major inflection point. The rise of mobile, the Internet of Things, data storage and Big...
SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...
In the enterprise today, connected IoT devices are everywhere – both inside and outside corporate environments. The need to identify, manage, control and secure a quickly growing web of connections and outside devices is making the already challenging task of security even more important, and onerous. In his session at @ThingsExpo, Rich Boyer, CISO and Chief Architect for Security at NTT i3, discussed new ways of thinking and the approaches needed to address the emerging challenges of security i...
Blockchain is a shared, secure record of exchange that establishes trust, accountability and transparency across business networks. Supported by the Linux Foundation's open source, open-standards based Hyperledger Project, Blockchain has the potential to improve regulatory compliance, reduce cost as well as advance trade. Are you curious about how Blockchain is built for business? In her session at 21st Cloud Expo, René Bostic, Technical VP of the IBM Cloud Unit in North America, will discuss th...
In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...
Docker containers have brought great opportunities to shorten the deployment process through continuous integration and the delivery of applications and microservices. This applies equally to enterprise data centers as well as the cloud. In his session at 20th Cloud Expo, Jari Kolehmainen, founder and CTO of Kontena, discussed solutions and benefits of a deeply integrated deployment pipeline using technologies such as container management platforms, Docker containers, and the drone.io Cl tool. H...