Skip to content

Commit 8cc8a23

Browse files
authored
Merge pull request #777 from dahlia/otel/collections
OpenTelemetry: metrics for ActivityPub collections
2 parents e729577 + 6534413 commit 8cc8a23

8 files changed

Lines changed: 1537 additions & 204 deletions

File tree

CHANGES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ To be released.
6666
deliberately exclude raw URLs, query strings, and identifier values to
6767
keep cardinality bounded. [[#316], [#736], [#757]]
6868

69+
- Added OpenTelemetry metrics for ActivityPub collection requests handled
70+
by `Federation.fetch()` and custom collection handlers:
71+
72+
- `activitypub.collection.request` (counter)
73+
- `activitypub.collection.dispatch.duration` (histogram)
74+
- `activitypub.collection.page.items` (histogram)
75+
- `activitypub.collection.total_items` (histogram)
76+
77+
The metrics expose bounded collection dimensions:
78+
`activitypub.collection.kind`, `activitypub.collection.page`,
79+
`activitypub.collection.result`, `fedify.collection.dispatcher`, and
80+
optional `http.response.status_code`. Built-in collections are classified
81+
as `inbox`, `outbox`, `following`, `followers`, `liked`, `featured`, or
82+
`featured_tags`; application-defined collection routes are collapsed into
83+
`custom`. Collection IDs, cursors, custom route names, actor identifiers,
84+
and full URLs are deliberately excluded so dashboards can aggregate
85+
collection rate, latency, item counts, and `totalItems` values without
86+
attacker-controlled cardinality. [[#316], [#741], [#777]]
87+
6988
- Added OpenTelemetry queue task metrics covering Fedify's enqueue and
7089
worker boundaries for inbox, outbox, and fanout work:
7190

@@ -208,6 +227,7 @@ To be released.
208227
[#738]: https://github.com/fedify-dev/fedify/issues/738
209228
[#739]: https://github.com/fedify-dev/fedify/issues/739
210229
[#740]: https://github.com/fedify-dev/fedify/issues/740
230+
[#741]: https://github.com/fedify-dev/fedify/issues/741
211231
[#742]: https://github.com/fedify-dev/fedify/issues/742
212232
[#748]: https://github.com/fedify-dev/fedify/pull/748
213233
[#752]: https://github.com/fedify-dev/fedify/issues/752
@@ -220,6 +240,7 @@ To be released.
220240
[#770]: https://github.com/fedify-dev/fedify/pull/770
221241
[#771]: https://github.com/fedify-dev/fedify/pull/771
222242
[#772]: https://github.com/fedify-dev/fedify/pull/772
243+
[#777]: https://github.com/fedify-dev/fedify/pull/777
223244

224245
### @fedify/fixture
225246

docs/manual/opentelemetry.md

Lines changed: 126 additions & 70 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)