You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
environment variables in Synthetics run from Private locations (#3979)
Adding instructions for using environment variables in synthetics run
from Private Locations
---------
Co-authored-by: Mike Birnstiehl <[email protected]>
Co-authored-by: Benjamin Ironside Goldstein <[email protected]>
Copy file name to clipboardExpand all lines: solutions/observability/synthetics/work-with-params-secrets.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,8 @@ Params are viewable in plain-text by administrators and other users with `all` p
137
137
138
138
::::
139
139
140
+
### Use environment variables in Synthetics Projects
141
+
140
142
If you are managing monitors with a Synthetics project, you can use environment variables in your `synthetics.config.ts` or `synthetics.config.js` file.
141
143
142
144
The example below uses `process.env.MY_URL` to reference a variable named `MY_URL` defined in the environment and assigns its value to a param. That param can then be used in both lightweight and browser monitors that are managed in the Synthetics project:
@@ -148,3 +150,40 @@ export default {
148
150
}
149
151
};
150
152
```
153
+
154
+
### Use environment variables with Private Locations
155
+
156
+
If you are using Kibana-managed monitors and running them on a Private Location, you can inject environment variables directly into the agent's runtime environment.
157
+
This method allows you to keep sensitive values out of the {{kib}} UI. Instead, it stores those values on the infrastructure hosting the {{agent}}.
158
+
159
+
::::{warning}
160
+
These variables are accessible to all monitors running on this specific Private Location.
161
+
162
+
::::
163
+
164
+
#### 1. Pass variables to the Private Location
165
+
When starting your Private Location ({{agent}}) using Docker, use the `--env` flag to pass your variables.
0 commit comments