Git Product home page Git Product logo

Comments (3)

keitwb avatar keitwb commented on August 13, 2024

Thanks for reporting this @jalaziz, even after finding the solution. The referenced PR should fix the panic and also provide clear context in the config file as to the error. I suspect you had a variable that was getting interpreted as YAML but had some kind of parse error, as I could not reproduce it with an unset or blank envvar. Either way, it should be easier to diagnose config errors after this PR is released.

Also, I would recommend using the following syntax to put in envvars:

globalDimensions:
  env: {"#from": "env:ENV_NAME", raw: true}
  region: {"#from": "env:REGION", raw: true}

This will prevent the values from attempting to be parsed as YAML.

from signalfx-agent.

jalaziz avatar jalaziz commented on August 13, 2024

@keitwb Thanks for the info. You are right, it was a different block that was causing the panic:

- type: collectd/kafka
   serviceURL: service:jmx:rmi:///jndi/rmi://{{.Host}}:9999/jmxrmi
   clusterName: ${ENV_NAME}-${REGION}
   discoveryRule: container_name == "kafka" && port == 9092

Looks like the - was being interpreted as a list? Adding quotes around the value doesn't seem to help.

Unfortunately, I don't believe the {"#from"} block works for this use case unless there's an undocumented trick?

from signalfx-agent.

keitwb avatar keitwb commented on August 13, 2024

Ah ok, that makes sense. The resolved value was just - if both envvars were blank, which I think gets interpreted as the start of a list, resulting in a syntax error. I just tested my PR with that particular combination and it will now give a better error message.

Yes, you are right that #from isn't powerful enough to combine values in an arbitrary template. The ${} will work fine but just remember that it pastes in the envvar values before parsing it as YAML.

from signalfx-agent.

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.