SYS-CON MEDIA Authors: Pat Romanski, Gary Arora, Zakia Bouachraoui, Yeshim Deniz, Liz McMillan

Blog Feed Post

Introduction to iStats Part 1: Overview

Version 11 of BIG-IP brought with it many enhancements and new features ranging across the entire product. iRules improvements and features were among the cooler things changed, in the opinion of this avid iRuler. Between sideband connections, iFiles and improvements of already existing functionality, it's hard to imagine there is more yet to discuss in v11 iRules goodness, but there is. iStats were introduced in v11, and are worth talking about, as they can dramatically change the way you are solving problems, depending on your deployment. In this 2-parter we'll talk about iStats first from a higher level overview/introduction perspective, and then a bit more in-depth in part 2, talking about specific metrics that are measurable, commands available from within iRules, etc.

What are iStats?

iStats are user-created custom statistics, accessible from both the data plane (iRules) and the control plane (tmsh, on-box scripts, etc.).

iStats are similar in concept to the existing stats profile, with several important variations.  First let's look at what we know about a stats profile:

  • - Limited to a small number of statistics
  • - All stats must be preconfigured
  • - Stat values are sometimes available only on a per-TMM basis
  • - Cannot be modified from the control plane

While a stats profile can be useful in many cases, it is largely used to track data plane only metrics such as connections, data rates, etc. They aren't amazingly flexible, and provide limited hooks into the control plane (command line, GUI, etc.) which makes them somewhat isolated from the bigger picture of your BIG-IP's configuration and existence at large.

In contrast, let's look at iStats in a similar way and compare the differences:

  • - Users can create an arbitrary number of iStats (although there is a practical limit of 5,000-10,000 iStats)
  • - iStats do not have to be preconfigured or predefined, they can be built on the fly, effectively
  • - Any consumer of iStats (even iRules) will always get the global view (meaning, not on a per-TMM basis, but rather aggregated over all stat producers), which is extremely important in many cases where you want to look at the overall picture when referencing a stat, not a per TMM number, given that there are multiple if not many TMMs per device in most cases
  • - iStats can be both read and modified by the control plane, I.E. TMSH

Hopefully the picture that is shaping up is as obvious to everyone else as it is to me. iStats provides a more flexible, scalable, picture complete (non TMM specific) mechanism for tracking information vital to your deployment, and critical when building business solutions in many cases. The fact that iStats give you a view of the entire device when querying any particular stat, vs. a TMM specific one is massive. That alone is game changing in some cases. As a tradeoff for these benefits, the values returned by iStats are only updated periodically (every 10 seconds on an appliance or chassis with a single blade, or every 20-30 seconds on a chassis with multiple blades), as opposed to the precise real-time values in stats profiles. This means that in granular, real-time dependent situations where you are basing traffic decisions off of stats, stats profiles may still be the way to go, but that is of course situationally dependent.


How do I use iStats?

For both the purposes of this explanation, and when dealing with iStats in general, it is important to distinguish between the statistics you want to gather, and the things you want to gather them on. The thing you want to gather them on will be referred to here as the "subject", and the statistics you want to gather about the subject are referred to as "measures".  For example, you might want to record both the number of requests as well as the number of connections for pool members; in this case, a particular pool member will be the subject, and the request and connection counts will be the measures.

An iStat handle is composed of three parts: a subject name, a measure type, and a measure name. Together, this is referred to as the iStat "key". A subject name is a set of alternating keyspace/value pairs, all separated by spaces. Keyspaces, Measure Names and Values are arbitrary strings. At least one pair must be used, but more may be used. For example, a subject name might be "key1 value1", or "key1 value1 key2 value2", but could not be "key1 value1 key2".

That's a lot of terminology, let's review that for clarity:

  • Subject Name - The thing you want to gather data on. I.E. a VIP, pool, etc.
  • Measure Type - The statistics you want to gather about the subject, I.E. connections, requests, etc.
  • Measure Name - An arbitrary name for the measure in question
  • Key - The combination of the subject name, measure type and measure name, encapsulated in quotes.

Building an iStat

To construct an iStat key, you simply take the subject name and append the measure type and the measure name, again all separated by spaces.  The entire key must be enclosed in quotes. For instance, a valid key could be "a b c d". This would be a counter ('c' is shorthand for 'counter') named 'd', for a subject with a value of 'b' in keyspace 'a'. To clarify, let's look at a somewhat less generic example so you can see these different parts in action:

For an instance where:

  • - Keyspace is "src_ip"
  • - Value of the stat is "1.2.3.4"
  • - Measure Type is counter, or "c" for shorthand
  • - Measure Name "Connections"

The finished key would be "src_ip 1.2.3.4 c Connections".

An iStat key for a subject which has multiple key/value pairs could be: "src_ip 1.2.3.4 src_port 5678 counter connections", which would be a counter called "connections" for a subject with a value of "1.2.3.4" in keyspace "src_ip" and a value of "5678" in keyspace "src_port". So you are effectively tracking the source IP and source port simultaneously in a single key, by assigning it multiple key/value pairs.

It is important to note that the type of the iStat measure is part of the iStat key. This means that you could have multiple measures all with the same subject name and measure name but differing types. For example, "client 1.2.3.4 counter hits" is different from "client 1.2.3.4 gauge hits", both of which are different from "client 1.2.3.4 string hits". Even though they are all using the same keyspace, value and name, they are of different measure types and that is enough to differentiate them, technically speaking. As such all three of these could be used at the same time (as they are all distinct iStat keys), but this is discouraged to prevent confusion. As you can imagine this could get pretty heinous to logically track pretty quickly. It's better to keep things more distinct, most times. It is also important to note that the key/value pairs that make up the subject name are not forced to be specified in order. Meaning, "src_ip 1.2.3.4 src_port 5678" refers to the same subject as "src_port 5678 src_ip 1.2.3.4".

Interacting with iStat: TMSH & iRules

As mentioned earlier in the "What is an iStat" section, an iStat may be associated with a TMSH configuration object. In this case, the subject name would be a keyspace of a tmsh component dotted path, and a value of a specific object name or id. For example, ''ltm.pool /Common/my_pool counter num_hits" would refer to a counter named num_hits which is associated with the LTM pool named my_pool located in the Common folder. 

These custom iStats will be displayed with the tmsh show command on the associated object, but will not appear in the GUI. When either ''reset-stats ltm pool my_pool'' or ''delete ltm pool my_pool'' is executed from TMSH, all associated iStats will be automatically reset or deleted as well. Specifying keyspace/value pairs beyond what is necessary to describe the configuration object will interfere with object associations. In most cases, this means there will be a single keyspace/value pair for iStats associated with config objects, but iStats associated with pool members require two keyspace/value pairs: "ltm.pool /Common/my_pool member /Common/10.1.1.1:6666 counter hits".

iStats and their measures may be created, modified, and retrieved via iRules or TMSH scripts, making them amazingly flexible and giving you a wide array of options when building your keys. Any iRule or TMSH client can produce any iStat if they specify the exact key. Also, any iRule can read any iStat. For those of you keeping up, this means that you can specifically create iStats from within TMSH to expose data that is not currently available via iRules commands, and then have your iRule reference that particular iStat. This breaks open a new wealth of information that you can make available to your iRules if you so desire. If an iStat is not associated with a configuration object, then any TMSH client can read that iStat. If an iStat is associated with a configuration object, then a TMSH client can only read that iStat if they have permission to access the object it is associated with. In this way you can limit particular stats to particular roles. Even though the information is only periodically updated, there are several uses for this particular interaction.

iStats Facts

There is simply so much to say about iStats, how they can be used and how they work, that I had to break it into two parts. Before wrapping up, though, here are a few more facts about iStats to help you understand more about how their inner workings:

  • - iStats are created on first write and do not need to be declared separately.
  • - Each producer of an iStat will update its own private, local copy of that statistic.
  • - A daemon on the system is responsible for periodically combining the data from the iStat producers into an aggregated version. That aggregated version is what any consumer of an iStat will read.
  • - iStats currently supports three types of measures: counters, gauges, and strings. It is also possible to create derived stats. More information on these types of measures and stats will be available in Part 2.

Wrapping-up

iStats are powerful, flexible, and there are limitless ways to configure, build and manipulate them via both TMSH and iRules. They are an informational bridge from the control plane (TMSH) to the data plane (iRules), which is a new and revolutionary feature unto itself within BIG-IP. There will be more details on command specifics and usage in the next part so be sure to look there for the implementation details if that's what you're looking for. For now though, if there are any questions so far, don't hesitate to ask them here.

I also want to give a massive thank you to spark (DC Username) one of the core engineers responsible for bringing you new and exciting iRules features. He provided the lion's share of this information directly from the horse's mouth, as it were, which helps immeasurably in bringing the community the details that you crave. So if you see spark around the forums, pay attention and maybe say thanks.

Read the original blog entry...

More Stories By Colin Walker

Coming from a *Nix Software Engineering background, Colin is no stranger to long hours of coding, testing and deployment. His personal experiences such as on-stage performance and the like have helped to foster the evangelist in him. These days he splits his time between coding, technical writing and evangalism. He can be found on the road to just about anywhere to preach the good word about ADCs, Application Aware networking, Network Side Scripting and geekery in general to anyone that will listen.

Colin currently helps manage and maintain DevCentral (http://devcentral.f5.com). He is also a contributor in many ways, from Articles to Videos to numerous forum posts, to iRules coding and whatever else he can get his hands on that might benefit the community and allow it to continue to grow.

Latest Stories
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
On-premise or off, you have powerful tools available to maximize the value of your infrastructure and you demand more visibility and operational control. Fortunately, data center management tools keep a vigil on memory contestation, power, thermal consumption, server health, and utilization, allowing better control no matter your cloud's shape. In this session, learn how Intel software tools enable real-time monitoring and precise management to lower operational costs and optimize infrastructure...
"Calligo is a cloud service provider with data privacy at the heart of what we do. We are a typical Infrastructure as a Service cloud provider but it's been designed around data privacy," explained Julian Box, CEO and co-founder of Calligo, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Isomorphic Software is the global leader in high-end, web-based business applications. We develop, market, and support the SmartClient & Smart GWT HTML5/Ajax platform, combining the productivity and performance of traditional desktop software with the simplicity and reach of the open web. With staff in 10 timezones, Isomorphic provides a global network of services related to our technology, with offerings ranging from turnkey application development to SLA-backed enterprise support. Leadin...
While a hybrid cloud can ease that transition, designing and deploy that hybrid cloud still offers challenges for organizations concerned about lack of available cloud skillsets within their organization. Managed service providers offer a unique opportunity to fill those gaps and get organizations of all sizes on a hybrid cloud that meets their comfort level, while delivering enhanced benefits for cost, efficiency, agility, mobility, and elasticity.
DevOps has long focused on reinventing the SDLC (e.g. with CI/CD, ARA, pipeline automation etc.), while reinvention of IT Ops has lagged. However, new approaches like Site Reliability Engineering, Observability, Containerization, Operations Analytics, and ML/AI are driving a resurgence of IT Ops. In this session our expert panel will focus on how these new ideas are [putting the Ops back in DevOps orbringing modern IT Ops to DevOps].
Darktrace is the world's leading AI company for cyber security. Created by mathematicians from the University of Cambridge, Darktrace's Enterprise Immune System is the first non-consumer application of machine learning to work at scale, across all network types, from physical, virtualized, and cloud, through to IoT and industrial control systems. Installed as a self-configuring cyber defense platform, Darktrace continuously learns what is ‘normal' for all devices and users, updating its understa...
Enterprises are striving to become digital businesses for differentiated innovation and customer-centricity. Traditionally, they focused on digitizing processes and paper workflow. To be a disruptor and compete against new players, they need to gain insight into business data and innovate at scale. Cloud and cognitive technologies can help them leverage hidden data in SAP/ERP systems to fuel their businesses to accelerate digital transformation success.
Concerns about security, downtime and latency, budgets, and general unfamiliarity with cloud technologies continue to create hesitation for many organizations that truly need to be developing a cloud strategy. Hybrid cloud solutions are helping to elevate those concerns by enabling the combination or orchestration of two or more platforms, including on-premise infrastructure, private clouds and/or third-party, public cloud services. This gives organizations more comfort to begin their digital tr...
Most organizations are awash today in data and IT systems, yet they're still struggling mightily to use these invaluable assets to meet the rising demand for new digital solutions and customer experiences that drive innovation and growth. What's lacking are potent and effective ways to rapidly combine together on-premises IT and the numerous commercial clouds that the average organization has in place today into effective new business solutions.
Keeping an application running at scale can be a daunting task. When do you need to add more capacity? Larger databases? Additional servers? These questions get harder as the complexity of your application grows. Microservice based architectures and cloud-based dynamic infrastructures are technologies that help you keep your application running with high availability, even during times of extreme scaling. But real cloud success, at scale, requires much more than a basic lift-and-shift migrati...
David Friend is the co-founder and CEO of Wasabi, the hot cloud storage company that delivers fast, low-cost, and reliable cloud storage. Prior to Wasabi, David co-founded Carbonite, one of the world's leading cloud backup companies. A successful tech entrepreneur for more than 30 years, David got his start at ARP Instruments, a manufacturer of synthesizers for rock bands, where he worked with leading musicians of the day like Stevie Wonder, Pete Townsend of The Who, and Led Zeppelin. David has ...
Darktrace is the world's leading AI company for cyber security. Created by mathematicians from the University of Cambridge, Darktrace's Enterprise Immune System is the first non-consumer application of machine learning to work at scale, across all network types, from physical, virtualized, and cloud, through to IoT and industrial control systems. Installed as a self-configuring cyber defense platform, Darktrace continuously learns what is ‘normal' for all devices and users, updating its understa...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Addteq is a leader in providing business solutions to Enterprise clients. Addteq has been in the business for more than 10 years. Through the use of DevOps automation, Addteq strives on creating innovative solutions to solve business processes. Clients depend on Addteq to modernize the software delivery process by providing Atlassian solutions, create custom add-ons, conduct training, offer hosting, perform DevOps services, and provide overall support services.