github.com/hyperledger/fabric-ca@v2.0.0-alpha.0.20201120210307-7b4f34729db1+incompatible/docs/source/metrics_reference.rst (about) 1 Metrics Reference 2 ================= 3 4 Metrics exposed by the Fabric CA include *labels* to differentiate various 5 characteristics of the item being measured. Five different labels are used. 6 7 api_name 8 For API requests, this is the path of the requested resource with the version 9 prefix removed. The list of resource paths can be found in the 10 `Swagger API Documentation <https://github.com/hyperledger/fabric-ca/blob/master/swagger/swagger-fabric-ca.json>`_. 11 Examples include ``cainfo``, register``, and ``enroll``. 12 13 ca_name 14 The name of the certificate authority associated with the metric. 15 16 db_api_name 17 For database requests, this contains the SQL operation that was used. 18 Examples include ``Commit``, ``Exec``, ``Get``, ``NamedExec``, ``Select``, 19 and ``Queryx`` 20 21 func_name 22 For database access, this includes the name of the function that initiated 23 the database request. Examples include ``GetUser``, ``InsertUser``, 24 ``LoginComplete``, and ``ResetIncorrectLoginAttempts``. 25 26 status_code 27 For API requests, this is the HTTP status code of the response. Successful 28 requests will have status codes that are less than 400. 29 30 Prometheus Metrics 31 ------------------ 32 33 The following metrics are currently exported for consumption by Prometheus. 34 35 +-------------------------+-----------+------------------------------------------------------------+--------------------+ 36 | Name | Type | Description | Labels | 37 +=========================+===========+============================================================+====================+ 38 | api_request_count | counter | Number of requests made to an API | ca_name | 39 | | | | api_name | 40 | | | | status_code | 41 +-------------------------+-----------+------------------------------------------------------------+--------------------+ 42 | api_request_duration | histogram | Time taken in seconds for the request to an API to be | ca_name | 43 | | | completed | api_name | 44 | | | | status_code | 45 +-------------------------+-----------+------------------------------------------------------------+--------------------+ 46 | db_api_request_count | counter | Number of requests made to a database API | ca_name | 47 | | | | func_name | 48 | | | | dbapi_name | 49 +-------------------------+-----------+------------------------------------------------------------+--------------------+ 50 | db_api_request_duration | histogram | Time taken in seconds for the request to a database API to | ca_name | 51 | | | be completed | func_name | 52 | | | | dbapi_name | 53 +-------------------------+-----------+------------------------------------------------------------+--------------------+ 54 55 56 StatsD Metrics 57 -------------- 58 59 The following metrics are currently emitted for consumption by StatsD. The 60 ``%{label_name}`` nomenclature indicates the location of a label value in the 61 bucket name. 62 63 +---------------------------------------------------------------+-----------+------------------------------------------------------------+ 64 | Bucket | Type | Description | 65 +===============================================================+===========+============================================================+ 66 | api_request.count.%{ca_name}.%{api_name}.%{status_code} | counter | Number of requests made to an API | 67 +---------------------------------------------------------------+-----------+------------------------------------------------------------+ 68 | api_request.duration.%{ca_name}.%{api_name}.%{status_code} | histogram | Time taken in seconds for the request to an API to be | 69 | | | completed | 70 +---------------------------------------------------------------+-----------+------------------------------------------------------------+ 71 | db_api_request.count.%{ca_name}.%{func_name}.%{dbapi_name} | counter | Number of requests made to a database API | 72 +---------------------------------------------------------------+-----------+------------------------------------------------------------+ 73 | db_api_request.duration.%{ca_name}.%{func_name}.%{dbapi_name} | histogram | Time taken in seconds for the request to a database API to | 74 | | | be completed | 75 +---------------------------------------------------------------+-----------+------------------------------------------------------------+ 76 77 78 .. Licensed under Creative Commons Attribution 4.0 International License 79 https://creativecommons.org/licenses/by/4.0/