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
Copy file name to clipboardexpand all lines: documentation/docs/tutorials/monitoring_opal.mdx
-116
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,6 @@ There are multiple ways you can monitor your OPAL deployment:
11
11
-**Health-checks** - OPAL exposes HTTP health check endpoints ([See below](##health-checks))
12
12
-[**Callbacks**](/tutorials/healthcheck_policy_and_update_callbacks#-data-update-callbacks) - Using the callback webhooks feature - having OPAL-clients report their updates
13
13
-**Statistics** - Using the built-in statistics feature in OPAL ([See below](##opal-statistics))
14
-
-**OpenTelemetry Metrics and Tracing** - OPAL can expose metrics and tracing information using OpenTelemetry for monitoring ([See below](#opentelemetry-metrics-and-tracing)).
15
14
16
15
## Health checks
17
16
@@ -53,118 +52,3 @@ Available through `/pubsub_client_info` api route on the server.
53
52
### Caveats:
54
53
- When `UVICORN_NUM_WORKERS > 1`, retrieved information would only include clients connected to the replying server process.
55
54
- This is an early access feature and is likely to change. Backward compatibility is not garaunteed.
56
-
57
-
## OpenTelemetry Metrics and Tracing
58
-
59
-
OPAL supports exporting metrics and tracing information using OpenTelemetry, which can be integrated with various monitoring and observability tools.
60
-
61
-
### Enabling OpenTelemetry Metrics and Tracing
62
-
63
-
To enable OpenTelemetry metrics and tracing, you need to set the following environment variables in both OPAL server and OPAL client:
- OPAL_ENABLE_OPENTELEMETRY_TRACING: Set to `true` to enable tracing.
72
-
- OPAL_ENABLE_OPENTELEMETRY_METRICS: Set to `true` to enable metrics.
73
-
- OPAL_OPENTELEMETRY_OTLP_ENDPOINT: Set the endpoint for the OpenTelemetry Collector
74
-
75
-
### Exposing Metrics and Traces
76
-
77
-
- Both the server and client will expose a `/metrics` endpoint that returns metrics in Prometheus format.
78
-
- Traces are exported to the configured OpenTelemetry Collector endpoint using OTLP over gRPC.
79
-
80
-
### Available Metrics and Traces
81
-
82
-
Below is a list of the available metrics and traces in OPAL, along with their types, available tags (attributes), and explanations.
83
-
84
-
#### OPAL Server Metrics and Traces
85
-
86
-
##### 1) `opal_server_data_update`
87
-
-**Type**: Trace
88
-
-**Description**: Represents a data update operation in the OPAL server. This trace spans the process of publishing data updates to clients.
89
-
-**Attributes**:
90
-
-`topics_count`: Number of topics involved in the data update.
91
-
-`entries_count`: Number of data update entries.
92
-
- Additional attributes related to errors or execution time.
93
-
94
-
##### 2) `opal_server_policy_update`
95
-
-**Type**: Trace
96
-
-**Description**: Represents a policy update operation in the OPAL server. This trace spans the process of checking for policy changes and notifying clients.
97
-
-**Attributes**:
98
-
- Information about the policy repository, such as commit hashes.
99
-
- Errors encountered during the update process.
100
-
101
-
##### 3) `opal_server_policy_bundle_request`
102
-
-**Type**: Trace
103
-
-**Description**: Represents a request for a policy bundle from a client. This trace spans the process of generating and serving the policy bundle to the client.
104
-
-**Attributes**:
105
-
-`bundle.type`: The type of bundle (full or diff).
106
-
-`bundle.size`: The size of the bundle in number of files or bytes.
107
-
-`scope_id`: The scope identifier if scopes are used.
108
-
109
-
##### 4) `opal_server_policy_bundle_size`
110
-
-**Type**: Metric (Histogram)
111
-
-**Unit**: Files
112
-
-**Description**: Records the size of the policy bundles served by the OPAL server. The size is measured in the number of files included in the bundle.
113
-
-**Attributes**:
114
-
-`type`: The type of bundle (full or diff).
115
-
116
-
##### 5) `opal_server_active_clients`
117
-
-**Type**: Metric (UpDownCounter)
118
-
-**Description**: Tracks the number of active clients connected to the OPAL server.
119
-
-**Attributes**:
120
-
-`client_id`: The unique identifier of the client.
121
-
-`source`: The source host and port of the client (e.g., 192.168.1.10:34567).
122
-
123
-
#### OPAL Client Metrics and Traces
124
-
125
-
##### 1) `opal_client_data_subscriptions`
126
-
-**Type**: Metric (UpDownCounter)
127
-
-**Description**: Tracks the number of data subscriptions per client.
128
-
-**Attributes**:
129
-
-`client_id`: The unique identifier of the client.
130
-
-`topic`: The topic to which the client is subscribed.
131
-
132
-
##### 2) `opal_client_data_update_trigger`
133
-
-**Type**: Trace
134
-
-**Description**: Represents the operation of triggering a data update via the API in the OPAL client.
135
-
-**Attributes**:
136
-
-`source`: The source of the trigger (e.g., API).
137
-
- Errors encountered during the trigger.
138
-
139
-
##### 3) `opal_client_data_update_apply`
140
-
-**Type**: Trace
141
-
-**Description**: Represents the application of a data update within the OPAL client. This trace spans the process of fetching and applying data updates from the server.
142
-
-**Attributes**:
143
-
- Execution time.
144
-
- Errors encountered during the update.
145
-
146
-
##### 4) `opal_client_policy_update_apply`
147
-
-**Type**: Trace
148
-
-**Description**: Represents the application of a policy update within the OPAL client. This trace spans the process of fetching and applying policy updates from the server.
149
-
-**Attributes**:
150
-
- Execution time.
151
-
- Errors encountered during the update.
152
-
153
-
##### 5) `opal_client_policy_store_status`
154
-
-**Type**: Metric (Observable Gauge)
155
-
-**Description**: Indicates the current status of the policy store's authentication type used by the OPAL client.
156
-
-**Attributes**:
157
-
-`auth_type`: The authentication type configured for the policy store (e.g., TOKEN, OAUTH, NONE).
158
-
-**Value**: The metric has a value of 1 when the policy store is active with the specified authentication type.
159
-
160
-
### Example
161
-
162
-
To monitor OPAL using Prometheus and Grafana, a ready-to-use Docker Compose configuration is provided in the root directory of the repository under docker. The file is named docker-compose-with-prometheus-and-otel.yml.
163
-
164
-
Run the following command to start Prometheus and Grafana:
165
-
166
-
```
167
-
docker compose -f docker/docker-compose-with-prometheus-and-otel.yml up
168
-
```
169
-
170
-
This setup will start Prometheus to scrape metrics from OPAL server and client, and Grafana to visualize the metrics.
0 commit comments