OCI observability | Application Performance Monitoring (APM) | Trace Explorer tips & tricks


APM or Application Performance Monitoring provides a comprehensive set of features to monitor applications and diagnose performance issues.

Trace Explorer is a graphical tool integrated in the OCI Web Console

Trace explorer window areas

selectors

To select the compartment and APM Domain. Compartment is a collection of OCI resources grouped logically. An APM domain is an Oracle Cloud Infrastructure resource, which contains the systems being monitored by Application Performance Monitoring.

Tab bar

Predefined sections that show traces of different entities according to its associated queries:

query

The query text box, action icons on the right and a selector to choose the timeframe of events to query for:

Query tools

A button to execute the query. An information icon (i) to open up a quick query syntax dialog. An icon to save and open saved queries. A dropdown list to quickly select the lastest queries executed. NOTE: To save queries you ned to have a policy assigned.

Save query or open save queries
Query syntax with a checkbox to change the view including examples

List of the latest queries

fields

The list of fields existing in the traces database:

The database has two collections: traces and spans. This “tables” can be queried to obtain data in different ways.

Metrics and Dimensions are additional information that can be added during tracing collection either by agents or by instrumenting the application.

Results area

Is the table or graph arrea in which traces are shown after a query is performed. Fields are shown depending on the query. Several queries (like ‘traces*’) have predefined fields:

Trace options

To obtain details of a particular trace:

Trace details can be obtained by clicking in the link in the xxxName:yyyyName column:

TRACE DETAILS

Trace details shows the trace with the topology diagram and the tree of spans below. The diagram is created by a predefined query that shows nodes grouped by Services or by Operations as shown below:

Topology grouped by Services

Topology grouped by operations

SPANS DETAILS

By clicking the link of an span, we can see the details, including trace header, dimensions and log entries:

HOW TO PAINT A TOPOLOGY IN DIFFERENT WAY

Choose an specific trace and select [Show Trace Details] in the ellipses menu on the right:

Change the query at your own using the syntax and the fields available in the collections as mentioned above:

EXAMPLE1: TOPOLOGY grouped by service and component

Add to the query the component field as shown below:

Then click on [Run] button

The topology changes with more detail as follows:

EXAMPLE2: topology by function, service and component

This use case is valid when using OCI APIGW, and functions. In the query we have also removed the option to show root nodes (INCLUDE ROOTS) as show here:

TOPOLOGY FOR NODES BY fnname,serviceName, component SOURCE spans WHERE traceId='5b94f4d9d10bac90' AGGREGATE LINKS BY  child:count(*) AS Count,child:sum(spanDuration) as "Total Time",child:min(spanDuration) AS "Min Span Duration",child:max(spanDuration) AS "Max Span Duration",child:avg(spanDuration) AS "Avg Span Duration",child:avg(errorCount) AS "Avg Error Count" ADD FINAL LINKS WHERE kind='CLIENT' EXTRA ATTRIBUTES DbConnUrl,httpUrl INCLUDE ROOTS

And the topology is painted a little bit different:

create your own custom query

By examiniing the list of available fields in the Service and Spans ccollecctions, toy can obtaion iinforrmatiion in table mode as for example:

show spans servicename, component, appname, appservername, appserverports, appservertype, appserverversion, classmethod, contextroot, createdby, fnid, fnname, hostname, Kind, mytag, threadid,workingdirectory,vmversion, vmvendor,vmname,username, traceid,tenantid

Here the results in table mode:

That’s all, hope this helps! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.