@@ -54,23 +54,6 @@ After you've verified that the dashboard is loading you'll probably want to rest
54
54
dashboard via authentication, either with a [ custom resolver's] [ ac ] access controls or [ Basic
55
55
Auth] [ ba ] .
56
56
57
- ### Retention period for metrics
58
-
59
- The Observer Web can monitor Beam VM metrics by default, using ETS tables to store the data.
60
- However, this means that the data is not persisted across restarts. The retention period
61
- for this data can be configured.
62
-
63
- By default, without a retention time set, the metrics will only show data received during the
64
- current session. If you'd like to persist this data for a longer period, you can configure
65
- a retention time.
66
-
67
- To configure the retention period, use the following optional setting:
68
-
69
- ``` elixir
70
- config :observer_web , ObserverWeb .Telemetry ,
71
- data_retention_period: :timer .minutes (5 )
72
- ```
73
-
74
57
### Embedding Observer Web in your app page
75
58
76
59
In some cases, you may prefer to run the Observer in the same page as your app rather than in
@@ -139,6 +122,81 @@ path `/observer"`. However, using the iframe approach allows you to display
139
122
your application's information alongside the Observer in your main page,
140
123
providing a more integrated monitoring experience.
141
124
125
+ ### Metrics
126
+
127
+ #### Retention period for metrics
128
+
129
+ Observer Web can monitor Beam VM metrics (along with many others) and uses ETS
130
+ tables to store the data and there is a possibility of configuration for the retention
131
+ period while the application is running.
132
+
133
+ By default, without a retention time set, the metrics will only show data received during the
134
+ current session. If you'd like to persist this data for a longer period, you can configure
135
+ a retention time.
136
+
137
+ To configure the retention period, use the following optional setting:
138
+
139
+ ``` elixir
140
+ config :observer_web , ObserverWeb .Telemetry ,
141
+ data_retention_period: :timer .minutes (30 )
142
+ ```
143
+
144
+ > #### Persistence Across Restarts {: .attention}
145
+ >
146
+ > Please note that data is not persisted across application restarts. For persistent
147
+ > storage, refer to the Configuration section to set up a Central Hub application,
148
+ > which can aggregate and retain metrics.
149
+
150
+ #### Configuration
151
+
152
+ Observer Web can operate in two distinct metrics configurations: ` Standalone ` and ` Metric Hub ` .
153
+ These configurations determine how metrics are collected, stored, and managed.
154
+
155
+ #### Standalone Configuration (default)
156
+
157
+ In this mode, all applications with Observer Web installed operate independently. Each
158
+ application receives and stores its own metrics within its ETS tables. The image below
159
+ illustrates this configuration:
160
+
161
+ ![ Standalone Mode] ( ./static/standalone.png )
162
+
163
+ __ ** NOTE: No additional configuration is required for this mode** __
164
+
165
+ #### Metric Hub Configuration
166
+
167
+ In this mode, one application is designated as the central hub to store all metrics,
168
+ while the remaining applications broadcast their data to this designated hub. This
169
+ configuration is ideal for scenarios where you have a dedicated application for monitoring
170
+ or deployment, such as [ DeployEx] [ dye ] . Additionally, this setup ensures that metrics
171
+ are retained even if any of the monitored applications restart.
172
+
173
+ ![ Metric Hub Mode] ( ./static/metric_hub.png )
174
+
175
+ To configure applications to broadcast their metrics, use the following setting:
176
+
177
+ ``` elixir
178
+ config :observer_web , ObserverWeb .Telemetry ,
179
+ mode: :broadcast
180
+ ```
181
+
182
+ > #### Disable Endpoint for Broadcast applications {: .attention}
183
+ >
184
+ > In this mode, since there is a centralized application dedicated to capturing metrics,
185
+ > we recommend disabling the ` /observer ` endpoint on all applications configured in
186
+ > ** broadcast** mode. Only the ** central observer (hub)** should expose the ` /observer ` endpoint
187
+ > to avoid redundancy and ensure efficient metric collection.
188
+
189
+ To designate an application as the ** central observer (hub)** , use the following setting:
190
+
191
+ ``` elixir
192
+ config :observer_web , ObserverWeb .Telemetry ,
193
+ mode: :observer ,
194
+ data_retention_period: :timer .minutes (30 )
195
+ ```
196
+
197
+ The application in ` observer mode ` will also retain its own metrics in addition to
198
+ aggregating metrics from other applications.
199
+
142
200
### Usage with Web and Clustering
143
201
144
202
The Observer Web provides observer ability for the local application as well as any other that is
@@ -158,3 +216,4 @@ via OTP distribution!
158
216
[ ac ] : Observer.Web.Resolver.html#c:resolve_access/1
159
217
[ ba ] : https://hexdocs.pm/basic_auth/readme.html
160
218
[ oi ] : installation.html
219
+ [ dye ] : https://github.com/thiagoesteves/deployex
0 commit comments