prometheus-config-builder 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7f24f728c3588f20881943ddc565d4ffd3c59e5773f707438b334f53f7c7c153
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: adba59f9d0c76f21c2f24adfe5b6bfcd70910626efbf72a0a25d26a27179847c
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 37cdc8c31df3dab1e7539c0b4998df7f49a481479c20f06dffecb9fb3d3bf129b34eb8180bba711dbd384c85d8d522cda719c3e7887d4550fcf8e7f40a2b7246
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 577987e98216ea21770683000a3b7cc8943831a8fee83dd7cfe8d20792ba5376d18265f0af0e7b3d5d80a20b14c64bbb31c96db4c7d4eb0127837129255db8c8
         
     | 
| 
         @@ -23,6 +23,7 @@ config[:bucket_region] ||= '' 
     | 
|
| 
       23 
23 
     | 
    
         
             
            config[:root] ||= 'test/data'
         
     | 
| 
       24 
24 
     | 
    
         
             
            config[:every] = 60
         
     | 
| 
       25 
25 
     | 
    
         
             
            config[:pgrep] = nil
         
     | 
| 
      
 26 
     | 
    
         
            +
            config[:sync] = false
         
     | 
| 
       26 
27 
     | 
    
         | 
| 
       27 
28 
     | 
    
         
             
            # Defaults
         
     | 
| 
       28 
29 
     | 
    
         
             
            op = OptionParser.new do |o|
         
     | 
| 
         @@ -50,6 +51,9 @@ op = OptionParser.new do |o| 
     | 
|
| 
       50 
51 
     | 
    
         
             
              o.on('--every=[seconds]', 'Rerun every n seconds') do |seconds|
         
     | 
| 
       51 
52 
     | 
    
         
             
                config[:every] = seconds.to_i
         
     | 
| 
       52 
53 
     | 
    
         
             
              end
         
     | 
| 
      
 54 
     | 
    
         
            +
              o.on('--sync', 'Write configuration once, then exit') do
         
     | 
| 
      
 55 
     | 
    
         
            +
                config[:sync] = true
         
     | 
| 
      
 56 
     | 
    
         
            +
              end
         
     | 
| 
       53 
57 
     | 
    
         
             
              o.on('--pgrep=[string]', 'pgrep -f [string] for finding Prometheus process for SIGHUP') do |str|
         
     | 
| 
       54 
58 
     | 
    
         
             
                config[:pgrep] = str
         
     | 
| 
       55 
59 
     | 
    
         
             
              end
         
     | 
| 
         @@ -109,6 +113,17 @@ config[:paths].each do |path| 
     | 
|
| 
       109 
113 
     | 
    
         
             
            end
         
     | 
| 
       110 
114 
     | 
    
         
             
            builder.add_bucket_region(config[:bucket_region])
         
     | 
| 
       111 
115 
     | 
    
         | 
| 
      
 116 
     | 
    
         
            +
            if config[:sync] == true
         
     | 
| 
      
 117 
     | 
    
         
            +
              begin
         
     | 
| 
      
 118 
     | 
    
         
            +
                builder.write_out
         
     | 
| 
      
 119 
     | 
    
         
            +
              rescue Exception => e
         
     | 
| 
      
 120 
     | 
    
         
            +
                log.warn("Error while building config: #{e}")
         
     | 
| 
      
 121 
     | 
    
         
            +
                puts e.backtrace
         
     | 
| 
      
 122 
     | 
    
         
            +
                exit(1)
         
     | 
| 
      
 123 
     | 
    
         
            +
              end
         
     | 
| 
      
 124 
     | 
    
         
            +
              exit(0)
         
     | 
| 
      
 125 
     | 
    
         
            +
            end
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
       112 
127 
     | 
    
         
             
            loop do
         
     | 
| 
       113 
128 
     | 
    
         
             
              starting = Time.now
         
     | 
| 
       114 
129 
     | 
    
         
             
              begin
         
     | 
    
        data/test/configdiscovery.rb
    CHANGED
    
    | 
         @@ -90,7 +90,7 @@ class ConfigDiscoveryTest < Minitest::Test 
     | 
|
| 
       90 
90 
     | 
    
         
             
              def test_discover_config_files
         
     | 
| 
       91 
91 
     | 
    
         
             
                x = PrometheusConfigBuilder::ConfigDiscover.new
         
     | 
| 
       92 
92 
     | 
    
         | 
| 
       93 
     | 
    
         
            -
                files = x.discover("./test/data/test*.yaml")
         
     | 
| 
      
 93 
     | 
    
         
            +
                files = x.discover("./test/data/test*.yaml", "")
         
     | 
| 
       94 
94 
     | 
    
         
             
                assert_equal 2, files.length
         
     | 
| 
       95 
95 
     | 
    
         | 
| 
       96 
96 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: prometheus-config-builder
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.42
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Juho Mäkinen juho.makinen@gmail.com
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-02-18 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: aws-sdk
         
     |