Skip to content

[Synthetics] Add Browser data streams#1064

Merged
dominiqueclarke merged 20 commits intoelastic:masterfrom
dominiqueclarke:feature/216-synthetics-browser
Aug 23, 2021
Merged

[Synthetics] Add Browser data streams#1064
dominiqueclarke merged 20 commits intoelastic:masterfrom
dominiqueclarke:feature/216-synthetics-browser

Conversation

@dominiqueclarke
Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke commented Jun 1, 2021

Relates to elastic/uptime#219

Type of change

  • Enhancement

What does this PR do?

This PR adds the browser, browser_screenshot, and browser_network data streams to the synthetics package.

This PR is a draft state.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs or synthetics.
  • I have added an entry to my package's changelog.yml file.
  • If I'm introducing a new feature, I have modified the Kibana version constraint in my package's manifest.yml file to point to the latest Elastic stack release (e.g. ^7.13.0). (Note: Even though this PR introduces a new feature, I have opted out of increasing the stack release constraint, as this version is compatible with 7.14 as it is additive).

@dominiqueclarke dominiqueclarke marked this pull request as draft June 1, 2021 20:56
@dominiqueclarke dominiqueclarke added the Team:obs-ux-infra_services Obs UX: Infra & Services team [elastic/obs-ux-infra_services-team] label Jun 1, 2021
@dominiqueclarke dominiqueclarke changed the title Feature/216 synthetics browser [Synthetics] Add Browser data streams Jun 1, 2021
@elasticmachine
Copy link
Copy Markdown

elasticmachine commented Jun 1, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-23T13:30:30.575+0000

  • Duration: 16 min 21 sec

  • Commit: 53b9266

Test stats 🧪

Test Results
Failed 0
Passed 6
Skipped 0
Total 6

Trends 🧪

Image of Build Times

Image of Tests

andrewvc added a commit to elastic/beats that referenced this pull request Aug 11, 2021
#27052)

Creates a new offline tagged docker image that includes the dependencies required for synthetics. Building elastic-agent docker images will now create additional -offline tagged images with these extras. We may need to do additional work to ensure that these additional images are incorporated into the release process and onto the public website.

These changes also set the ELASTIC_SYNTHETICS_CAPABLE env flag, as done in heartbeat, to enable synthetics features in the docker environment. This dovetails with the work @dominiqueclarke is doing in elastic/integrations#1064 and elsewhere

Fixes #22932
mergify bot pushed a commit to elastic/beats that referenced this pull request Aug 11, 2021
#27052)

Creates a new offline tagged docker image that includes the dependencies required for synthetics. Building elastic-agent docker images will now create additional -offline tagged images with these extras. We may need to do additional work to ensure that these additional images are incorporated into the release process and onto the public website.

These changes also set the ELASTIC_SYNTHETICS_CAPABLE env flag, as done in heartbeat, to enable synthetics features in the docker environment. This dovetails with the work @dominiqueclarke is doing in elastic/integrations#1064 and elsewhere

Fixes #22932

(cherry picked from commit 4727470)
andrewvc added a commit to elastic/beats that referenced this pull request Aug 16, 2021
#27052) (#27324)

Creates a new offline tagged docker image that includes the dependencies required for synthetics. Building elastic-agent docker images will now create additional -offline tagged images with these extras. We may need to do additional work to ensure that these additional images are incorporated into the release process and onto the public website.

These changes also set the ELASTIC_SYNTHETICS_CAPABLE env flag, as done in heartbeat, to enable synthetics features in the docker environment. This dovetails with the work @dominiqueclarke is doing in elastic/integrations#1064 and elsewhere

Fixes #22932

(cherry picked from commit 4727470)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@dominiqueclarke dominiqueclarke added v7.15.0 enhancement New feature or request labels Aug 17, 2021
@dominiqueclarke dominiqueclarke requested a review from a team August 17, 2021 13:52
@dominiqueclarke dominiqueclarke marked this pull request as ready for review August 17, 2021 14:00
@elasticmachine
Copy link
Copy Markdown

Pinging @elastic/uptime (Team:Uptime)

{{#if tags}}
tags: {{tags}}
{{/if}}
{{#if source.zip_url.username}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that the various fields for zip_url are all specifically enumerated. Is it easier just to say zip_url takes a JSON blob and leave it to the Kibana UI code to put the right fields in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea. I love it. I think it'll provide a lot more flexibility to add new nested keys to the UI without having to do a corresponding change on the integrations package side.

However, the UI is not currently set up to support this. Each field receives a key corresponding to the correct parameter, resulting in the UI in a large object with with all the field names, using dot notation for the nested fields, and the field values. So we have an object that looks like

{
    'source.zip_url.username': 'username',
    'source.zip_url.password': 'password'
}

Fleet exposes an integration policy object that represents the policy values. It looks something like

{
    'source.zip_url.username': {
          value: '',
          type: 'text,
     },
    'source.zip_url.password': {
          value: '',
          type: 'text,
     }
}

We iterate over the first object's keys and assign values to the exposed fleet policy.
https://github.com/elastic/kibana/blob/master/x-pack/plugins/uptime/public/components/fleet_package/use_update_policy.ts#L62
Which ends up looking something like

dataStream.vars['source.zip_url.username'].value = ourConfig.source.zip_url.username;

So the UI doesn't currently support nested keys. It is a flattened object.

To do this properly, we should convert all of the fields in http, tcp, icmp, and browser to only expose their top level params and allow the UI to handle nested params.

We can then transform our flatted object into a nested object, and use those values to populate nested fields.

I don't think that'll make it in for 7.15, but sounds like it could be a useful refactor for 7.16. Thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Let's keep it the way it is now and reevaluate going forward

@@ -0,0 +1,39 @@
- name: tls
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can nix this file for screenshots

@@ -0,0 +1,30 @@
- name: tcp
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can nix this file for screenshots

@@ -0,0 +1,18 @@
- name: resolve
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can nix this file for screenshots

@@ -0,0 +1,91 @@
- name: http
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can nix this file for screenshots

mergify bot pushed a commit to elastic/beats that referenced this pull request Aug 18, 2021
#27052)

Creates a new offline tagged docker image that includes the dependencies required for synthetics. Building elastic-agent docker images will now create additional -offline tagged images with these extras. We may need to do additional work to ensure that these additional images are incorporated into the release process and onto the public website.

These changes also set the ELASTIC_SYNTHETICS_CAPABLE env flag, as done in heartbeat, to enable synthetics features in the docker environment. This dovetails with the work @dominiqueclarke is doing in elastic/integrations#1064 and elsewhere

Fixes #22932

(cherry picked from commit 4727470)

# Conflicts:
#	dev-tools/mage/dockerbuilder.go
mergify bot added a commit to elastic/beats that referenced this pull request Aug 18, 2021
#27052) (#27324)

Creates a new offline tagged docker image that includes the dependencies required for synthetics. Building elastic-agent docker images will now create additional -offline tagged images with these extras. We may need to do additional work to ensure that these additional images are incorporated into the release process and onto the public website.

These changes also set the ELASTIC_SYNTHETICS_CAPABLE env flag, as done in heartbeat, to enable synthetics features in the docker environment. This dovetails with the work @dominiqueclarke is doing in elastic/integrations#1064 and elsewhere

Fixes #22932

(cherry picked from commit 4727470)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit f9b2610)

# Conflicts:
#	dev-tools/mage/dockerbuilder.go
Copy link
Copy Markdown
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Team:obs-ux-infra_services Obs UX: Infra & Services team [elastic/obs-ux-infra_services-team] v7.15.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants