This documentation and the Cisco Observability Platform functionalities it describes are subject to change. Data saved on the platform may disappear and APIs may change without notice.
Metrics
The Cisco Observability Platform needs to store incoming metrics in fmm:metric knowledge objects. Space Fleet defines all of the metrics it needs in the file spacefleet/objects/fmm/metrics/metric-types.json, which contains an array of fmm:metric object definitions. Each of the following metrics is represented by its own fmm:metric object in this file:
speed- Speed on spacecraft and torpedotorpedo_count- Number of torpedos available in tube or shiptorpedoes_launched_count- Number of torpedos launched from tubecurrent_occupancy- Number of crew members in a roomofficer_count- Number of officers on the bridgescreens_inuse- Number of screens in use on the bridgeearth_day- Total time from the date ship was launched in epochmillisantimatter_level- Anti-matter levelmatter_level- Matter levelshield_level- Shield level of a room or spacecrafttrip_count- Trip count for warp drivesuggestion_count- Number of mess_hall suggestion eventsshield_event_count- Number of shield_event eventsnewsfeed_count- Number of newsfeed eventstest_metric- Test metric
Contents of spacefleet/objects/fmm/metrics/metric-types.json:
[
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "speed",
"displayName": "Speed",
"description": "Metric to Definie speed on spacecraft and torpedo",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "double",
"unit": "m/s",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "torpedo_count",
"displayName": "Torpedo Count",
"description": "Number of torpedos available in tube or ship",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{count}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "torpedoes_launched_count",
"displayName": "Torpedoes Launched",
"description": "Number of torpedos launched from tube",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{count}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "current_occupancy",
"displayName": "Current Occupancy",
"description": "Crew members in a room",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{count}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "officer_count",
"displayName": "Officer Count",
"description": "Total number of officers on the bridge",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{count}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "screens_inuse",
"displayName": "Screens In Use",
"description": "Screens Live in Bridge",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{count}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "earth_day",
"displayName": "Duration",
"description": "Total time from the date ship was launched in epochmillis",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{days}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "antimatter_level",
"displayName": "Antimatter level",
"description": "Anti matter level",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "%",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "matter_level",
"displayName": "Matter Level",
"description": "Matter level",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "%",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "shield_level",
"displayName": "Shield Level",
"description": "shield level of a room or spacecraft",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "double",
"unit": "%",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "trip_count",
"displayName": "Trip Count",
"description": "trip count for warp drive",
"category": "sum",
"contentType": "sum",
"aggregationTemporality": "delta",
"isMonotonic": false,
"type": "long",
"unit": "{count}",
"ingestGranularities": [
60
]
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "suggestion_count",
"displayName": "Mess hall suggestion events count",
"description": "Number of mess_hall suggestion events",
"category": "sum",
"contentType": "sum",
"aggregationTemporality": "delta",
"isMonotonic": true,
"type": "long",
"unit": "{events}"
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "shield_event_count",
"displayName": "Sheild event count",
"description": "Number of shield_event events",
"category": "sum",
"contentType": "sum",
"aggregationTemporality": "delta",
"isMonotonic": true,
"type": "long",
"unit": "{events}",
"attributeDefinitions": {
"attributes": {
"type": {
"type": "string",
"description": "Shield event type"
}
}
}
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "newsfeed_count",
"displayName": "Newsfeed event count",
"description": "Number of newsfeed events",
"category": "sum",
"contentType": "sum",
"aggregationTemporality": "delta",
"isMonotonic": true,
"type": "long",
"unit": "{events}",
"attributeDefinitions": {
"attributes": {
"feed_type": {
"type": "string",
"description": "Newsfeed event type"
}
}
}
},
{
"namespace": {
"name": "spacefleet",
"version": 1
},
"kind": "metric",
"name": "test_metric",
"displayName": "Test metric",
"description": "Test metric",
"category": "current",
"contentType": "gauge",
"aggregationTemporality": "unspecified",
"isMonotonic": false,
"type": "long",
"unit": "{count}"
}
]
Space Fleet includes the fmm:metric object in its manifest, spacefleet/manifest.json, in the dependencies and objects arrays:
In the
dependenciesarray, line 3 pulls in thefmmcomponent, which is what thefmm:metricobject depends on:"dependencies": [ "dashui", "fmm", "k8s", "zodiac", "codex", "healthrule", "iam" ],In the
objectsarray, these lines pull in the definition of Space Fleet'sfmm:namespaceobject:"objects": [ { "type": "fmm:metric", "objectsFile": "objects/fmm/metrics/metric-types.json" } ]Each of the Space Fleet solution's entity definitions in the
fmm:entityobject it defines must reference the metrics it defines in itsfmm:metricobject.
Metric Aggregations
Space Fleet defines the following aggregations that roll up metrics:
- It rolls up metrics for
shieldentities into itsspacecraftentities. - It rolls up metrics for
torpedo_tubeentities into itsspacecraftentities.
To define these aggregations, the solution defines a MELT workflow of type fmm:metricAggregation in the file spacefleet/objects/fmm/metrics/metric-aggregations.json with the following contents:
[
{
"kind": "metricAggregation",
"name": "shiled_to_spacecraft_aggregation_config",
"displayName": "Shield To Spacecraft Metric Aggregation",
"namespace": {
"name": "spacefleet",
"version": 1
},
"scopeFilter": "true",
"fromEntityType": "spacefleet:shield",
"toEntityType": "spacefleet:spacecraft",
"path": "entities(spacefleet:shield).in(common:consists_of).from(spacefleet:spacecraft)",
"metricMappings": [
{
"fromMetric": {
"type": "spacefleet:shield_level"
},
"toMetric": {
"type": "spacefleet:shield_level"
}
}
]
},
{
"kind": "metricAggregation",
"name": "torpedo_tube_to_spacecraft_aggregation_config",
"displayName": "Torpedo Tube To Spacecraft Metric Aggregation",
"namespace": {
"name": "spacefleet",
"version": 1
},
"scopeFilter": "true",
"fromEntityType": "spacefleet:torpedo_tube",
"toEntityType": "spacefleet:spacecraft",
"path": "entities(spacefleet:torpedo_tube).in(common:consists_of).from(spacefleet:spacecraft)",
"metricMappings": [
{
"fromMetric": {
"type": "spacefleet:torpedo_count"
},
"toMetric": {
"type": "spacefleet:torpedo_count"
}
}
]
}
]
Space Fleet includes the fmm:metricAggregation object in its manifest, spacefleet/manifest.json, in the dependencies and objects arrays:
In the
dependenciesarray, line 3 pulls in thefmmcomponent, which is what thefmm:entityobject depends on:"dependencies": [ "dashui", "fmm", "k8s", "zodiac", "codex", "healthrule", "iam" ]In the
objectsarray, these lines pull in the definition of Space Fleet'sfmm:metricAggregationobject:"objects": [ { "type": "fmm:metricAggregation", "objectsFile": "objects/fmm/metrics/metric-aggregations.json" } ]
Metric Derivations
In addition, the Space Fleet solution derives new metrics from the following events:
- It derives the
suggestion_countmetric from asuggestionevent. - It derives the
shield_event_countmetric from ashield_eventevent.
To define these derivations, Space Fleet defines a MELT workflow of type fmm:metricDerivation in the file spacefleet/objects/fmm/metrics/metric-derivations.json with the following contents:
[
{
"kind": "metricDerivation",
"namespace": {
"name": "spacefleet",
"version": 1
},
"name": "suggestion_event_to_metric_derivation_config",
"displayName": "count suggestion events",
"description": "This configuration is for a metric that counts sugegstion events",
"trigger": {
"kind": "event",
"type": "spacefleet:suggestion",
"scopeFilter": "true"
},
"output": {
"kind": "metric",
"type": "spacefleet:suggestion_count"
},
"mapping": {
"entity": "trigger.entityMetadata",
"timestamp": "trigger.timestamp",
"value": "1",
"attributes": {}
}
},
{
"kind": "metricDerivation",
"namespace": {
"name": "spacefleet",
"version": 1
},
"name": "shield_event_to_metric_derivation_config",
"displayName": "count shield_event events",
"description": "This configuration is for a metric that counts shield_event events",
"trigger": {
"kind": "event",
"type": "spacefleet:shield_event",
"scopeFilter": "true"
},
"output": {
"kind": "metric",
"type": "spacefleet:shield_event_count"
},
"mapping": {
"entity": "trigger.entityMetadata",
"timestamp": "trigger.timestamp",
"value": "1",
"attributes": {
"type": "trigger.attributes.type.value"
}
}
}
]
Space Fleet includes the fmm:metricDerivation object in its manifest, spacefleet/manifest.json, in the dependencies and objects arrays:
In the
dependenciesarray, line 3 pulls in thefmmcomponent, which is what thefmm:metricDerivationobject depends on:"dependencies": [ "dashui", "fmm", "k8s", "zodiac", "codex", "healthrule", "iam" ]In the
objectsarray, these lines pull in the definition of Space Fleet'sfmm:metricDerivationobject:"objects": [ { "type": "fmm:metricDerivation", "objectsFile": "objects/fmm/metrics/metric-derivations.json" } ]