Skip to content

Commit 51c529b

Browse files
committed
groom README
1 parent 13283d1 commit 51c529b

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ To run linters, run `make lint`.
1919

2020
To run tests, run `make test`.
2121

22-
### Usage
22+
## Usage
2323

24-
#### Installation
24+
### Installation
2525

2626
1. Install all runtime packages: `uv add flagsmith-common[common-core,task-processor]`
2727

@@ -30,16 +30,16 @@ To run tests, run `make test`.
3030
3. Make sure `"common.core"` is in the `INSTALLED_APPS` of your settings module.
3131
This enables the `manage.py flagsmith` commands.
3232

33-
1. Add `"common.gunicorn.middleware.RouteLoggerMiddleware"` to `MIDDLEWARE` in your settings module.
33+
4. Add `"common.gunicorn.middleware.RouteLoggerMiddleware"` to `MIDDLEWARE` in your settings module.
3434
This enables the `route` label for Prometheus HTTP metrics.
3535

36-
1. To enable the `/metrics` endpoint, set the `PROMETHEUS_ENABLED` setting to `True`.
36+
5. To enable the `/metrics` endpoint, set the `PROMETHEUS_ENABLED` setting to `True`.
3737

38-
#### Test tools
38+
### Test tools
3939

40-
##### Fixtures
40+
#### Fixtures
4141

42-
###### `assert_metric`
42+
##### `assert_metric`
4343

4444
To test your metrics using the `assert_metric` fixture:
4545

@@ -58,44 +58,44 @@ def test_my_code__expected_metrics(assert_metric: AssertMetricFixture) -> None:
5858
)
5959
```
6060

61-
###### `saas_mode`
61+
##### `saas_mode`
6262

6363
The `saas_mode` fixture makes all `common.core.utils.is_saas` calls return `True`.
6464

65-
###### `enterprise_mode`
65+
##### `enterprise_mode`
6666

6767
The `enterprise_mode` fixture makes all `common.core.utils.is_enterprise` calls return `True`.
6868

69-
##### Markers
69+
#### Markers
7070

71-
###### `pytest.mark.saas_mode`
71+
##### `pytest.mark.saas_mode`
7272

7373
Use this mark to auto-use the `saas_mode` fixture.
7474

75-
###### `pytest.mark.enterprise_mode`
75+
##### `pytest.mark.enterprise_mode`
7676

7777
Use this mark to auto-use the `enterprise_mode` fixture.
7878

79-
#### Metrics
79+
### Metrics
8080

8181
Flagsmith uses Prometheus to track performance metrics.
8282

8383
The following default metrics are exposed:
8484

85-
##### Common metrics
85+
#### Common metrics
8686

8787
- `flagsmith_build_info`: Has the labels `version` and `ci_commit_sha`.
8888
- `flagsmith_http_server_request_duration_seconds`: Histogram labeled with `method`, `route`, and `response_status`.
8989
- `flagsmith_http_server_requests_total`: Counter labeled with `method`, `route`, and `response_status`.
90-
- `flagsmith_http_server_response_size_bytes`:Histogram labeled with `method`, `route`, and `response_status`.
90+
- `flagsmith_http_server_response_size_bytes`: Histogram labeled with `method`, `route`, and `response_status`.
9191
- `flagsmith_task_processor_enqueued_tasks_total`: Counter labeled with `task_identifier`.
9292

93-
##### Task Processor metrics
93+
#### Task Processor metrics
9494

9595
- `flagsmith_task_processor_finished_tasks_total`: Counter labeled with `task_identifier`, `task_type` (`"recurring"`, `"standard"`) and `result` (`"success"`, `"failure"`).
9696
- `flagsmith_task_processor_task_duration_seconds`: Histogram labeled with `task_identifier`, `task_type` (`"recurring"`, `"standard"`) and `result` (`"success"`, `"failure"`).
9797

98-
##### Guidelines
98+
#### Guidelines
9999

100100
Try to come up with meaningful metrics to cover your feature with when developing it. Refer to [Prometheus best practices][1] when naming your metric and labels.
101101

0 commit comments

Comments
 (0)