-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add labels meta #959
base: main
Are you sure you want to change the base?
Conversation
@shahzad31 I'm worried this will confusing since the lightweight representation is not a valid heartbeat monitor and effectively undocumented, wdyt? |
@emilioalvap i will create a docs issue in a follow up to document this. |
@@ -268,6 +268,7 @@ export function buildMonitorFromYaml( | |||
enabled: config.enabled ?? options.enabled, | |||
locations: options.locations, | |||
tags: options.tags, | |||
labels: parseLabels(config, options.labels), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this new field to some of the unit tests validating lightweight monitors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have added here 200e52f
(#959)
@@ -255,6 +255,7 @@ export type PushOptions = Partial<ProjectSettings> & | |||
kibanaVersion?: string; | |||
yes?: boolean; | |||
tags?: Array<string>; | |||
labels?: Record<string, string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this to fields to map with the heartbeat top level fields name and under the hood in Kibana, you can map to labels. Having labels as top level is confusing - https://www.elastic.co/guide/en/beats/heartbeat/8.12/configuration-general-options.html#libbeat-configuration-fields
Also let's write JS doc annotation so it's visible on TS config.
@@ -472,6 +472,50 @@ heartbeat.monitors: | |||
hosts: ['elastic.co:443'], | |||
}); | |||
}); | |||
|
|||
it('supports labels in config', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add test for browser monitor as well.
Allows the ability to add meta via labels.* fields
fixes #729 !!
This will only work with kibana 8.16.0 with PR elastic/kibana#193250 !!
lightweight