OneUptime / oneuptime

OneUptime is the complete open-source observability platform.
https://oneuptime.com
Apache License 2.0
4.85k stars 228 forks source link

Monitor Status Event trigger not returns monitor labels in model #1657

Closed luisxkimo closed 3 months ago

luisxkimo commented 3 months ago

Describe the bug Creating a new workflow using as trigger "On Create Monitor Status Event", I would like to check the labels of the monitor that triggers the event.

Here is the "Select fields" configuration:

{
    "project": {
        "name": true,
        "_id": true
    },
    "monitor": {
        "currentMonitorStatus":true,
        "name": true,
        "_id": true,
        "monitorType": true,
        "labels": true
    },
    "monitorStatus": {
        "name": true,
        "_id": true,
        "isOperationalState": true,
        "isOfflineState": true
    },
    "rootCause": true,
    "startsAt": true
}

I expectd that in the model there are the labels of the monitor, but not.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Workflows'
  2. Create new workflow with trigger "On Create Monitor Status Event"
  3. In select fields, add previous configuration
  4. Force an event of this kind and check the "Workflow logs" section to know the values of labels

Expected behavior I expectd that in the model there are the labels of the monitor,

Screenshots From the "Run and logs" we can see this: missing labels section inside json of "monitor", but other like "monitorType" works well: image

Desktop (please complete the following information):

Deployment Type Helm chart

simlarsen commented 3 months ago

Since this is a nested object, it won't. It only returns 1 level of nesting. This is done to improve performance. what you can do is add another component to fetch the monitor by id and fetch labels there.

Please let me know if this helps!

luisxkimo commented 3 months ago

Hi @simlarsen ,

Ok, in that case I think that we can continue discuss this solution here:

https://github.com/OneUptime/oneuptime/issues/1658

Because its exactly what I did trying to solve this gap, but I still having issues.

Closed this issue in that case from my side.

Thanks!