GithubHelp home page GithubHelp logo

Comments (9)

phobos182 avatar phobos182 commented on September 4, 2024

Thanks. I will take a look.

from collectd-elasticsearch.

petecheslock avatar petecheslock commented on September 4, 2024

❤️ thanks!

from collectd-elasticsearch.

josephruscio avatar josephruscio commented on September 4, 2024

@mheffner could this be related to the other issue we saw with custom plugins?

from collectd-elasticsearch.

mheffner avatar mheffner commented on September 4, 2024

We noticed that with Python input plugins the write_http output will choke if the meta field is not set correctly. A ticket was filed by @joncotton for this issue: collectd/collectd#716.

As an example, we had to set the meta field as follows. I'm still unsure what form the meta parameter requires:

def reader(input_data=None):
    metric = collectd.Values();
    metric.plugin = 'customgauge'
    metric.type = 'gauge'
    metric.plugin_instance = "test_librato_metric"
    metric.values = [0.88]
    metric.meta = {'0':True}
    metric.dispatch()

from collectd-elasticsearch.

josephruscio avatar josephruscio commented on September 4, 2024

/cc @obfuscurity

from collectd-elasticsearch.

joncotton avatar joncotton commented on September 4, 2024

Yup, it looks the same as my problem in Collectd with the write_http plugin. Specifically when using JSON, it trips over the meta attribute that the Python system is setting by default. (NULL would work, a non-empty dict would work, but an empty dict breaks the JSON parser.)

To narrow down: try this and look for errors. I bet it'll work.

<Plugin "write_http">
  <URL "http://example.com">
    Format "Command"  # not JSON
  </URL>
</Plugin>

The Librato API expects JSON so that's not a solution. As far as workarounds, you can assign that dummy dict to meta as @mheffner showed (implications? probably nothing if your data is delivering to Librato) or use the now-deprecated Librato writer plugin at https://github.com/librato/collectd-librato instead of write_http.

from collectd-elasticsearch.

petecheslock avatar petecheslock commented on September 4, 2024

Yup - that was it. I added var.meta = {'0':True} to approx here: https://github.com/phobos182/collectd-elasticsearch/blob/master/elasticsearch.py#L222

And now the metrics are getting sent up. Thanks all. I'm not going to submit a PR cause i'm not sure if that will cause issues with non-librato usage of write_http.

from collectd-elasticsearch.

josephruscio avatar josephruscio commented on September 4, 2024

@petecheslock AFAIK this isn't strictly limited to Librato. We just parse the JSON produced by write_http like any other target would. So this affects at least anyone using write_http to push JSON?

from collectd-elasticsearch.

cep21 avatar cep21 commented on September 4, 2024

I've had the same issue trying to use the write_http plugin. I created a pull request at #19 Would be great to get it fixed here as well, but since it's somewhat rare I also understand if rejected.

from collectd-elasticsearch.

Related Issues (9)

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.