Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

UDP Lineprotocol insert not working #544

@mpmX

Description

@mpmX

I'm trying to make inserts via udp but nothings gets inserted.

Example:

from influxdb import InfluxDBClient
client = InfluxDBClient(host="influxdb", username="admin", password="xxx", database="xyz", use_udp=True, udp_port=8090)
line = "metric1,tag1=1,tag2=2 value1=100"
client.send_packet(line, protocol="line")

No insert happend.
After looking at the code of send_packet I got confused by line 879:
data = ('\n'.join(packet) + '\n').encode('utf-8')
it turns the above line example to:
b'm\ne\nt\nr\ni\nc\n1\n,\nt\na\ng\n1\n=\n1\n,\nt\na\ng\n2\n=\n2\n \nv\na\nl\nu\ne\n1\n=\n1\n0\n0\n'
When calling client.udp_socket.sendto(line, (client._host, client._udp_port))
The insert works, but is not the intended way I guess.

Another question:
Is it true that the maximum precision for udp inserts is seconds? If so, why and how to workaround?
To me the whole point of using udp is to get rid of the http overhead for high frequent inserts where millisecond timestamps are very likely imo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy