Skip to main content

freshservice-exporter

Freshservice Exporter — Prometheus metrics for Freshservice ITSM & DORA

Prometheus exporter for Freshservice with a broad metric surface for Grafana Cloud — ITSM operations, SLA tracking, and DORA (MTTR, deployment frequency, change failure rate, lead time).

CI CodeQL PyPI Python License GHCR Helm

PyPI: pip install freshservice-exporter · Image: ghcr.io/polarpoint-io/freshservice-exporter:latest · Chart: ghcr.io/polarpoint-io/charts/freshservice-exporter

Repository layout

├── exporter.py              # Prometheus collector entrypoint
├── client.py                # Freshservice API v2 client
├── metrics.py / dora.py     # Aggregation logic
├── charts/                  # Helm chart for Kubernetes
├── dashboards/              # Grafana dashboard JSON
├── examples/                # Prometheus / Grafana Agent scrape configs
├── scripts/scrape_once.py   # One-shot local test scrape
└── tests/

Installation

From PyPI:

pip install freshservice-exporter

From GHCR:

docker run -e FRESHSERVICE_API_KEY=... -e FRESHSERVICE_DOMAIN=company.freshservice.com \
  -p 9192:9192 ghcr.io/polarpoint-io/freshservice-exporter:latest

Docker image tags

Tag When pushed
1.2.3 / 1.2 / 1 On a published release, installed from the matching PyPI package
latest / main Every merge to main (snapshot, built from source)
<version>-dev.<run> / <version>-dev-<sha> Prerelease snapshots on every merge to main

Quick start

pip install -e .

export FRESHSERVICE_API_KEY=your_api_key
export FRESHSERVICE_DOMAIN=your_company.freshservice.com
export FRESHSERVICE_INCLUDE_STATS=true
export FRESHSERVICE_DORA_LOOKBACK_DAYS=30

freshservice-exporter

Metrics: http://localhost:9192/metrics

Grafana query patterns

Use sum/count pairs for averages:

# Mean ticket resolution time (seconds)
sum(freshservice_ticket_resolution_duration_seconds_sum)
/
sum(freshservice_ticket_resolution_duration_seconds_count)

# Mean MTTR for incidents only (DORA)
freshservice_dora_mttr_seconds

# Deployment success rate
sum(freshservice_releases_completed_in_window_total)
/
(
  sum(freshservice_releases_completed_in_window_total)
  + sum(freshservice_releases_failed_in_window_total)
)

# Open ticket backlog by priority
sum by (priority) (freshservice_tickets_open_by_priority_total)

Metric catalog

Tickets

Metric Labels Description
freshservice_tickets_total Tickets in fetch scope
freshservice_tickets_by_status_total status Count by status
freshservice_tickets_by_priority_total priority Count by priority
freshservice_tickets_by_type_total type Incident, Service Request, …
freshservice_tickets_by_group_total group_id Assignment group
freshservice_tickets_by_category_total category Category
freshservice_tickets_by_department_total department_id Department
freshservice_tickets_by_workspace_total workspace_id Workspace
freshservice_tickets_by_source_total source email, portal, slack, …
freshservice_tickets_by_impact_total impact low / medium / high
freshservice_tickets_by_status_priority_total status, priority Cross-tab
freshservice_tickets_by_type_status_total type, status Cross-tab
freshservice_tickets_open_by_priority_total priority Open + pending only
freshservice_tickets_open_age_bucket_total bucket 1d, 3d, 7d, 30d, 90d, older
freshservice_tickets_unassigned_open_total No responder
freshservice_tickets_escalated_open_total Escalated
freshservice_tickets_overdue_open_total Past due_by
freshservice_tickets_first_response_overdue_open_total Past fr_due_by
freshservice_tickets_spam_total Spam flag
freshservice_tickets_resolved_in_window_total type Resolved in lookback window
freshservice_ticket_resolution_duration_seconds_sum type, priority Resolution time sum
freshservice_ticket_resolution_duration_seconds_count type, priority Resolution time count
freshservice_ticket_first_response_duration_seconds_sum type, priority First response sum
freshservice_ticket_first_response_duration_seconds_count type, priority First response count

Changes

Metric Labels Description
freshservice_changes_total Changes in scope
freshservice_changes_by_status_total status Pipeline stage
freshservice_changes_by_priority_total priority Priority
freshservice_changes_by_risk_total risk Risk level
freshservice_changes_by_type_total change_type minor / standard / major / emergency
freshservice_changes_by_group_total group_id Group
freshservice_changes_by_department_total department_id Department
freshservice_changes_by_approval_status_total approval_status Approval state
freshservice_changes_by_status_type_total status, change_type Cross-tab
freshservice_changes_by_status_risk_total status, risk Cross-tab
freshservice_changes_open_by_type_total change_type Open pipeline
freshservice_changes_open_age_bucket_total bucket Age of open changes
freshservice_changes_emergency_open_total Open emergency changes
freshservice_changes_overdue_open_total Past planned_end_date
freshservice_changes_closed_in_window_total change_type Closed in lookback window
freshservice_change_cycle_duration_seconds_sum change_type created → closed sum
freshservice_change_cycle_duration_seconds_count change_type created → closed count
freshservice_change_approval_to_close_duration_seconds_sum change_type approval → close sum
freshservice_change_approval_to_close_duration_seconds_count change_type approval → close count

Releases (deployments)

Metric Labels Description
freshservice_releases_total Releases in scope
freshservice_releases_by_status_total status open, in_progress, completed, incomplete
freshservice_releases_by_type_total release_type minor / standard / major / emergency
freshservice_releases_by_priority_total priority Priority
freshservice_releases_by_type_status_total release_type, status Cross-tab
freshservice_releases_open_by_type_total release_type In-flight releases
freshservice_releases_open_age_bucket_total bucket Age of open releases
freshservice_releases_overdue_open_total Past planned_end_date
freshservice_releases_completed_in_window_total release_type Successful deployments
freshservice_releases_failed_in_window_total release_type Failed (incomplete) deployments
freshservice_release_work_duration_seconds_sum release_type work_end − work_start sum
freshservice_release_work_duration_seconds_count release_type work_end − work_start count

Problems

Metric Labels Description
freshservice_problems_total Problems in scope
freshservice_problems_by_status_total status Status
freshservice_problems_by_priority_total priority Priority
freshservice_problems_by_impact_total impact Impact
freshservice_problems_by_status_impact_total status, impact Cross-tab
freshservice_problems_known_error_total Known errors
freshservice_problems_open_total Open problems
freshservice_problems_open_age_bucket_total bucket Age buckets
freshservice_problems_overdue_open_total Past due_by

DORA

Metric Description
freshservice_dora_mttr_seconds Mean time to restore (incidents)
freshservice_dora_mttr_incident_count Sample size
freshservice_dora_first_response_seconds Mean first response
freshservice_dora_lead_time_seconds Mean change lead time
freshservice_dora_deployment_frequency_per_day Releases per day
freshservice_dora_change_failure_rate Failed / (success + failed)
freshservice_dora_deployments_total outcome=success|failed|in_progress
freshservice_dora_open_incidents_total Open incidents by priority
freshservice_dora_lookback_days Configured window

Exporter diagnostics

Metric Description
freshservice_exporter_last_scrape_timestamp Last scrape unix time
freshservice_exporter_last_scrape_duration_seconds Scrape duration
freshservice_exporter_last_scrape_successful 1 = OK
freshservice_exporter_api_errors_total Cumulative errors

Configuration

Variable Default Description
FRESHSERVICE_API_KEY required API key
FRESHSERVICE_DOMAIN required company.freshservice.com
EXPORTER_PORT 9192 Metrics port
SCRAPE_INTERVAL 300 Seconds between API scrapes
FRESHSERVICE_DORA_LOOKBACK_DAYS 30 Window for DORA + resolved counts
FRESHSERVICE_INCLUDE_STATS true Embed stats (needed for durations)
FRESHSERVICE_MTTR_TICKET_TYPES Incident Ticket types for MTTR
FRESHSERVICE_WORKSPACE_ID 0 = all workspaces

Development

make install
make test
make lint
make scrape    # requires .env with API credentials

Publish to GitHub (polarpoint-io)

gh auth login

gh repo create polarpoint-io/freshservice-exporter --private --source=. --remote=origin
git push -u origin main

Required GitHub secrets

Add these at GitHub repo → Settings → Secrets and variables → Actions:

Secret Description
POL_GH_TOKEN PAT with repo + write:packages scope (semantic-release)
PYPI_TOKEN PyPI API token for freshservice-exporter (semantic-release + release workflow)

Release process

Merges to main run semantic-release (ci.yml), which versions from conventional commits, publishes to PyPI, and creates a GitHub release. Publishing a release then triggers release.yml, which uploads to PyPI (idempotent, --skip-existing) and pushes the semver-tagged multi-arch image to GHCR built from the published package.

Helm

helm registry login ghcr.io --username <github-user> --password <github-pat>

helm install freshservice-exporter oci://ghcr.io/polarpoint-io/charts/freshservice-exporter \
  --namespace monitoring --create-namespace \
  --set freshservice.apiKey=<API_KEY> \
  --set freshservice.domain=company.freshservice.com

Or install from the local chart during development:

helm install freshservice-exporter ./charts/freshservice-exporter \
  --namespace monitoring --create-namespace \
  --set freshservice.apiKey=<API_KEY> \
  --set freshservice.domain=company.freshservice.com

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freshservice_exporter-0.1.0.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

freshservice_exporter-0.1.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file freshservice_exporter-0.1.0.tar.gz.

File metadata

  • Download URL: freshservice_exporter-0.1.0.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for freshservice_exporter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 583e49389034e190fb8257d54cd058e9effce1836e648e8bad5fa85f7f4feb9f
MD5 6ee4209ccbc07b57023cd6a3301192db
BLAKE2b-256 9c9a7fdb06ffc170ffcce2ec3c9fa3dd09678710e97b8f5fddfeee98529b1c91

See more details on using hashes here.

File details

Details for the file freshservice_exporter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for freshservice_exporter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e903bc72f90286358c81a381594f415c87d25af50df4a768f9772969ab5ea93a
MD5 f09281e49caa92aa85412402e30fb92f
BLAKE2b-256 0848516f3943ead188fe4f85deb4196c00d5ca1b344dbae042ea50fb3dfacb12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page