Skip to content

Statistics

Detailed metrics and analytics for deployment activity and resource usage.

EndpointScopeAccess
GET /api/v1/statistics/globalAll tenantsUsers with statistics:read permission (admin, operator, viewer)
GET /api/v1/tenants/{id}/statisticsSingle tenantTenant members
ParameterValuesDefaultDescription
periodday, week, month, quarter, yearweekTime window for statistics
Terminal window
# Get global statistics for last 30 days
curl -H "Authorization: Bearer $TOKEN" \
"https://mantis.example.com/api/v1/statistics/global?period=month"
# Get tenant statistics for last 7 days
curl -H "Authorization: Bearer $TOKEN" \
"https://mantis.example.com/api/v1/tenants/abc123/statistics?period=week"

Deployments are categorized by their final state:

StateDescriptionCounted As
PendingWaiting to startIn-progress
RunningCurrently executingIn-progress
SucceededCompleted successfullySuccess
FailedCompleted with errorsFailure
CancelledManually stoppedNeither
{
"by_state": {
"pending": 5,
"running": 10,
"succeeded": 142,
"failed": 8,
"cancelled": 3
}
}

Calculated as the percentage of successful deployments out of all deployments in the period:

success_rate = (succeeded / total) × 100

total is the sum of all deployment statuses: pending, running, succeeded, failed, and cancelled. All deployments in the period contribute to the denominator.

Example:

  • 5 pending + 10 running + 142 succeeded + 8 failed + 3 cancelled = 168 total
  • Success rate = 142 / 168 × 100 = 84.5%

Mean execution time for completed deployments:

{
"avg_duration_ms": 45200
}

Display formats:

DurationFormat
< 1 second850ms
< 1 minute45.2s
≥ 1 minute2.5m

Statistics include daily deployment counts for trend visualization:

{
"deployment_trend": [
{ "date": "2024-01-15", "count": 28, "succeeded": 26, "failed": 2 },
{ "date": "2024-01-16", "count": 32, "succeeded": 30, "failed": 2 },
{ "date": "2024-01-17", "count": 25, "succeeded": 24, "failed": 1 },
{ "date": "2024-01-18", "count": 35, "succeeded": 33, "failed": 2 },
{ "date": "2024-01-19", "count": 20, "succeeded": 19, "failed": 1 },
{ "date": "2024-01-20", "count": 8, "succeeded": 8, "failed": 0 },
{ "date": "2024-01-21", "count": 8, "succeeded": 7, "failed": 1 }
]
}

The trend data enables:

AnalysisInsight
Daily volumeIdentify peak deployment days
Failure spikesDetect problematic releases
Weekend patternsSee reduced activity periods
Growth trendsTrack deployment frequency over time
Mon Tue Wed Thu Fri Sat Sun
Count 28 32 25 35 20 8 8
Success 26 30 24 33 19 8 7
Failed 2 2 1 2 1 0 1
Rate 92% 94% 96% 94% 95% 100% 88%

Resources scoped to the current tenant:

ResourceDescription
solutionsNumber of solution packages
targetsRegistered deployment targets
environmentsDeployment environments
variablesConfiguration variables
tagsOrganization tags

Resources shared across all tenants:

ResourceDescription
sequencesShared execution sequences
actionsShared action definitions
{
"resource_counts": {
"solutions": 12,
"targets": 24,
"environments": 4,
"variables": 156,
"tags": 18,
"sequences": 8,
"actions": 24
}
}

Recent system activity is tracked:

{
"recent_activity": [
{
"timestamp": "2024-01-21T14:30:00Z",
"event_type": "deployment_success",
"description": "Deployment web-app completed successfully",
"resource_type": "deployment",
"resource_id": "abc123",
"resource_name": "web-app",
"user": "alice@example.com"
},
{
"timestamp": "2024-01-21T14:15:00Z",
"event_type": "deployment_failed",
"description": "Deployment api-service failed",
"resource_type": "deployment",
"resource_id": "def456",
"resource_name": "api-service",
"user": "bob@example.com"
}
]
}

The activity feed surfaces deployment lifecycle events. The event_type field is derived from the deployment status:

Event TypeDescription
deployment_pendingDeployment created, waiting to start
deployment_queuedDeployment queued for execution
deployment_runningDeployment is executing
deployment_successDeployment completed successfully
deployment_failedDeployment failed
deployment_cancelledDeployment was cancelled
┌───────────────────────────────────────────────────────────┐
│ Recent Activity │
├───────────────────────────────────────────────────────────┤
│ │
│ ● 14:30 deployment_success │
│ web-app completed successfully │
│ by alice@example.com │
│ │
│ ● 14:15 deployment_failed │
│ api-service failed │
│ by bob@example.com │
│ │
│ ● 13:45 deployment_running │
│ backend-services started │
│ by carol@example.com │
│ │
│ ● 13:00 deployment_cancelled │
│ web-app v1.2.2 was cancelled │
│ by dave@example.com │
│ │
└───────────────────────────────────────────────────────────┘

Administrators see top tenants ranked by activity:

{
"top_tenants": [
{
"tenant_id": "abc123",
"tenant_name": "Acme Corp",
"deployment_count": 48,
"success_rate": 97.9
},
{
"tenant_id": "def456",
"tenant_name": "Beta Inc",
"deployment_count": 32,
"success_rate": 93.8
},
{
"tenant_id": "ghi789",
"tenant_name": "Gamma LLC",
"deployment_count": 28,
"success_rate": 89.3
}
]
}
┌─────────────────────────────────────────────────────────────┐
│ Top Tenants by Deployment Activity │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────┬──────────────┬────────────────────┐ │
│ │ Tenant │ Deployments │ Success Rate │ │
│ ├────────────────┼──────────────┼────────────────────┤ │
│ │ 🥇 Acme Corp │ 48 │ 97.9% ████████████│ │
│ │ 🥈 Beta Inc │ 32 │ 93.8% ███████████ │ │
│ │ 🥉 Gamma LLC │ 28 │ 89.3% ██████████ │ │
│ │ Delta Co │ 15 │ 86.7% █████████ │ │
│ │ Epsilon Ltd │ 12 │ 91.7% ███████████ │ │
│ └────────────────┴──────────────┴────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
StatusDescription
OnlineTarget has an active session with its assigned Thorax instance
StaleSession has gone idle; set by Thorax after the configured stale timeout (default 300 s)
OfflineNo heartbeat received within the liveness window (default 360 s); also the initial state for targets that have never connected

Target health counts are not part of the statistics API response (which carries deployment_stats, resource_counts, and recent_activity). Query target health via the targets API (GET /api/v1/targets, filterable by status) or the real-time SSE target stream.

┌─────────────────────────────────────────────────────────────┐
│ Target Health │
├─────────────────────────────────────────────────────────────┤
│ │
│ Online: 83% ██████████████████████████████████░░░░░░░░ │
│ │
│ ┌──────────┬──────────┬──────────┬──────────┐ │
│ │ Total │ Online │ Stale │ Offline │ │
│ │ 24 │ 20 │ 2 │ 2 │ │
│ │ │ (83.3%) │ (8.3%) │ (8.3%) │ │
│ └──────────┴──────────┴──────────┴──────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
PeriodDaysDate Range Example
day1Jan 21 only
week7Jan 15 - Jan 21
month30Dec 22 - Jan 21
quarter90Oct 23 - Jan 21
year365Jan 22, 2023 - Jan 21, 2024

Via Lens UI:

Period: [Last 7 Days ▼]
┌─────────────────────┐
│ Last 24 Hours │
│ Last 7 Days ● │
│ Last 30 Days │
│ Last 90 Days │
│ Last Year │
└─────────────────────┘

Via the REST API, select the period with the ?period= query parameter (day, week, month, quarter, or year):

Terminal window
curl "$MANTIS_URL/api/v1/statistics/global?period=day" -H "Authorization: Bearer $TOKEN"
curl "$MANTIS_URL/api/v1/statistics/global?period=week" -H "Authorization: Bearer $TOKEN"
curl "$MANTIS_URL/api/v1/statistics/global?period=month" -H "Authorization: Bearer $TOKEN"

Statistics are exposed through the REST API (and the Lens dashboard); there is no mantisctl statistics subcommand.

Terminal window
# Get global statistics (requires statistics:read permission)
curl "$MANTIS_URL/api/v1/statistics/global?period=week" \
-H "Authorization: Bearer $TOKEN"
Terminal window
# Get statistics for a specific tenant (by tenant ID)
curl "$MANTIS_URL/api/v1/tenants/<tenant-id>/statistics?period=week" \
-H "Authorization: Bearer $TOKEN"

The endpoints return JSON. Pipe the response through jq (or redirect to a file) to capture or transform it:

Terminal window
# Save raw JSON
curl -s "$MANTIS_URL/api/v1/statistics/global?period=month" \
-H "Authorization: Bearer $TOKEN" > stats.json

Track success rate over time:

TrendInterpretationAction
Stable > 95%HealthyContinue monitoring
DecliningProblems emergingInvestigate recent changes
VolatileInconsistentReview deployment practices
Below 90%CriticalImmediate investigation

Recommended alert thresholds:

MetricWarningCritical
Success Rate< 95%< 90%
Avg Duration> 2× baseline> 5× baseline
Failed Deployments> 3 per day> 10 per day
Offline Targets> 5%> 10%
FrequencyFocus
DailyCurrent activity, failures
WeeklyTrends, patterns
MonthlyGrowth, capacity
QuarterlyPerformance optimization
ScenarioRecommended Period
TroubleshootingLast 24 Hours
Weekly reportsLast 7 Days
Trend analysisLast 30 Days
Capacity planningLast 90 Days
Annual reviewLast Year

Cause: Permission or connectivity issue

Solution:

  1. Verify authentication token is valid
  2. Confirm your role has the statistics:read permission (admin, operator, or viewer)
  3. Confirm network connectivity to API

Cause: SSE disconnected or aggregator lag

Solution:

  1. Click refresh button
  2. Check SSE connection status
  3. Verify aggregator service is running

Cause: Period too short or no deployments

Solution:

  1. Extend time period
  2. Verify deployments occurred in period
  3. Check deployment filters