causiq / logary

Logs and metrics are one! Professional logging, metrics and analytics for your apps.
https://docs.logary.tech/
Other
528 stars 71 forks source link

InfluxDB target, 'pretty' printed field #326

Open btrepp opened 6 years ago

btrepp commented 6 years ago

It would be nice if the influxdb target had a field for the formatted log string. It sends the template string, and the fields, but it would be nice if there was a entry in the point that had them combined.

This would make it easier to read in tools like Grafana.

This may even apply to different targets aswell.

haf commented 6 years ago

@btrepp This is a good idea. It's also a very easy thing to build and test; especially since a similar formatting is done for gauges in v5/master. I added the "help wanted" tag if someone wants to get into this.

btrepp commented 6 years ago

I'm willing to give this a shot. Do you have any advice about where/how you would want this done?. It could be done on the logging domain objects, or I can focus it just on the influx target.

baronfel commented 6 years ago

I think the formatted log string can be seen here in the Stackdriver target: https://github.com/logary/logary/blob/master/src/targets/Logary.Targets.Stackdriver/Target_Stackdriver.fs#L208

haf commented 6 years ago

Tests here https://github.com/logary/logary/blob/master/src/tests/Logary.Targets.InfluxDb.Tests/LineProtocol.fs#L183

@baronfel Is right about formatting

Add as field https://github.com/logary/logary/blob/master/src/targets/Logary.Targets.InfluxDb/Targets_InfluxDb.fs#L261