Skip to content

v4.0.0

Compare
Choose a tag to compare
@OuranosSkia OuranosSkia released this 26 Jun 17:28
· 13 commits to master since this release
7810717

Good-influx 4.0.0 - Schema-based influx logging

Why the move to schemas?

The problems which I had been consistently running into with the current form of the plugin were around maintaining existing data setups as well as building new ones with data that can be found in different formats but should ultimately be returned as something specific. I was consistently struggling to create setups which maintained what existed before and I was creating a ton of code to ensure that the new measurements I was building were writing logs that conformed to the right types.

Schema-based formatting will allow people to strongly enforce the structure of what they are logging and prevent issues of different events having different data types. It also allows this data to be more discoverable as it will always match one of your schema files. Lastly, with schemas it becomes a very trivial process to add extra data or even whole processing of events.

What breaking changes are there?

I have removed some things which are no longer useful now that you can define a schema.
The things I removed are:

  • [metadata] - This was too limiting as it only allowed you to add tags. This has been replaced by defaultFields and defaultTags.
  • [customLogFormatters] - This was too limited in scope anyways, but is also now fully unnecessary as schemas take care of this for you.
  • [fieldTags] - This became unnecessary as schemas allow you to specify what things to put in tags.
  • [measurementOverride] - Replaced by eventName, which now applies before routing the event to a formatter.
  • [valueTransformer] - This became unnecessary as schemas fully handle the functionality that this provided.

Wow... that's a lot of things removed... what didn't change then?

The basic line item formats that the plugin was previously providing are still intact. They were just moved to be schemas.

So, what all is new?

There are many new things! The biggest one is that you can structure your data into schemas which creates a very strong typing and formatting for line items as well as a finer control over fields and tags.

Otherwise:

  • [defaultTags] and [defaultFields] - These replace the singular metadata config. They allow you to specify things that should be present in tags or fields on all events.
  • [eventName] - This replaced the old measurementOverride. It now runs before determining which set of schemas to process, allowing you to choose how an event gets processed based on things besides just its name field. This has no influence on the resultant measurement names, unlike its predecessor.