Code Monkey home page Code Monkey logo

pytelegraf's People

Contributors

bobo333 avatar paksu avatar sbi-c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytelegraf's Issues

Extremely slow in docker

When used in docker - just the line:
telegraf.metric("test", 1.2)
takes around 10s.

I use separate docker for telegraf (telegraf:1.22) and python script (FROM python:3.8-slim-buster), do you happend to know what could be the cause of this?

JSON format support

I'm using pytelegraf library but I want to send JSON format to telegraf agent. Is possible to support it? I think the command could be this:

client.metric("IMU_Acel",{"x": imu.get_x, "y": imu.get_y(), "z": imu.get_z()},
tags={'server_name': 'my-server'},
"timestamp"= 1458229140))

Return boolean after send?

# Socket errors should fail silently so they don't affect anything else

Hello developers,

Just wondering can we hv a return value (boolean) in the send() method? Therefore we can at least realise the Telegraf is offline and we can log it our way. Thanks

UDP listener is deprecated

On UDP listener page, it announced that UDP listener is deprecated.

You could replace with socket_listener and update configuration sample...
Thank you so much...

PS> I am trying this great module for my custom metrics. :)

output to file

Add an option/client implementation to write the line protocol to a file instead of socket or http request. Useful for debugging, when telegraf agent is down/inaccessible, or just to capture output.

Line protocol implementation includes empty tags, which Telegraf can't parse

The line protocol doesn't purge None or empty string values from tags. This causes Telegraf to fail parsing the message.

For example, for the following code:

from telegraf.client import TelegrafClient

client = TelegrafClient('localhost', 8094)
tags = {'foo': ''}
client.metric('metric', 1, tags=tags)

Running Telegraf version 1.8.0, the following error message is displayed:

2018-10-02T19:33:37Z E! Error in plugin [inputs.socket_listener]: unable to parse incoming packet: metric parse error: expected tag at offset 11: "metric,foo= value=1i\n"

Deprecation warning due to invalid escape sequences

Deprecation warnings are raised due to invalid escape sequences. This can be fixed by using raw strings or escaping the literals. pyupgrade also helps in automatic conversion : https://github.com/asottile/pyupgrade/

find . -iname '*.py' | grep -Ev 'vendor|example|doc|sphinx' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./telegraf/utils.py:9: DeprecationWarning: invalid escape sequence \)
  """
./telegraf/utils.py:19: DeprecationWarning: invalid escape sequence \,
  key = key.replace(",", "\,")
./telegraf/utils.py:20: DeprecationWarning: invalid escape sequence \ 
  key = key.replace(" ", "\ ")
./telegraf/utils.py:21: DeprecationWarning: invalid escape sequence \=
  key = key.replace("=", "\=")
./telegraf/tests.py:14: DeprecationWarning: invalid escape sequence \,
  self.assertEquals(format_string('foo,bar'), 'foo\,bar')
./telegraf/tests.py:15: DeprecationWarning: invalid escape sequence \ 
  self.assertEquals(format_string('foo bar'), 'foo\ bar')
./telegraf/tests.py:16: DeprecationWarning: invalid escape sequence \ 
  self.assertEquals(format_string('foo ,bar'), 'foo\ \,bar')
./telegraf/tests.py:17: DeprecationWarning: invalid escape sequence \ 
  self.assertEquals(format_string('foo ,bar,baz=foobar'), 'foo\ \,bar\,baz\=foobar')
./telegraf/tests.py:59: DeprecationWarning: invalid escape sequence \ 
  """white\ space,tag\ with\,\ comma=hello\,\ world value\,\ comma="foo\""""

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.