Skip to content

Commit ec95aef

Browse files
khvn26emyller
andauthored
docs(OTel): Add backend event catalogue (#7286)
Co-authored-by: Evandro Myller <22429+emyller@users.noreply.github.com>
1 parent 838c421 commit ec95aef

16 files changed

Lines changed: 303 additions & 28 deletions

File tree

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
/frontend/ @flagsmith/flagsmith-front-end
77
/infrastructure/ @flagsmith/flagsmith-infrastructure
88
/docs/ @flagsmith/flagsmith-docs
9+
10+
# Event changes are relevant to the product team
11+
/docs/docs/deployment-self-hosting/observability/_events-catalogue.md @flagsmith/flagsmith-product

api/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ integrate-private-tests:
164164

165165
.PHONY: generate-docs
166166
generate-docs: generate-flagsmith-sdk-openapi
167-
poetry run flagsmith docgen metrics > ../docs/docs/administration-and-security/platform-configuration/metrics.md
167+
poetry run flagsmith docgen metrics > ../docs/docs/deployment-self-hosting/observability/_metrics-catalogue.md
168+
poetry run flagsmith docgen events > ../docs/docs/deployment-self-hosting/observability/_events-catalogue.md
168169

169170
.PHONY: add-known-sdk-version
170171
add-known-sdk-version:

api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ We use the Given When Then structure in all our tests.
3535

3636
### Code guidelines: metrics
3737

38-
Flagsmith's backend exports Prometheus metrics. When planning a feature, consider which metrics should cover it — counters for domain events, histograms for latency or sizes, gauges for cardinalities. See [documentation for existing metrics](../docs/docs/administration-and-security/platform-configuration/metrics.md). Metrics code is hosted in `metrics.py` modules.
38+
The Flagsmith backend exports Prometheus metrics. When planning a feature, consider which metrics should cover it — counters for domain events, histograms for latency or sizes, gauges for cardinalities. See [documentation for existing metrics](https://docs.flagsmith.com/deployment-self-hosting/observability/metrics). Metrics code is hosted in `metrics.py` modules.
3939

4040
Name metrics `flagsmith_{domain}_{entity}_{unit}` and give them a comprehensive description.
4141

api/poetry.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pygithub = "~2.8"
178178
hubspot-api-client = "^12.0.0"
179179
djangorestframework-dataclasses = "^1.3.1"
180180
pyotp = "^2.9.0"
181-
flagsmith-common = { version = ">=3.5.0,<4", extras = [
181+
flagsmith-common = { version = ">=3.8.2,<4", extras = [
182182
"common-core",
183183
"flagsmith-schemas",
184184
"task-processor",

docs/docs/administration-and-security/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Configure environment-specific settings and platform-wide options for your Flags
149149
<div className="icon-container">
150150
<IonIcon icon={analytics} className="card-icon" />
151151
</div>
152-
<h3><Link to="/administration-and-security/platform-configuration/metrics">Platform Metrics</Link></h3>
152+
<h3><Link to="/deployment-self-hosting/observability/metrics">Platform Metrics</Link></h3>
153153
</div>
154154
<p>System monitoring and performance metrics</p>
155155
</Card>

docs/docs/deployment-self-hosting/core-configuration/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ relevant section below for more details.
5353
- `PREVENT_SIGNUP`: Determines whether to prevent new signups.
5454
- `ENABLE_EMAIL_ACTIVATION`: New user registration will go via email activation flow, default False.
5555
- `OTEL_EXPORTER_OTLP_ENDPOINT`: Base OTLP/HTTP endpoint (e.g. `http://collector:4318`). If unset, OTel is disabled. See
56-
[OpenTelemetry](/deployment-self-hosting/scaling-and-performance/opentelemetry).
56+
[OpenTelemetry](/deployment-self-hosting/observability/opentelemetry).
5757
- `OTEL_SERVICE_NAME`: The `service.name` resource attribute attached to all OTel telemetry. Defaults to
5858
`flagsmith-api`.
5959
- `OTEL_TRACING_EXCLUDED_URL_PATHS`: Comma-separated URL paths to exclude from OTel tracing (e.g.

docs/docs/deployment-self-hosting/index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,19 @@ Once deployed, you'll need to configure your Flagsmith instance:
5050
As your usage grows, you'll need to consider scaling and performance:
5151

5252
- **[Sizing and Scaling](/deployment-self-hosting/scaling-and-performance/sizing-and-scaling)**: Understand resource requirements and scaling strategies
53-
- **[Monitoring](/deployment-self-hosting/scaling-and-performance/monitoring)**: Set up monitoring and alerting for your deployment
5453
- **[Asynchronous Task Processor](/deployment-self-hosting/scaling-and-performance/asynchronous-task-processor)**: Configure background task processing
5554
- **[Using InfluxDB for Analytics](/deployment-self-hosting/scaling-and-performance/using-influxdb-for-analytics)**: Set up analytics storage
5655
- **[Load Testing](/deployment-self-hosting/scaling-and-performance/load-testing)**: Test your deployment under load
5756

57+
## Observability
58+
59+
Monitor the health and behaviour of your deployment:
60+
61+
- **[Monitoring](/deployment-self-hosting/observability/monitoring)**: Set up monitoring and alerting
62+
- **[Metrics](/deployment-self-hosting/observability/metrics)**: Prometheus metrics exported by the backend
63+
- **[Events](/deployment-self-hosting/observability/events)**: Structured events emitted by the backend
64+
- **[OpenTelemetry](/deployment-self-hosting/observability/opentelemetry)**: Export traces and logs via OTLP
65+
5866
## Administration and Maintenance
5967

6068
Ongoing administration tasks to keep your deployment running smoothly:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"label": "Observability",
3+
"position": 6,
4+
"collapsed": true
5+
}
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
2+
### `app_analytics.no_analytics_database_configured`
3+
4+
Logged at `warning` from:
5+
- `api/app_analytics/analytics_db_service.py:74`
6+
- `api/app_analytics/analytics_db_service.py:210`
7+
8+
Attributes:
9+
- `details`
10+
11+
### `code_references.cleanup_issues.created`
12+
13+
Logged at `info` from:
14+
- `api/integrations/github/views.py:388`
15+
16+
Attributes:
17+
- `issues_created.count`
18+
- `organisation.id`
19+
20+
### `code_references.scan.created`
21+
22+
Logged at `info` from:
23+
- `api/projects/code_references/views.py:41`
24+
25+
Attributes:
26+
- `code_references.count`
27+
- `feature.count`
28+
- `organisation.id`
29+
30+
### `dynamodb.environment_document_compressed`
31+
32+
Logged at `info` from:
33+
- `api/environments/dynamodb/wrappers/environment_wrapper.py:92`
34+
35+
Attributes:
36+
- `environment_api_key`
37+
- `environment_id`
38+
39+
### `feature_health.feature_health_event_dismissal_not_supported`
40+
41+
Logged at `warning` from:
42+
- `api/features/feature_health/services.py:127`
43+
44+
Attributes:
45+
- `feature_health_event_external_id`
46+
- `feature_health_event_id`
47+
- `feature_health_event_type`
48+
- `provider_name`
49+
50+
### `feature_health.feature_health_provider_error`
51+
52+
Logged at `error` from:
53+
- `api/features/feature_health/services.py:50`
54+
55+
Attributes:
56+
- `exc_info`
57+
- `provider_id`
58+
- `provider_name`
59+
60+
### `feature_health.invalid_feature_health_webhook_path_requested`
61+
62+
Logged at `warning` from:
63+
- `api/features/feature_health/providers/services.py:30`
64+
65+
Attributes:
66+
- `path`
67+
68+
### `gitlab.api_call.failed`
69+
70+
Logged at `error` from:
71+
- `api/integrations/gitlab/views/browse_gitlab.py:59`
72+
73+
Attributes:
74+
- `exc_info`
75+
- `organisation.id`
76+
- `project.id`
77+
78+
### `gitlab.configuration.created`
79+
80+
Logged at `info` from:
81+
- `api/integrations/gitlab/views/configuration.py:25`
82+
83+
Attributes:
84+
- `gitlab_instance_url`
85+
- `organisation.id`
86+
- `project.id`
87+
88+
### `gitlab.configuration.updated`
89+
90+
Logged at `info` from:
91+
- `api/integrations/gitlab/views/configuration.py:33`
92+
93+
Attributes:
94+
- `gitlab_instance_url`
95+
- `organisation.id`
96+
- `project.id`
97+
98+
### `launch_darkly.import_failed`
99+
100+
Logged at `exception` from:
101+
- `api/integrations/launch_darkly/tasks.py:36`
102+
103+
Attributes:
104+
- `import_request_id`
105+
- `ld_project_key`
106+
- `organisation_id`
107+
- `project_id`
108+
109+
### `launch_darkly.import_rate_limit_reached`
110+
111+
Logged at `warning` from:
112+
- `api/integrations/launch_darkly/tasks.py:26`
113+
114+
Attributes:
115+
- `error_message`
116+
- `import_request_id`
117+
- `ld_project_key`
118+
- `organisation_id`
119+
- `project_id`
120+
- `retry_at`
121+
122+
### `platform_hub.no_analytics_database_configured`
123+
124+
Logged at `warning` from:
125+
- `api/platform_hub/services.py:116`
126+
- `api/platform_hub/services.py:206`
127+
- `api/platform_hub/services.py:428`
128+
129+
Attributes:
130+
131+
### `segments.serializers.segment_revision_created`
132+
133+
Logged at `info` from:
134+
- `api/segments/serializers.py:141`
135+
136+
Attributes:
137+
- `revision_id`
138+
- `segment_id`
139+
140+
### `sentry_change_tracking.integration_error`
141+
142+
Logged at `warning` from:
143+
- `api/integrations/sentry/change_tracking.py:112`
144+
145+
Attributes:
146+
- `feature_name`
147+
- `sentry_action`
148+
- `sentry_response_body`
149+
- `sentry_response_status`
150+
151+
### `sentry_change_tracking.request_failure`
152+
153+
Logged at `warning` from:
154+
- `api/integrations/sentry/change_tracking.py:102`
155+
156+
Attributes:
157+
- `error`
158+
- `feature_name`
159+
- `sentry_action`
160+
161+
### `sentry_change_tracking.sending`
162+
163+
Logged at `debug` from:
164+
- `api/integrations/sentry/change_tracking.py:87`
165+
166+
Attributes:
167+
- `feature_name`
168+
- `headers`
169+
- `payload`
170+
- `sentry_action`
171+
- `url`
172+
173+
### `sentry_change_tracking.success`
174+
175+
Logged at `info` from:
176+
- `api/integrations/sentry/change_tracking.py:109`
177+
178+
Attributes:
179+
- `feature_name`
180+
- `sentry_action`
181+
182+
### `workflows.change_request.committed`
183+
184+
Logged at `info` from:
185+
- `api/core/workflows_services.py:39`
186+
187+
Attributes:
188+
- `environment.id`
189+
- `feature_states.count`
190+
- `organisation.id`
191+
192+
### `workflows.missing_live_segment`
193+
194+
Logged at `warning` from:
195+
- `api/core/workflows_services.py:114`
196+
197+
Attributes:
198+
- `draft_segment`
199+
200+
### `workflows.segment_revision_created`
201+
202+
Logged at `info` from:
203+
- `api/core/workflows_services.py:119`
204+
205+
Attributes:
206+
- `revision_id`
207+
- `segment_id`
208+

0 commit comments

Comments
 (0)