For defining payloadShapes, is there a
# general
b
For defining payloadShapes, is there a reason why you can’t define a field with a _type Bool?
j
lol, we had just an internal discussion here as well from @krgrsebastian as well. also, have you tried our relational data modelling by @Roger ?
b
I have and I’m frustrated with it
So I’ve made a payloadShape that just has one number variable, I’ve referenced it in a data model and I’m just stuck in error purgatory trying to get a stream processor to work. Love the concept tho
In the stream processor docs, you gotta show an example of the payloadShape (production-metrics) so that I can understand how stream processors correlate with payloadShapes
Got it figured out: Config.yaml:
Copy code
payloadShapes:
    number:
        fields:
            value:
                _type: number
Data Model:
Copy code
state:
    _payloadshape: number
Stream Processor:
Copy code
sources:
  value: "{{ .location_path }}.path.to.tag"
mapping:
  state: "value ? 1 : 0"
In your mapping you must define the variable as the same name as the field defined in the payloadShape.
j
Let us tell you the new one, that one will be not that frustrating as the old one
@Roger
r
First of all, sorry for the late reply! I'm sorry to hear that it's frustrating you. But it's exactly this kind of honest feedback that helps us to continuously improve our product - thank you for taking your time and giving us your input. Very valid and fair point. We already plan to update the documentation soon! You found the workaround that was possible already besides using time-series, but as you experienced yourself, this is painful to do. As already mentioned, in a first attempt to give a better and easier user experience we've introduced relational data models, that can be defined in the MC UI. Now when clicking on Add Data Model you will be guided to a 'selection view', which provides initial information about the two types of models you can create. Clicking on relational will pre-fill the code editor with a working example and also show additional information in a separate side panel. You now have the option to define a fully custom model, with as many elements of type string or number as needed. We already have future plans to improve the UI and documentation further, as well as allowing more nested structures within the relational data model. The versioned data contract, _order_v1 in this example, then validates against this custom structure, just as already accustomed to. For this to show up the 'Relational Models Wizard' settings have to be enabled. I'm curious to hear your thoughts on this! https://cdn.discordapp.com/attachments/1496129734894026752/1497153586960924735/selection_view.png?ex=69ec7c6e&is=69eb2aee&hm=6dc33d0ff13a3e118228eb9d30b9e69a03ff6421810297414699472c0678f823& https://cdn.discordapp.com/attachments/1496129734894026752/1497153587204325386/example.png?ex=69ec7c6e&is=69eb2aee&hm=7cff11220135eefdd00a61fcb1bb013b8e922603a7b55cdf9c6b02acaf45be44& https://cdn.discordapp.com/attachments/1496129734894026752/1497153587481022505/sidepanel.png?ex=69ec7c6f&is=69eb2aef&hm=e5f886d32fb56044a8853e15e487fc0e506ca12f0073536114287556e8a07f01& https://cdn.discordapp.com/attachments/1496129734894026752/1497153587803852830/settings.png?ex=69ec7c6f&is=69eb2aef&hm=7358345b44536a7d04635b17091f2ba886cf796b52c031e42717e8c83043a50d&
b
Awesome to hear! I’ll give it a try hopefully today or this weekend.
8 Views