Metric tracing tags
IBM® Cloud Pak for Network Automation microservices produce metric data that contains tracing tags that can be used to categorize intent requests.
Adding tag headers to the tracing context
Any header in the tracing context that uses the
"x-tracectx-tag-<name>"
: "<value>
format is written to the metrics for the intent request. You can add multiple tag headers to the
tracing context. The trace tags are added to a single label in the metrics, named
traceTags
and the tags are sorted alphabetically. The traceTags
label contains a comma-separated list of the name-value pairs of the corresponding tracing content
headers.
- If you want to categorize the metrics for a particular operation by the request source and the
reason for the request, you might add the following tag headers to the tracing
context:
"x-tracectx-tag-source": "portal" "x-tracectx-tag-reason": "order"
For these tag headers, the value"source:portal,reason:order"
is written to thetraceTags
label in the metrics. The metric output might look like this:assembly_create_seconds_sum{application="Galileo",instance="Galileo:cp4na-o-galileo-0",root="lm", server="worker1.abc.example.com",stage="total",traceTags="source:portal,reason:order",} 5.0
-
If you want to categorize successful rollback requests by the reason for the rollback, you might add tag headers like this to the tracing context:
When the rollback is successful, the"x-tracectx-tag-rollback-reason": "too_long_to_resolve"
intents
metric count is incremented and the followingtraceTags
label is added to the metric:"tag":"traceTags","values":["","rollback-reason:too_long_to_resolve"]
Using a unique identifier, such as the transaction ID, as a tracing tag might cause your system to run out of memory and your microservices to restart.
A separate line is written to the Prometheus output for each combination of tags and values. If you use a unique ID as a tracing tag, a new line is written to the output for each request, which might cause your system to run out of memory.
Accessing the metrics
You can access the metrics through the Prometheus endpoint on each microservice and use tools such as the Grafana cluster monitoring tool to categorize the metrics, based on the tracing tags. See Categorizing metrics.