{"id":21893070,"url":"https://github.com/peekjef72/objserv_exporter","last_synced_at":"2026-05-19T06:31:38.861Z","repository":{"id":111491432,"uuid":"328606838","full_name":"peekjef72/objserv_exporter","owner":"peekjef72","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-11T09:10:00.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-05T10:01:42.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peekjef72.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-11T09:09:35.000Z","updated_at":"2024-06-19T08:08:55.341Z","dependencies_parsed_at":"2023-04-26T04:19:41.058Z","dependency_job_id":null,"html_url":"https://github.com/peekjef72/objserv_exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peekjef72%2Fobjserv_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peekjef72%2Fobjserv_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peekjef72%2Fobjserv_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peekjef72%2Fobjserv_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peekjef72","download_url":"https://codeload.github.com/peekjef72/objserv_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902929,"owners_count":20529114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T13:01:27.049Z","updated_at":"2026-05-19T06:31:33.818Z","avatar_url":"https://github.com/peekjef72.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus ObjectServer Exporter [![Build Status](https://travis-ci.org/free/sql_exporter.svg)](https://travis-ci.org/free/sql_exporter) [![Go Report Card](https://goreportcard.com/badge/github.com/free/sql_exporter)](https://goreportcard.com/report/github.com/free/sql_exporter) [![GoDoc](https://godoc.org/github.com/free/sql_exporter?status.svg)](https://godoc.org/github.com/free/sql_exporter) [![Docker Pulls](https://img.shields.io/docker/pulls/githubfree/sql_exporter.svg?maxAge=604800)](https://hub.docker.com/r/githubfree/sql_exporter)\n\nObject exporter for [Prometheus](https://prometheus.io).\n\n## Overview\n\nObjServ Exporter is a configuration driven exporter that exposes metrics gathered from Netcool's ObjectServer, for use by the Prometheus\nmonitoring system.\n\nThe collected metrics and the queries that produce them are entirely configuration defined. SQL queries are grouped into\ncollectors -- logical groups of queries, e.g. *query stats* or *I/O stats*, mapped to the metrics they populate.\nCollectors may be DBMS-specific (e.g. *MySQL InnoDB stats*) or custom, deployment specific (e.g. *pricing data\nfreshness*). This means you can quickly and easily set up custom collectors to measure data quality, whatever that might\nmean in your specific case.\n\nPer the Prometheus philosophy, scrapes are synchronous (metrics are collected on every `/metrics` poll) but, in order to\nkeep load at reasonable levels, minimum collection intervals may optionally be set per collector, producing cached\nmetrics when queried more frequently than the configured interval.\n\n### Install dependencines\n\n[FreeTDS](http://www.freetds.org/) libraries must be installed on the system.\n\nMac\n```shell\nbrew install freetds\n```\nUbuntu, Debian...\n```shell\nsudo apt-get install freetds-dev\n```\n\n## Usage\n\nGet Prometheus Objserv_Exporter, either as a [packaged release](bitbucket)\nbuild it yourself:\n\n```\n$ go install github.com/free/objserv_exporter/cmd/objserv_exporter\n```\n\nthen run it from the command line:\n\n```\n$ sql_exporter\n```\n\nUse the `-help` flag to get help information.\n\n```\n$ ./objserv_exporter -help\nUsage of ./objserv_exporter:\n  -config.file string\n      ObjectServer Exporter configuration file name. (default \"objserv_exporter.yml\")\n  -web.listen-address string\n      Address to listen on for web interface and telemetry. (default \":9399\")\n  -web.metrics-path string\n      Path under which to expose metrics. (default \"/metrics\")\n  [...]\n```\n\n## Configuration\n\nObjectServer Exporter is deployed alongside the OS server it collects metrics from. If both the exporter and the DB\nserver are on the same host, they will share the same failure domain: they will usually be either both up and running\nor both down. When the database is unreachable, `/metrics` responds with HTTP code 500 Internal Server Error, causing\nPrometheus to record `up=0` for that scrape. Only metrics defined by collectors are exported on the `/metrics` endpoint.\nObjectServer Exporter process metrics are exported at `/objserv_exporter_metrics`.\n\nThe configuration examples listed here only cover the core elements. For a comprehensive and comprehensively documented\nconfiguration file check out \n[`documentation/sql_exporter.yml`](https://github.com/free/sql_exporter/tree/master/documentation/sql_exporter.yml).\nYou will find ready to use \"standard\" DBMS-specific collector definitions in the\n[`examples`](https://github.com/free/sql_exporter/tree/master/examples) directory. You may contribute your own collector\ndefinitions and metric additions if you think they could be more widely useful, even if they are merely different takes\non already covered DBMSs.\n\n**`./objserv_exporter.yml`**\n\n```yaml\n# Global settings and defaults.\nglobal:\n  # Subtracted from Prometheus' scrape_timeout to give us some headroom and prevent Prometheus from\n  # timing out first.\n  scrape_timeout_offset: 500ms\n  # Minimum interval between collector runs: by default (0s) collectors are executed on every scrape.\n  min_interval: 0s\n  # Maximum number of open connections to any one target. Metric queries will run concurrently on\n  # multiple connections.\n  max_connections: 3\n  # Maximum number of idle connections to any one target.\n  max_idle_connections: 3\n\n# The target to monitor and the list of collectors to execute on it.\ntarget:\n  # Data source name always has a URI schema that matches the driver name. In some cases (e.g. MySQL)\n  # the schema gets dropped or replaced to match the driver expected DSN format.\n  data_source_name: 'mssql://Server=TBSM;user=netcool_reader;password=xxxxx;compatibilty=openserver;'\n\n  # Collectors (referenced by name) to execute on the target.\n  collectors: [objectserver_alerts]\n\n# Collector definition files.\ncollector_files: \n  - \"*.collector.yml\"\n```\n\n### Collectors\n\nCollectors may be defined inline, in the exporter configuration file, under `collectors`, or they may be defined in\nseparate files and referenced in the exporter configuration by name, making them easy to share and reuse.\n\nThe collector definition below generates gauge metrics of the form `pricing_update_time{market=\"US\"}`.\n\n**`./objectserver_alerts.collector.yml`**\n\n```yaml\n# This collector will be referenced in the exporter configuration as `pricing_data_freshness`.\ncollector_name: objectserver_alerts\n\n# A Prometheus metric with (optional) additional labels, value and labels populated from one query.\nmetrics:\n  - metric_name: pricing_update_time\n    type: gauge\n    help: 'Time when prices for a market were last updated.'\n    key_labels:\n      # Populated from the `market` column of each row.\n      - result\n    static_labels:\n      # Arbitrary key/value pair\n      alertname: test_hostxxx\n    values: [num, max_severity]\n    query: |\n      SELECT count(*), Max(Severity)\n      FROM status\n      WHERE Identifer='xxxxx'\n```\n\n### Data Source Names\n\nmssql://Server=DSN_NAME(from freetds.conf);user=user;password=passw;compatibility=openserver\n\n## Why It Exists\nObjserv_exporter is a fork of sql_exporter with gofreetds database/sql driver.\n\nSQL Exporter started off as an exporter for Microsoft SQL Server, for which no reliable exporters exist. But what is\nthe point of a configuration driven SQL exporter, if you're going to use it along with 2 more exporters with wholly\ndifferent world views and configurations, because you also have MySQL and PostgreSQL instances to monitor?\n\nA couple of alternative database agnostic exporters are available -- https://github.com/justwatchcom/sql_exporter and\nhttps://github.com/chop-dbhi/prometheus-sql -- but they both do the collection at fixed intervals, independent of\nPrometheus scrapes. This is partly a philosophical issue, but practical issues are not all that difficult to imagine:\njitter; duplicate data points; or collected but not scraped data points. The control they provide over which labels get\napplied is limited, and the base label set spammy. And finally, configurations are not easily reused without\ncopy-pasting and editing across jobs and instances.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeekjef72%2Fobjserv_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeekjef72%2Fobjserv_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeekjef72%2Fobjserv_exporter/lists"}