Comments (8)
Hello again!!
Is it possible to add tags through here? :
https://github.com/daq-tools/kotori/blob/master/kotori/io/protocol/influx.py#L45
Best Regards.
from kotori.
Dear @TheOneWhoKnocks96,
after starting this yesterday, it seems I got distracted somehow. Sorry.
The link you are pointing out looks like it is coming from the InfluxDB query machinery, i.e. suitable for requesting data from InfluxDB -- it's the read path again!
expression = Query('*').from_(measurement).where(time__gte=time_begin, time__lte=time_end, **tags)
With kind regards,
Andreas.
from kotori.
The link you are pointing out looks like it is coming from the InfluxDB query machinery, i.e. suitable for requesting data from InfluxDB -- it's the read path again!
Ah okay, my bad.
after starting this yesterday, it seems I got distracted somehow. Sorry.
This means that the feature of adding tags to the InfluxDB is not implemented yet?
Best Regards.
from kotori.
Dear @TheOneWhoKnocks96,
Adding tags to the InfluxDB database
This means that the feature of adding tags to the InfluxDB database is not implemented yet?
It well is - kind of. You might want to amend some code at kotori.daq.storage.influx.format_chunk
according to your needs. The whole file is about the data acquisition path where you will get an insight how data is actually written into the InfluxDB database.
Inside this method, you will find references to chunk["tags"]
, which is a dictionary where you can stuff tags into.
Example
There's already a section for transforming the geohash
telemetry field to an InfluxDB tag:
# Extract geohash from data. Finally, thanks Rich!
# TODO: Also precompute geohash with 3-4 different zoomlevels and add them as tags
if "geohash" in data:
chunk["tags"]["geohash"] = data["geohash"]
del data['geohash']
which we are using for ingesting data from luftdaten.info through https://github.com/hiveeyes/luftdatenpumpe.
Hope this helps.
With kind regards,
Andreas.
from kotori.
So i can just add my tags here? -> https://github.com/daq-tools/kotori/blob/0.22.7/kotori/daq/storage/influx.py#L145
something like this?:
chunk = {
"measurement": meta['measurement'],
"tags": {
"host": "server01",
"region": "europe",
},
}
"""
if "gateway" in meta:
chunk["tags"]["gateway"] = meta["gateway"]
if "node" in meta:
chunk["tags"]["node"] = meta["node"]
"""
And then this after?:
if "gateway" in meta:
chunk["tags"]["gateway"] = data["gateway"]
del data['gateway']
I don't know if this is correct, hope you could help.
Thanks for the help so far anyway @amotl
Best Regards
from kotori.
Dear @Ozymandias96,
correct, you can fill key/value pairs into chunk["tags"]
anywhere within this method. Whether you statically insert them right there using a hacked version of influx.py
or if you want to derive the tag fields from the data ingress payload itself like done with the fields geohash
, location
, location_id
, location_name
, sensor_id
and sensor_type
is really up to you.
We could also think about introducing a mechanism to declare a set of static tags per channel by defining them inside the Kotori configuration file.
Please let us know if you see other mechanisms for injecting tags into the record Kotori is about to insert into InfluxDB here.
With kind regards,
Andreas.
from kotori.
I can't find and edit the influx.py script in my machine.
How do i derive the tag fields from the data ingress payload?
Thanks for the help
Best Regards
from kotori.
Dear @Ozymandias96,
sorry for the delay.
Installation location
I can't find and edit the influx.py script in my machine.
When installing Kotori from the Debian package, it will unfold at /opt/kotori/lib/python2.7/site-packages/kotori
.
Derive tag fields
How do i derive the tag fields from the data ingress payload?
And then this after?:
if "gateway" in meta:
chunk["tags"]["gateway"] = data["gateway"]
del data['gateway']
Right, I've outlined an example within #14 (comment).
Example
There's already a section for transforming the geohash
telemetry field to an InfluxDB tag:
# Extract geohash from data. Finally, thanks Rich!
# TODO: Also precompute geohash with 3-4 different zoomlevels and add them as tags
if "geohash" in data:
chunk["tags"]["geohash"] = data["geohash"]
del data['geohash']
With kind regards,
Andreas.
from kotori.
Related Issues (20)
- docker-compose up is taking very long HOT 2
- Video tutorial HOT 1
- Panels are not updated on instant dashboards after update to Grafana 9.3.1 and Kotori 0.27.0 HOT 1
- Support new devices for DAQ-SIG
- Add ISEMS project to gallery
- Add "Well Depth Monitor" to project gallery
- Grafana: Adjust a few integration details
- Error channel reports `'NoneType' object has no attribute 'endswith'`
- Docker is sunsetting Free Team organizations HOT 5
- [Proposal] Add a generic device-based addressing scheme for "WAN" networks HOT 1
- Modernize firmware builder to use PlatformIO
- bunch ยป munch ยป benedict
- Support FIWARE NGSI-LD, NGSIv2, and Ultralight 2.0 protocols
- Support Sparkplug MQTT protocol HOT 2
- Make plumbing less opinionated
- Support Shelly devices HOT 2
- Support Jesth / Paradict / Braq
- Time series forecasting / prediction HOT 8
- LECO, PyMeasure, PyVISA
- HomA and Wiren Board MQTT Conventions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotori.