Giter VIP home page Giter VIP logo

Comments (14)

bastelfreak avatar bastelfreak commented on July 29, 2024

Hi @TomaszUrugOlszewski, thanks for the issue. Are you able to provide a PR for this?

from puppet-prometheus.

benpollardcts avatar benpollardcts commented on July 29, 2024

I've just tested this using the YAML pasted above and I'm unable to replicate the issue.
Can you confirm your versions match the below? I assume they do as I've installed from the packages you have listed.

Enviroment:
Debian GNU/Linux 8.9
puppet 4.10.8
hiera 3.3.2
ruby 2.1.9p490

from puppet-prometheus.

tuxmea avatar tuxmea commented on July 29, 2024

@TomaszUrugOlszewski can you please verify the comment from @benpollardcts

from puppet-prometheus.

TomaszUrugOlszewski avatar TomaszUrugOlszewski commented on July 29, 2024

Yes, of course. I'll try to find out what's wrong.

from puppet-prometheus.

TomaszUrugOlszewski avatar TomaszUrugOlszewski commented on July 29, 2024

I was able to recreate my issue on fresh vagrant environment with image debian/contrib-jessie64

ii  puppet-agent                   1.10.9-1jessie              amd64        The Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, hiera and mcollective.
ii  puppetlabs-release-pc1         1.1.0-2jessie               all          Release packages for the Puppet Labs PC1 repository
ii  puppetserver                   2.8.0-1puppetlabs1          all          Puppet Labs puppetserver

Test code

vagrant@contrib-jessie:~$ cat /etc/puppetlabs/code/environments/production/manifests/site.pp 
$ble = {
  'scrape_configs' =>
    [
      {
        'job_name'       => 'bleble',
        'static_configs' =>
          [
            {
              'targets' =>
                [
                  'mongo-badabum2a:9216',
                  'mongo-badabum2b:9216',
                  'mongo-badabum2c:9216',
                ],
            
                'labels' =>
                  {
                    'cluster' => 'something-somewhere-sometime',
                  }
            }
          ]
      }
    ]
}

$template = @(END)
<% require 'yaml' -%>
<%= @ble.to_yaml(options = {:line_width => -1}) -%>
END

file { '/tmp/test.yaml':
  content => inline_template($template)
}

Result

"scrape_configs":
- "job_name": >-
    bleble
  "static_configs":
  - "targets":
    - >-
      mongo-badabum2a:9216
    - >-
      mongo-badabum2b:9216
    - >-
      mongo-badabum2c:9216
    "labels":
      "cluster": >-
        something-somewhere-sometime

After changing line_width "-1" to "800":

root@contrib-jessie:/home/vagrant# cat /tmp/test.yaml 
---
scrape_configs:
- job_name: bleble
  static_configs:
  - targets:
    - mongo-badabum2a:9216
    - mongo-badabum2b:9216
    - mongo-badabum2c:9216
    labels:
      cluster: something-somewhere-sometime

To be honest, I have no idea how to debug it, I'm not familar with ruby. My suggestion is to change it from -1 to some bigger value than 80, or revert, to keep compability with older(?) puppet/puppetserver/debian versions.

from puppet-prometheus.

tuxmea avatar tuxmea commented on July 29, 2024

@TomaszUrugOlszewski one question: is the yaml file with the weird syntax working? I want to know whether this is just ugly looking or whether it affects the service.

from puppet-prometheus.

 avatar commented on July 29, 2024

Initially I thought that it's broken syntax, but after removing my "dirty fix" looks like everything is fine. Works as expected.

from puppet-prometheus.

tuxmea avatar tuxmea commented on July 29, 2024

@TomekClearcode thanks. @TomaszUrugOlszewski can you confirm that the ugly looking syntax is working?
Please let us know if you are OK with having ugly looking but working syntax. In this case we could close this issue.

from puppet-prometheus.

TomaszUrugOlszewski avatar TomaszUrugOlszewski commented on July 29, 2024

Sorry @tuxmea, it was me under different login. Yes we can close it, I can live with it.

from puppet-prometheus.

tuxmea avatar tuxmea commented on July 29, 2024

@TomaszUrugOlszewski great. thanks.

from puppet-prometheus.

Ulme007 avatar Ulme007 commented on July 29, 2024

We have tried to update to the latest Puppet module version and we got an error with the Prometheus config test during the Puppet run.

puppet-agent[23364]: (/Stage[main]/Prometheus::Config/File[prometheus.yaml]/content)   line 135: cannot unmarshal !!str `[__addr...` into model.LabelNames
puppet-agent[23364]: (/Stage[main]/Prometheus::Config/File[prometheus.yaml]/content)   line 139: cannot unmarshal !!str `[__para...` into model.LabelNames

We use the following setup:

  • Prometheus Version: 1.7.1
  • OS: CentOS Linux release 7.4.1708 (Core)
  • Puppet Version: 5.3.5
  • Prometheus Puppet Modul Version: v5.0.0

Part of our working 'prometheus.yaml'

- job_name: blackbox
  scrape_interval: 30s
  scrape_timeout: 30s
  metrics_path: "/probe"
  params:
    module:
    - index_page
  static_configs:
  - targets:
    - https://localhost/index.html
  relabel_configs:
  - source_labels: [__address__]
    target_label: __param_target
  - source_labels: [__param_target]
    target_label: instance
  - target_label: __address__
    replacement: 127.0.0.1:9115

The is the not working config:

...
  - source_labels: >-
    [__address__]
...

Could you please reopen this issue.

from puppet-prometheus.

vanch avatar vanch commented on July 29, 2024

I have the same issue with:

puppetserver=5.3.3
puppet-agent=5.5.3
ruby=2.4.4p296 (2018-03-28 revision 63013)
prometheus module=6.0.6

And this definitely affects the service.

UPD: I was trying to use prometheus server > v2, but did it wrong with hiera. Now I am able to use hiera right way and I have prom v2 and my config has right syntax.

from puppet-prometheus.

bastelfreak avatar bastelfreak commented on July 29, 2024

@vanch what did you change?
@Ulme007 not sure what the issue is. Are the hiera strings quoted? Could you share your hiera data?

from puppet-prometheus.

TheMeier avatar TheMeier commented on July 29, 2024

Closing due to lack of feedback, feel free to re-open

from puppet-prometheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.