(base float64)
| 876 | } |
| 877 | |
| 878 | func populateTSDBMetrics(base float64) *prometheus.Registry { |
| 879 | r := prometheus.NewRegistry() |
| 880 | |
| 881 | // Thanos shipper. |
| 882 | dirSyncs := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 883 | Name: "thanos_shipper_dir_syncs_total", |
| 884 | Help: "Total number of dir syncs", |
| 885 | }) |
| 886 | dirSyncs.Add(1 * base) |
| 887 | |
| 888 | dirSyncFailures := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 889 | Name: "thanos_shipper_dir_sync_failures_total", |
| 890 | Help: "Total number of failed dir syncs", |
| 891 | }) |
| 892 | dirSyncFailures.Add(2 * base) |
| 893 | |
| 894 | uploads := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 895 | Name: "thanos_shipper_uploads_total", |
| 896 | Help: "Total number of uploaded blocks", |
| 897 | }) |
| 898 | uploads.Add(3 * base) |
| 899 | |
| 900 | uploadFailures := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 901 | Name: "thanos_shipper_upload_failures_total", |
| 902 | Help: "Total number of block upload failures", |
| 903 | }) |
| 904 | uploadFailures.Add(4 * base) |
| 905 | |
| 906 | corruptedBlocks := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 907 | Name: "thanos_shipper_corrupted_blocks_total", |
| 908 | Help: "Total number of corrupted blocks", |
| 909 | }) |
| 910 | corruptedBlocks.Add(30 * base) |
| 911 | |
| 912 | // TSDB Head |
| 913 | seriesCreated := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 914 | Name: "prometheus_tsdb_head_series_created_total", |
| 915 | }) |
| 916 | seriesCreated.Add(5 * base) |
| 917 | |
| 918 | seriesRemoved := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 919 | Name: "prometheus_tsdb_head_series_removed_total", |
| 920 | }) |
| 921 | seriesRemoved.Add(6 * base) |
| 922 | |
| 923 | ran := promauto.With(r).NewCounter(prometheus.CounterOpts{ |
| 924 | Name: "prometheus_tsdb_compactions_total", |
| 925 | Help: "Total number of compactions that were executed for the partition.", |
| 926 | }) |
| 927 | ran.Add(7 * base) |
| 928 | |
| 929 | duration := promauto.With(r).NewHistogram(prometheus.HistogramOpts{ |
| 930 | Name: "prometheus_tsdb_compaction_duration_seconds", |
| 931 | Help: "Duration of compaction runs", |
| 932 | Buckets: prometheus.ExponentialBuckets(1, 2, 10), |
| 933 | }) |
| 934 | duration.Observe(9) |
| 935 |
no test coverage detected