Influxdb not inserting repeated data received from inputs.gnmi telegraf plugin

Hi guys.

I am trying to figure out what I’m doing wrong.

I have the following input config…

[[inputs.gnmi.subscription]]
name = “bgp_neighbor_state_updated”
origin = “openconfig-network-instance”
path = “/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/”
subscription_mode = “sample”
sample_interval = “10s”

I confirmed with tcpdump that the data is being received by telegraf and being sent to influx.

Yet influx does no add new entries if the data is no different than was already there for the specified field.

Is this expected behavior? This is making visualizations really problematic because users need to know to go back in time to see data.

When the data changes, it does update in influx.

Hello @Brian_Gibson,
No, you should have a value for each timestamp, even if the values are the same.
Can you please provide me with:

  • Your full telegraf config
  • Can you also write data to stdout? And share some of the line protocol?
[[outputs.file]]
  files = ["stdout"]
  • Finally, can you set debug=true in the agent portion of your config and send the logs?

Thank you.

Here is the relevant output
As you can see from below I am receiving this last_established entry from GNMI every 10 seconds. But if I do a query on the influx measurement there is just one value per peer…

Dec 15 20:09:04 techops01.ny2 telegraf[14151]: bgp_neighbor_state_updated,/network-instances/network-instance/protocols/protocol/name=BGP,host=techops01.ny2,identifier=BGP,name=default,neighbor_address=10.96.64.247,source=10.85.99.20 last_established=159988450903i 1606323597361262083

Here is the config

[[inputs.gnmi]]

Address and port of the GNMI GRPC server

addresses = [“redacted:6030”]

credentials

username = “redacted”
password = “redacted”

redial in case of failures after

redial = “10s”
tagexclude = [“openconfig-network-instance:/network-instances/network-instance/protocols/protocol/name”]
[[processors.enum]]
[[processors.enum.mapping]]
## Name of the field to map
field = “session_state”

[processors.enum.mapping.value_mappings]
  IDLE = 1
  CONNECT = 2
  ACTIVE = 3
  OPENSENT = 4
  OPENCONFIRM = 5
  ESTABLISHED = 6

[[inputs.gnmi.subscription]]
name = “bgp_neighbor_state_updated”
origin = “openconfig-network-instance”
path = “/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/”
subscription_mode = “sample”
sample_interval = "10s

neteng@carbon01.ny2 ~]$ influx
Connected to http://localhost:8086 version 1.8.2
InfluxDB shell version: 1.8.2

use systems_telegraf
Using database systems_telegraf
select last_established from bgp_neighbor_state_updated
name: bgp_neighbor_state_updated
time last_established


1606323597361262083 159988450903
1606323597373387294 160593598503
1606323597388440522 159988504203
1606323597401956235 159988449203
1606323597415693715 159988451203
1606323597427483246 160593667403
1606323597440341891 159988451903
1606323597455298566 159988450803
1606323597467680456 159988451103

So I figured out the problem.

For whatever reason the telegraf plugin is sending the data in such a way so that it inserts the last_established date “1606323597361262083” as the timestamp and this other value “159988450903” as the established date. This is obviously not ideal. First the data value “159988450903” makes no sense. As a straight conversion it is January 25th 1975. So I have no idea what that value is supposed to represent.

The timestamp it sends, however, is the actual established date.

This creates all sorts of issues with reporting obviously. The date can be months in the past and also Grafana and other visualization tools don’t usually report the time stamp as the data value.

Hello @Brian_Gibson,
I’m glad you figured it out. Do you need anymore help?

I think I’m good. Thanks for the help