Categorygithub.com/sacloud/sakuracloud_exporter
repositorypackage
0.0.0-20241029003316-696cf6c940ab
Repository: https://github.com/sacloud/sakuracloud_exporter.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

sakuracloud_exporter

Test Status Discord License Version Downloads

Prometheus exporter for SakuraCloud metrics.

Installation

Binaries

Download the already existing binaries for your platform:

$ ./sakuracloud_exporter <flags> 

If you want to use sakuracloud_exporter with systemd, see systemd examples.

From source

Using the standard go install (you must have [Go][golang] already installed in your local machine):

$ go install github.com/sacloud/sakuracloud_exporter

$ sakuracloud_exporter <flags>

Docker

To run the SakuraCloud exporter as a Docker container, run:

$ docker run -p 9542:9542 -e SAKURACLOUD_ACCESS_TOKEN=<YOUR-TOKEN> -e SAKURACLOUD_ACCESS_TOKEN_SECRET=<YOUR-SECRET> ghcr.io/sacloud/sakuracloud_exporter 

Usage

Flags

Flag / Environment VariableRequiredDefaultDescription
--token / SAKURACLOUD_ACCESS_TOKENAPI Key(Token)
--secret / SAKURACLOUD_ACCESS_TOKEN_SECRETAPI Key(Secret)
--ratelimit/ SAKURACLOUD_RATE_LIMIT5API request rate limit(maximum:10)
--webaddr / WEB_ADDR:9542Exporter's listen address
--webpath/ WEB_PATH/metricsMetrics request path
--no-collector.auto-backupfalseDisable the AutoBackup collector
--no-collector.billfalseDisable the Bill collector
--no-collector.couponfalseDisable the Coupon collector
--no-collector.databasefalseDisable the Database collector
--no-collector.esmefalseDisable the ESME collector
--no-collector.internetfalseDisable the Internet(Switch+Router) collector
--no-collector.load-balancerfalseDisable the LoadBalancer collector
--no-collector.local-routerfalseDisable the LocalRouter collector
--no-collector.mobile-gatewayfalseDisable the MobileGateway collector
--no-collector.nfsfalseDisable the NFS collector
--no-collector.proxy-lbfalseDisable the ProxyLB(Enhanced LoadBalancer) collector
--no-collector.serverfalseDisable the Server collector
--no-collector.server.except-maintenancefalseDisable the Server collector except for maintenance information
--no-collector.simfalseDisable the SIM collector
--no-collector.vpc-routerfalseDisable the VPCRouter collector
--no-collector.zonefalseDisable the Zone collector
--no-collector.webaccelfalseDisable the WebAccel collector

Flags for debug

Flag / Environment VariableRequiredDefaultDescription
--fake-mode / FAKE_MODEThe file path of fake store. If set this, make enabled to fake-store-mode(powered by libsacloud's fake driver)

Example fake store file(JSON) is here[examples/fake/generate-fake-store-json/example-fake-store.json].

Metrics

Supported Resource Types

The exporter returns the following metrics:

Resource TypeMetric Name Prefix
AutoBackupsakuracloud_auto_backup_*
Billsakuracloud_bill_*
Couponsakuracloud_coupon_*
Databasesakuracloud_database_*
ESMEsakuracloud_esme_*
Switch+Routersakuracloud_internet_*
LoadBalancersakuracloud_loadbalancer_*
LocalRoutersakuracloud_local_router_*
MobileGatewaysakuracloud_mobile_gateway_*
NFSsakuracloud_nfs_*
ProxyLBsakuracloud_proxylb_*
Serversakuracloud_server_*
SIMsakuracloud_sim_*
VPCRoutersakuracloud_vpc_router_*
Zonesakuracloud_zone_*
WebAccelwebaccel_*
Exportersakuracloud_exporter_*

AutoBackup

MetricDescriptionLabels
sakuracloud_auto_backup_infoA metric with a constant '1' value labeled by auto_backup informationid, name, disk_id, max_backup_num, weekdays, tags, descriptions
sakuracloud_auto_backup_countA count of archives created by AutoBackupid, name, disk_id
sakuracloud_auto_backup_last_timeLast backup time in seconds since epoch (1970)id, name, disk_id
sakuracloud_auto_backup_archive_infoA metric with a constant '1' value labeled by backuped archive informationid, name, disk_id, archive_id, archive_name, archive_tags, archive_description

Bill

MetricDescriptionLabels
sakuracloud_bill_amountAmount billed for the monthmember_id

[!IMPORTANT] This value is updated only once per day. Please ensure the interval is not set too short to avoid unnecessary processing.

Coupon

MetricDescriptionLabels
sakuracloud_coupon_discountThe balance of couponid, member_id, contract_id
sakuracloud_coupon_remaining_daysThe count of coupon's remaining daysid, member_id, contract_id
sakuracloud_coupon_exp_dateCoupon expiration date in seconds since epoch (1970)id, member_id, contract_id
sakuracloud_coupon_usable1 if coupon is usableid, member_id, contract_id

[!IMPORTANT] This value is updated only once per day. Please ensure the interval is not set too short to avoid unnecessary processing.

Database

MetricDescriptionLabels
sakuracloud_database_infoA metric with a constant '1' value labeled by database informationid, name, zone, plan, host, database_type, database_revision, database_version, web_ui, replication_enabled, replication_role, tags, description
sakuracloud_database_upIf 1 the database is up and running, 0 otherwiseid, name, zone
sakuracloud_database_cpu_timeDatabase's CPU time(unit:ms)id, name, zone
sakuracloud_database_memory_usedDatabase's used memory size(unit:GB)id, name, zone
sakuracloud_database_memory_totalDatabase's total memory size(unit:GB)id, name, zone
sakuracloud_database_nic_infoA metric with a constant '1' value labeled by nic informationid, name, zone, upstream_type, upstream_id, upstream_name, ipaddress, nw_mask_len, gateway
sakuracloud_database_nic_receiveNIC's receive bytes(unit: Kbps)id, name, zone
sakuracloud_database_nic_sendNIC's send bytes(unit: Kbps)id, name, zone
sakuracloud_database_disk_system_usedDatabase's used system-disk size(unit:GB)id, name, zone
sakuracloud_database_disk_system_totalDatabase's total system-disk size(unit:GB)id, name, zone
sakuracloud_database_disk_backup_usedDatabase's used backup-disk size(unit:GB)id, name, zone
sakuracloud_database_disk_backup_totalDatabase's total backup-disk size(unit:GB)id, name, zone
sakuracloud_database_binlog_usedDatabase's used binlog size(unit:GB)id, name, zone
sakuracloud_database_disk_readDisk's read bytes(unit: KBps)id, name, zone
sakuracloud_database_disk_writeDisk's write bytes(unit: KBps)id, name, zone
sakuracloud_database_replication_delayReplication delay time(unit:second)id, name, zone
sakuracloud_database_maintenance_infoA metric with a constant '1' value labeled by maintenance informationid, name, zone, info_url, info_title, description, start_date, end_date
sakuracloud_database_maintenance_scheduledIf 1 the database has scheduled maintenance info, 0 otherwiseid, name, zone
sakuracloud_database_maintenance_startScheduled maintenance start time in seconds since epoch (1970)id, name, zone
sakuracloud_database_maintenance_endScheduled maintenance end time in seconds since epoch (1970)id, name, zone

ESME

MetricDescriptionLabels
sakuracloud_esme_infoA metric with a constant '1' value labeled by ESME informationid, name, tags, description
sakuracloud_esme_message_countA count of messages handled by ESMEid, name, status

Switch+Router

MetricDescriptionLabels
sakuracloud_internet_infoA metric with a constant '1' value labeled by internet informationid, name, zone, switch_id, bandwidth, tags, description
sakuracloud_internet_receiveTotal receive bytes(unit: Kbps)id, name, zone, switch_id
sakuracloud_internet_sendTotal send bytes(unit: Kbps)id, name, zone, switch_id

LoadBalancer

MetricDescriptionLabels
sakuracloud_loadbalancer_infoA metric with a constant '1' value labeled by loadbalancer informationid, name, zone, plan, ha, vrid, ipaddress1, ipaddress2, gateway, nw_mask_len, tags, description
sakuracloud_loadbalancer_upIf 1 the loadbalancer is up and running, 0 otherwiseid, name, zone
sakuracloud_loadbalancer_receiveLoadbalancer's receive bytes(unit: Kbps)id, name, zone
sakuracloud_loadbalancer_sendLoadbalancer's receive bytes(unit: Kbps)id, name, zone
sakuracloud_loadbalancer_vip_infoA metric with a constant '1' value labeld by vip informationid, name, zone, vip_index, vip, port, interval, sorry_server, description
sakuracloud_loadbalancer_vip_cpsConnection count per secondid, name, zone, vip_index, vip
sakuracloud_loadbalancer_server_infoA metric with a constant '1' value labeld by real-server informationid, name, zone, vip_index, vip, server_index, ipaddress ,monitor, path, response_code
sakuracloud_loadbalancer_server_upIf 1 the server is up and running, 0 otherwiseid, name, zone, vip_index, vip, server_index, ipaddress
sakuracloud_loadbalancer_server_connectionCurrent connection countid, name, zone, vip_index, vip, server_index, ipaddress
sakuracloud_loadbalancer_server_cpsConnection count per secondid, name, zone, vip_index, vip, server_index, ipaddress
sakuracloud_loadbalancer_maintenance_infoA metric with a constant '1' value labeled by maintenance informationid, name, zone, info_url, info_title, description, start_date, end_date
sakuracloud_loadbalancer_maintenance_scheduledIf 1 the loadbalancer has scheduled maintenance info, 0 otherwiseid, name, zone
sakuracloud_loadbalancer_maintenance_startScheduled maintenance start time in seconds since epoch (1970)id, name, zone
sakuracloud_loadbalancer_maintenance_endScheduled maintenance end time in seconds since epoch (1970)id, name, zone

LocalRouter

MetricDescriptionLabels
sakuracloud_local_router_infoA metric with a constant '1' value labeled by localRouter informationid, name, tags, description
sakuracloud_local_router_upIf 1 the localRouter is up and running, 0 otherwiseid, name
sakuracloud_local_router_switch_infoA metric with a constant '1' value labeled by localRouter connected switch informationid, name, category, code, zone_id
sakuracloud_local_router_network_infoA metric with a constant '1' value labeled by network information of the localRouterid, name, vip, ipaddress1, ipaddress2, nw_mask_len, vrid
sakuracloud_local_router_static_route_infoA metric with a constant '1' value labeled by static route informationid, name, route_index, prefix, next_hop
sakuracloud_local_router_peer_infoA metric with a constant '1' value labeled by peer informationid, name, peer_index, peer_id, enabled, description
sakuracloud_local_router_peer_upIf 1 the Peer is available, 0 otherwiseid, name, peer_index, peer_id
sakuracloud_local_router_receive_per_secReceive bytes per secondsid, name
sakuracloud_local_router_send_per_secSend bytes per secondsid, name

MobileGateway

MetricDescriptionLabels
sakuracloud_mobile_gateway_infoA metric with a constant '1' value labeled by mobile_gateway informationid, name, zone, internet_connection, inter_device_communication, tags, description
sakuracloud_mobile_gateway_upIf 1 the mobile_gateway is up and running, 0 otherwiseid, name, zone
sakuracloud_mobile_gateway_nic_receiveMobileGateway's receive bytes(unit: Kbps)id, name, zone, nic_index, ipaddress, nw_mask_len
sakuracloud_mobile_gateway_nic_sendMobileGateway's send bytes(unit: Kbps)id, name, zone, nic_index, ipaddress, nw_mask_len
sakuracloud_mobile_gateway_traffic_control_infoA metric with a constant '1' value labeled by traffic-control informationid, name, zone , traffic_quota_in_mb, bandwidth_limit_in_kbps, enable_email, enable_slack, slack_url, auto_traffic_shaping
sakuracloud_mobile_gateway_traffic_uplinkMobileGateway's uplink bytes(unit: KB)id, name, zone
sakuracloud_mobile_gateway_traffic_downlinkMobileGateway's downlink bytes(unit: KB)id, name, zone
sakuracloud_mobile_gateway_traffic_shapingIf 1 the traffic is shaped, 0 otherwiseid, name, zone
sakuracloud_mobile_gateway_maintenance_infoA metric with a constant '1' value labeled by maintenance informationid, name, zone, info_url, info_title, description, start_date, end_date
sakuracloud_mobile_gateway_maintenance_scheduledIf 1 the mobile_gateway has scheduled maintenance info, 0 otherwiseid, name, zone
sakuracloud_mobile_gateway_maintenance_startScheduled maintenance start time in seconds since epoch (1970)id, name, zone
sakuracloud_mobile_gateway_maintenance_endScheduled maintenance end time in seconds since epoch (1970)id, name, zone

NFS

MetricDescriptionLabels
sakuracloud_nfs_infoA metric with a constant '1' value labeled by nfs informationid, name, zone, plan, size, host, tags, description
sakuracloud_nfs_upIf 1 the nfs is up and running, 0 otherwiseid, name, zone
sakuracloud_nfs_free_disk_sizeNFS's Free Disk Size(unit: GB)id, name, zone
sakuracloud_nfs_nic_infoA metric with a constant '1' value labeled by nic informationid, name, zone, upstream_id, upstream_name, ipaddress, nw_mask_len, gateway
sakuracloud_nfs_receiveNIC's receive bytes(unit: Kbps)id, name, zone
sakuracloud_nfs_sendNIC's send bytes(unit: Kbps)id, name, zone
sakuracloud_nfs_maintenance_infoA metric with a constant '1' value labeled by maintenance informationid, name, zone, info_url, info_title, description, start_date, end_date
sakuracloud_nfs_maintenance_scheduledIf 1 the nfs has scheduled maintenance info, 0 otherwiseid, name, zone
sakuracloud_nfs_maintenance_startScheduled maintenance start time in seconds since epoch (1970)id, name, zone
sakuracloud_nfs_maintenance_endScheduled maintenance end time in seconds since epoch (1970)id, name, zone

Server

MetricDescriptionLabels
sakuracloud_server_infoA metric with a constant '1' value labeled by server informationid, name, zone, cpus, disks, nics, memories, host, tags, description, private_host_id
sakuracloud_server_upIf 1 the server is up and running, 0 otherwiseid, name, zone
sakuracloud_server_cpusNumber of server's vCPU coresid, name, zone
sakuracloud_server_cpu_timeServer's CPU time(unit: ms)id, name, zone
sakuracloud_server_memoriesSize of server's memories(unit: GB)id, name, zone
sakuracloud_server_disk_infoA metric with a constant '1' value labeled by disk informationid, name, zone, disk_id, disk_name, index, plan, interface, size, tags, description, storage_id, storage_class, storage_generation
sakuracloud_server_disk_readDisk's read bytes(unit: KBps)id, name, zone, disk_id, disk_name, index
sakuracloud_server_disk_writeDisk's write bytes(unit: KBps)id, name, zone, disk_id, disk_name, index
sakuracloud_server_nic_infoA metric with a constant '1' value labeled by nic informationid, name, zone, interface_id, index, upstream_type, upstream_id, upstream_name
sakuracloud_server_nic_bandwidthNIC's Bandwidth(unit: Mbps)id, name, zone, interface_id, index
sakuracloud_server_nic_receiveNIC's receive bytes(unit: Kbps)id, name, zone, interface_id, index
sakuracloud_server_nic_sendNIC's send bytes(unit: Kbps)id, name, zone, interface_id, index
sakuracloud_server_maintenance_infoA metric with a constant '1' value labeled by maintenance informationid, name, zone, info_url, info_title, description, start_date, end_date
sakuracloud_server_maintenance_scheduledIf 1 the server has scheduled maintenance info, 0 otherwiseid, name, zone
sakuracloud_server_maintenance_startScheduled maintenance start time in seconds since epoch (1970)id, name, zone
sakuracloud_server_maintenance_endScheduled maintenance end time in seconds since epoch (1970)id, name, zone

ProxyLB

MetricDescriptionLabels
sakuracloud_proxylb_infoA metric with a constant '1' value labeled by proxyLB informationplan, vip, fqdn, proxy_networks, sorry_server_ipaddress, sorry_server_port, tags, description
sakuracloud_proxylb_upIf 1 the ProxyLB is available, 0 otherwiseid, name
sakuracloud_proxylb_bind_port_infoA metric with a constant '1' value labeled by BindPort informationid, name, bind_port_index, proxy_mode, port
sakuracloud_proxylb_server_infoA metric with a constant '1' value labeled by real-server informationid, name, server_index, ipaddress, port, enabled
sakuracloud_proxylb_cert_infoA metric with a constant '1' value labeled by certificate informationid, name, cert_index, common_name, issuer_name
sakuracloud_proxylb_cert_expireCertificate expiration date in seconds since epoch (1970)id, name, cert_index
sakuracloud_proxylb_active_connectionsActive connection countid, name
sakuracloud_proxylb_connection_per_secConnection count per secondid, name

SIM

MetricDescriptionLabels
sakuracloud_sim_infoA metric with a constant '1' value labeled by sim informationid, name, imei_lock, registered_date, activated_date, deactivated_date, ipaddress, simgroup_id, carriers, tags, description
sakuracloud_sim_session_upIf 1 the session is up and running, 0 otherwiseid, name
sakuracloud_sim_uplinkUplink traffic (unit: Kbps)id, name
sakuracloud_sim_downlinkDownlink traffic (unit: Kbps)id, name

VPCRouter

MetricDescriptionLabels
sakuracloud_vpc_router_infoA metric with a constant '1' value labeled by vpc_router informationid, name, zone, plan, ha, vrid, vip, ipaddress1, ipaddress2, nw_mask_len, internet_connection, tags, description
sakuracloud_vpc_router_upIf 1 the vpc_router is up and running, 0 otherwiseid, name, zone
sakuracloud_vpc_router_cpu_timeVPCRouter's CPU time(unit: ms)id, name, zone
sakuracloud_vpc_router_sessionCurrent session countid, name, zone
sakuracloud_vpc_router_dhcp_leaseCurrent DHCPServer lease countid, name, zone
sakuracloud_vpc_router_l2tp_sessionCurrent L2TP-IPsec session countid, name, zone
sakuracloud_vpc_router_pptp_sessionCurrent PPTP session countid, name, zone
sakuracloud_vpc_router_s2s_peer_upIf 1 the vpc_router's site to site peer is up, 0 otherwiseid, name, zone, peer_address, peer_index
sakuracloud_vpc_router_session_analysisSession statistics for VPC routersid, name, zone, type, label
sakuracloud_vpc_router_receiveVPCRouter's receive bytes(unit: Kbps)id, name, zone, nic_index, vip, ipaddress1, ipaddress2, nw_mask_len
sakuracloud_vpc_router_sendVPCRouter's receive bytes(unit: Kbps)id, name, zone, nic_index, vip, ipaddress1, ipaddress2, nw_mask_len
sakuracloud_vpc_router_maintenance_infoA metric with a constant '1' value labeled by maintenance informationid, name, zone, info_url, info_title, description, start_date, end_date
sakuracloud_vpc_router_maintenance_scheduledIf 1 the vpc_router has scheduled maintenance info, 0 otherwiseid, name, zone
sakuracloud_vpc_router_maintenance_startScheduled maintenance start time in seconds since epoch (1970)id, name, zone
sakuracloud_vpc_router_maintenance_endScheduled maintenance end time in seconds since epoch (1970)id, name, zone

Zone

MetricDescriptionLabels
sakuracloud_zone_infoA metric with a constant '1' value labeled by zone informationid, name, description, region_id, region_name

WebAccel

MetricDescriptionLabels
webaccel_site_infoA metric with a constant '1' valueid, name, domain_type, domain, subdomain
webaccel_access_countAccess countid
webaccel_bytes_sentBytes sentid
webaccel_cache_miss_bytes_sentCache miss bytes sentid
webaccel_cache_hit_ratioCache hit ratioid
webaccel_bytes_cache_hit_ratioBytes cache hit ratioid
webaccel_pricePriceid
webaccel_cert_expireCertificate expiration date in seconds since epoch (1970)id

Exporter

MetricDescriptionLabels
sakuracloud_exporter_start_timeUnix timestamp of the start time-
sakuracloud_exporter_build_infoA metric with a constant '1' value labeled by exporter's build informationversion, revision, goversion
sakuracloud_exporter_errors_totalThe total number of errors per collectorcollector

License

sakuracloud_exporter Copyright (C) 2019-2023 sakuracloud_exporter authors.

This project is published under Apache 2.0 License.