Skip to content

Commit 13155b2

Browse files
committed
add synthetics manage on private networks
1 parent 376b011 commit 13155b2

File tree

1 file changed

+109
-11
lines changed

1 file changed

+109
-11
lines changed

solutions/observability/apps/monitor-resources-on-private-networks.md

Lines changed: 109 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,121 @@ mapped_urls:
44
- https://www.elastic.co/guide/en/serverless/current/observability-synthetics-private-location.html
55
---
66

7-
# Monitor resources on private networks
7+
# Monitor resources on private networks [synthetics-private-location]
88

9-
% What needs to be done: Align serverless/stateful
9+
To monitor resources on private networks you can either:
1010

11-
% Use migrated content from existing pages that map to this page:
11+
* Allow Elastic’s global managed infrastructure to access your private endpoints.
12+
* Use {{agent}} to create a {{private-location}}.
1213

13-
% - [ ] ./raw-migrated-files/observability-docs/observability/synthetics-private-location.md
14-
% - [ ] ./raw-migrated-files/docs-content/serverless/observability-synthetics-private-location.md
14+
{{private-location}}s via Elastic Agent require only outbound connections from your network, while allowing Elastic’s global managed infrastructure to access a private endpoint requires inbound access, thus posing an additional risk that users must assess.
1515

16-
% Internal links rely on the following IDs being on this page (e.g. as a heading ID, paragraph ID, etc):
1716

18-
$$$synthetics-private-location-fleet-agent$$$
17+
## Allow access to your private network [monitor-via-access-control]
1918

20-
$$$synthetics-private-location-connect$$$
19+
To give Elastic’s global managed infrastructure access to a private endpoint, use IP address filtering, HTTP authentication, or both.
2120

22-
$$$synthetics-private-location-add$$$
21+
To grant access via IP, use [this list of egress IPs](https://manifest.synthetics.elastic-cloud.com/v1/ip-ranges.json). The addresses and locations on this list may change, so automating updates to filtering rules is recommended. IP filtering alone will allow all users of Elastic’s global managed infrastructure access to your endpoints, if this is a concern consider adding additional protection via user/password authentication via a proxy like nginx.
2322

24-
$$$synthetics-private-location-scaling$$$
2523

26-
$$$monitor-via-private-agent$$$
24+
## Monitor via a private agent [monitor-via-private-agent]
25+
26+
{{private-location}}s allow you to run monitors from your own premises. Before running a monitor on a {{private-location}}, you’ll need to:
27+
28+
* [Set up {{fleet-server}} and {{agent}}](../../../solutions/observability/apps/monitor-resources-on-private-networks.md#synthetics-private-location-fleet-agent).
29+
* [Connect {{fleet}} to the {{stack}}](../../../solutions/observability/apps/monitor-resources-on-private-networks.md#synthetics-private-location-connect) and enroll an {{agent}} in {{fleet}}.
30+
* [Add a {{private-location}}](../../../solutions/observability/apps/monitor-resources-on-private-networks.md#synthetics-private-location-add) in the Synthetics UI.
31+
32+
::::{important}
33+
{{private-location}}s running through {{agent}} must have a direct connection to {{es}}. Do not configure any ingest pipelines, or output via Logstash as this will prevent Synthetics from working properly and is not [supported](../../../solutions/observability/apps/synthetics-support-matrix.md).
34+
35+
::::
36+
37+
38+
## Set up {{fleet-server}} and {{agent}} [synthetics-private-location-fleet-agent]
39+
40+
Start by setting up {{fleet-server}} and {{agent}}:
41+
42+
* **Set up {{fleet-server}}**: If you are using {{ecloud}}, {{fleet-server}} will already be provided and you can skip this step. To learn more, refer to [Set up {{fleet-server}}](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
43+
* **Create an agent policy**: For more information on agent policies and creating them, refer to [{{agent}} policy](https://www.elastic.co/guide/en/fleet/current/agent-policy.html#create-a-policy).
44+
45+
::::{important}
46+
A {{private-location}} should be set up against an agent policy that runs on a single {{agent}}. The {{agent}} must be **enrolled in Fleet** ({{private-location}}s cannot be set up using **standalone** {{agents}}). Do *not* run the same agent policy on multiple agents being used for {{private-location}}s, as you may end up with duplicate or missing tests. {{private-location}}s do not currently load balance tests across multiple {{agents}}. See [Scaling {{private-location}}s](../../../solutions/observability/apps/monitor-resources-on-private-networks.md#synthetics-private-location-scaling) for information on increasing the capacity within a {{private-location}}.
47+
48+
By default {{private-location}}s are configured to allow two simultaneous browser tests and an unlimited number of lightweight checks. As a result, if more than two browser tests are assigned to a particular {{private-location}}, there may be a delay to run them.
49+
50+
::::
51+
52+
53+
## Connect to the {{stack}} or your Observability serverless project [synthetics-private-location-connect]
54+
55+
After setting up {{fleet}}, you’ll connect {{fleet}} to the {{stack}} or your Observability serverless project and enroll an {{agent}} in {{fleet}}.
56+
57+
Elastic provides Docker images that you can use to run {{fleet}} and an {{agent}} more easily. For monitors running on {{private-location}}s, you *must* use the `elastic-agent-complete` Docker image to create a self-hosted {{agent}} node. The standard {{ecloud}} or self-hosted {{agent}} will not work.
58+
59+
::::{important}
60+
The `elastic-agent-complete` Docker image is the only way to have all available options that you see in the UI.
61+
62+
::::
63+
64+
65+
To pull the Docker image run:
66+
67+
```sh
68+
docker pull docker.elastic.co/elastic-agent/elastic-agent-complete:8.16.1
69+
```
70+
71+
Then enroll and run an {{agent}}. You’ll need an enrollment token and the URL of the {{fleet-server}}. You can use the default enrollment token for your policy or create new policies and [enrollment tokens](https://www.elastic.co/guide/en/fleet/current/fleet-enrollment-tokens.html) as needed.
72+
73+
For more information on running {{agent}} with Docker, refer to [Run {{agent}} in a container](https://www.elastic.co/guide/en/fleet/current/elastic-agent-container.html).
74+
75+
```sh
76+
docker run \
77+
--env FLEET_ENROLL=1 \
78+
--env FLEET_URL={fleet_server_host_url} \
79+
--env FLEET_ENROLLMENT_TOKEN={enrollment_token} \
80+
--cap-add=NET_RAW \
81+
--cap-add=SETUID \
82+
--rm docker.elastic.co/elastic-agent/elastic-agent-complete:8.16.1
83+
```
84+
85+
::::{important}
86+
The `elastic-agent-complete` Docker image requires additional capabilities to operate correctly. Ensure `NET_RAW` and `SETUID` are enabled on the container.
87+
88+
::::
89+
90+
91+
::::{note}
92+
You may need to set other environment variables. Learn how in [{{agent}} environment variables guide](https://www.elastic.co/guide/en/fleet/current/agent-environment-variables.html).
93+
94+
::::
95+
96+
97+
## Add a {{private-location}} [synthetics-private-location-add]
98+
99+
When the {{agent}} is running you can add a new {{private-location}} in the UI:
100+
101+
1. Find `Synthetics` in the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md).
102+
1. Go to **Settings**.
103+
2. Go to the **{{private-location}}s** tab.
104+
3. Click **Add location**.
105+
4. Give your new location a unique *Location name* and select the *Agent policy* you created above.
106+
5. Click **Save**.
107+
108+
::::{important}
109+
It is not currently possible to use custom CAs for synthetics browser tests in private locations without following a workaround. To learn more about the workaround, refer to the following GitHub issue: [elastic/synthetics#717](https://github.com/elastic/synthetics/issues/717).
110+
::::
111+
112+
113+
## Scaling {{private-location}}s [synthetics-private-location-scaling]
114+
115+
By default {{private-location}}s are configured to allow two simultaneous browser tests, and an unlimited number of lightweight checks. These limits can be set via the environment variables `SYNTHETICS_LIMIT_{{TYPE}}`, where `{{TYPE}}` is one of `BROWSER`, `HTTP`, `TCP`, and `ICMP` for the container running the {{agent}} docker image.
116+
117+
It is critical to allocate enough memory and CPU capacity to handle configured limits. Start by allocating at least 2 GiB of memory and two cores per browser instance to ensure consistent performance and avoid out-of-memory errors. Then adjust as needed. Resource requirements will vary depending on workload. Much less memory is needed for lightweight monitors. Start by allocating at least 512MiB of memory and two cores for lightweight checks. Then increase allocated memory and CPU based on observed usage patterns.
118+
119+
These limits are for simultaneous tests, not total tests. For example, if 60 browser tests were scheduled to run once per hour and each took 1 minute to run, that would fully occupy one execution slot. However, it is a good practice to set up execution slots with extra capacity. A good starting point would be to over-allocate by a factor of 5. In the previous example that would mean allocating 5 slots.
120+
121+
122+
## Next steps [synthetics-private-location-next]
123+
124+
Now you can add monitors to your {{private-location}} in [the Synthetics UI](../../../solutions/observability/apps/create-monitors-in-synthetics-app.md) or using the [Elastic Synthetics library’s `push` method](../../../solutions/observability/apps/create-monitors-with-project-monitors.md).

0 commit comments

Comments
 (0)