Schema for OPC collected data

I am trying to setup a schema for OPC data and need some feedback if what I am doing makes sense so far. I am using grafana to roll up status information about the OCP data into a couple of dashboards also. Should I have one measurement per OPC endpoints (over 350 at the moment) or group them by device type (a shredder has multiple endpoints on it) with one line with multiple endpoints (I could foresee issues with different sample rates and RP in the future). It would be easiest for the grafana dashboards if all of the endpoints where in one measurement but I don’t think that scales in the long term as well because of the additional tags and series let alone RP. One idea might be to do the 350 different measurements and have a continuous query that does the slight downscale and pre-calculations for grafana to read but I am not sure it can do that in near realtime.

Hello @kramik1,
Welcome! I recommend checking out this documentation on schema design and data layout recommendations, if you haven’t already. I’m not that familiar with OPC, can you please describe what you mean by “I could foresee issues with different sample rates and RP in the future”? However we generally recommend creating fewer measurements and using tags more liberally. You can apply retention policies and continuous queries on individual series.

Ok, I was initially under the impression that the RP were at the measurement level. With OPC some data is read multiple times a second while others could be far less. Some data like valve position is only recorded when they change. I have read through the documentation and forums offering advice but I am hitting limits on what should probably be easier to do in Grafana. Some people working with IOT devices are making a measurement per device type.

So the 350 measurements is not advisable. I was just adjusting my ingester to write everything in one large measurement with about 5 tags to break down the line entry into plant location, type of machine, specific machine, serial code and datapoint name. I am trying to just get the dashboards for the current data streaming well in Grafana at the moment. The next step would be to put RP on the various data series so that I am downsampling for the data point as needed.

1 Like

That sounds like a good plan!

Ok, so I don’t think one large measurement is going to work well. It looks like I need to do more of a granular approach. So that all temperatures from every device gets put into the temperature measurement. So there would be 10 or different measurements. I guess what I am really trying to avoid is writing hundreds of queries for my roll up status panels and not having to define thresholds for each panel individually.

One of the major downsides of one large measurement is when I try to get all of the information in one large query, all of the fields are selected even though there is no data in a large amount of them. So this idea is very hard to work with in Grafana let alone the huge amount of network traffic.