I’ve spent several weeks implementing Opentelemetry, and although it works, I feel there are bits missing, rather than “wow, what a perfect solution”. I tried to put myself in the position of supporting an enterprise customer who has many critical business applications, across many systems and platforms. The customer wants to be able to identify problems, before their end users notice, and before the end users flood social media with complaints.
Below are my thoughts on what I have learned. I may be totally wrong; maybe I didn’t know about some facilities which would solve the problems. If you know differently – please tell me. I love getting feedback – and I will update the documents.
I want to see the business view not the detailed plumbing view
Problem:
I’ve been to visit customers, and been allowed to visit their “mission control”. This is like the mission control for a moon landing. There are perhaps 200 screens showing all aspects of the business from the application throughput, through to the temperature of the water in the cooling systems. A screen can be selected and displayed “full screen” so every one can see it.
How I see the Opentelemetry data.
By default the information reported in Opentelemetry dashboards shows the plumbing; This database table, that CICS transaction, this MQ queue.
The business wants to know about “online banking”, or a function like “credit user’s account”, and not the name of a CICS transaction. Some services are common to all business applications, such as logon, and move_money. Some services are business application specific, such as “ATM statistics”.
One solution
An input stream of OTEL information can be fanned out to multiple streams. You might have one stream for “Enterprise monitoring”, and another stream for “CICS monitoring”, or “MQ monitoring.
The Opentelemetry collector can fan out the data to a CICS Grafana, an MQ grafana, and a z/OS grafana. Each of these grafanas has been configured to provide the information that the CICS, MQ, and z/OS people need to see.
The Opentelemetry collect can transform the input data, from “MQGET COLIN” to the name of a business application.
- set(span.name,"Payroll MQPA app gets the reply") where span.name == "MQGET COLIN"
- set(span.name,"Creditcheck application GET") where span.name == "MQGET CSERVER"
A different approach
When displaying data in Prometheus or Grafana, you can select which data is included in the displays.
For example if you have specified tracestate when you created your OTEL data, you could have one window for when w3.tracestate=”APPL=MYAPPL”, and another window with w3.tracestate=”APPL=ONLINE BANKING”.
Half the information is not available
Problem.
The aim of the Opentelementry is to identify where work is being delayed, and why. However it only reports on how long a piece of work took.
For any work request there are two components
- The transaction is doing something, reading a file, sending a request etc
- Waiting for something. This could be the response to a request. The work could be waiting, for example, because of insufficient resources (the CPU is too busy), or there is a long network round trip time.
The Opentelementry dashboard only reports on when something is being done (a database update has been done). It does not report on the waiting. Often the waiting is the longest part of a transaction. As a result the dashboard is not reporting all the facts.
If you consider the simplest application where an application queues some work, and the work executes at a later date. For example a CICS transaction schedules another CICS transaction in another CICS region on a different LPAR in the sysplex. The started transaction may be delayed because too many other requests are queued up.
The business transaction is:
- Run a CICS transaction ABCD – which issue a START of transaction WXYZ. The whole transaction takes 1 millisecond elapsed time.
- There is some delay due to getting the request to the remote system, and a delay until the transaction can run
- After 10 milliseconds, transaction WXYX runs, which takes 1 millisecond.
The dashboards will report
- Transaction ABCD 1ms
- Transaction WXYZ 1m
So shows the business transaction taking 2 ms.
It does not always show the 10 ms delay before the work was scheduled. (it depends on what data is generated)
- If the time before transaction WXYZ increases to 20ms – the dashboards do not show it.
- If the transaction ABCD takes longer (perhaps it had a longer database request), then it would show up.
Answer:
I wrote some Python code which creates a new Opentelemetry record covering the gap between two records, so from the start of transaction WXYZ back to the end of its parent. This gave me three records in my dashboard
- Transaction ABCD 1ms
- Delay before transaction WXYZ starts 10 ms
- Transaction WXYZ 1m
This could be done properly by writing a processing stage in GO in Opentelemetry.
There is too much information
Problem: Too many layers in the cake
In simplest typical MQ transaction, I have 8 items displayed on the dashboard
- Client application puts a message to a queue
- The mover gets the message and sends it to the remote system
- The mover on the remote system puts the message to the queue
- The server application gets the message
- The server puts the reply
- …
On the dashboard it shows the average time for each of these, but it is hard to tell which colour is for which action.
Answer:
You can say display the top n values. ( I used 4). If something takes longer than usual, it will appear in the list – and so the list will have a new colour – and you can see something is different.
Problem: you are using too many values
Each data record has a value (such as duration) and “dimension” (or attributes) of the record, such as Originating system, Opentelemetry instance, Span-name(such as transaction ABCD).
By default if you display the data, there will be a “layer” in the cake for every unique combination of dimensions.
If you have 50 different CICS transactions, you will have 50 slices. You can select which attributes to select by, and can group them by regular expression.
The problem is if the span is called “CHECK USERID xxxxxxx ” or MQPUT CSQX……” where there is a span for each userid checked, and for every MQ dynamic queue. The number of these depends on activity. It is hard to display the data so you can get useful data out of it.
Answer:
In the Opentelemetry collector you can use a transformation to set(or add) a value depending on the contents of a field. The following checks the name of an MQ Queue. If the queue name starts CSQX. then consider it a dynamic queue and give these entries the generic name CSQX*
set(span.name,"MQPUT *CSQX") where Substring(attributes["span,name], 0, 11) = "MQPUT CSQX."
See Understanding the OpenTelemetry Transform Language
The statement would replace all span names starting with MQPUT CSQX. with the string MQPUT *CSQX, and so be obvious this is a substituted name.
Drilling down on outliers
When a problem occurs (the duration of the business transaction take much longer than usual), you want to be able to drill down, and find out why.
Problem: Drilling down to find the root cause is hard
Jaeger display
If you are using Jaeger display to display the business transaction response time, you may spot outliers, and be able to click on one, and see the profile of the data.
You cannot select a time range, only the last 5m, 15m, 1h etc. You may have millions of records in 1 hour, and I do not think Jaeger is up to it, because it suggests processing 20 records.
Grafana display
Grafana displays aggregated information, so does not have individual records. You can see the time interval when the long durations occurred.
Answer:
You can configure Grafana links. When you click on a data item, a pop up giving information about that point is displayed. You can configure links which can be selected. For example select the Jaeger display of this service, between the two time stamps selected.
This was not easy to set up – because the links did not display every time. When it works it works well.
You can configure links to pass a URL and parameters from the data, or take an action.