|
1 | 1 | --- |
2 | 2 | sidebar_label: Prometheus |
3 | 3 | --- |
| 4 | +<!--- |
| 5 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 6 | + contributor license agreements. See the NOTICE file distributed with |
| 7 | + this work for additional information regarding copyright ownership. |
| 8 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 9 | + (the "License"); you may not use this file except in compliance with |
| 10 | + the License. You may obtain a copy of the License at |
| 11 | +
|
| 12 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +
|
| 14 | + Unless required by applicable law or agreed to in writing, software |
| 15 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | + See the License for the specific language governing permissions and |
| 18 | + limitations under the License. |
| 19 | +--> |
4 | 20 |
|
5 | 21 | # Tracking Metrics With Prometheus |
6 | 22 |
|
7 | | -**TODO:** File a subtask under [HDDS-9859](https://issues.apache.org/jira/browse/HDDS-9859) and complete this page or section. |
| 23 | +Ozone has native support for Prometheus integration. All internal metrics (collected by Hadoop metrics framework) are published under the `/prom` HTTP endpoint. (For example under http://localhost:9876/prom for SCM). |
| 24 | + |
| 25 | +The Prometheus endpoint is turned on by default but can be turned off by the `hdds.prometheus.endpoint.enabled` configuration variable. |
| 26 | + |
| 27 | +In a secure environment the page is guarded with SPNEGO authentication which is not supported by Prometheus. To enable monitoring in a secure environment, a specific authentication token can be configured |
| 28 | + |
| 29 | +Example `ozone-site.xml`: |
| 30 | + |
| 31 | +```XML |
| 32 | +<property> |
| 33 | + <name>hdds.prometheus.endpoint.token</name> |
| 34 | + <value>putyourtokenhere</value> |
| 35 | +</property> |
| 36 | +``` |
| 37 | + |
| 38 | +Example prometheus configuration: |
| 39 | + |
| 40 | +```YAML |
| 41 | +scrape_configs: |
| 42 | + - job_name: ozone |
| 43 | + bearer_token: <putyourtokenhere> |
| 44 | + metrics_path: /prom |
| 45 | + static_configs: |
| 46 | + - targets: |
| 47 | + - "127.0.0.1:9876" |
| 48 | +``` |
0 commit comments