Skip to content

docs: add network timing to metrics spec - #66

Closed
pauldambra wants to merge 3 commits into
posthog-code/add-metrics-specfrom
posthog/add-network-request-metrics
Closed

pauldambra wants to merge 3 commits into
posthog-code/add-metrics-specfrom
posthog/add-network-request-metrics

Conversation

@pauldambra

@pauldambra pauldambra commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Why

SDK maintainers need one clear Metrics contract and support record for network request timing. This prevents Session Replay support from being reported as Metrics support.

Changes

  • Adds Network Request Timing requirements directly to the Metrics spec, and archives the change.

  • Defines safe data handling and separates verified SDK support from future candidates.

  • Fixes the Metrics spec so strict validation passes (a NUL byte and one requirement wording).

Depends on #30.


Created with PostHog from a Slack thread

Generated-By: PostHog Desktop
Task-Id: 9d0220e6-7dd2-4178-ab32-75f4f5a0df11
@pauldambra
pauldambra force-pushed the posthog/add-network-request-metrics branch from 319e8dd to 429e02b Compare September 17, 2026 12:26
Generated-By: PostHog Desktop
Task-Id: 9d0220e6-7dd2-4178-ab32-75f4f5a0df11
@pauldambra pauldambra changed the title docs: propose network request metrics capability docs: add network timing to metrics spec Sep 17, 2026
@pauldambra
pauldambra changed the base branch from main to posthog-code/add-metrics-spec September 17, 2026 12:28
@marandaneto

Copy link
Copy Markdown
Member

we dont use the sdk-specs as RFC but rather the already approved/agreed spec so make sure this PR archives the current spec and change the spec directly in the PR
eg https://github.com/PostHog/sdk-specs/pull/64/changes
the current spec goes to change/archive
the new spec is updated
https://github.com/PostHog/sdk-specs/tree/main/.agents/skills has the skills you need

Sync the network request timing requirements into openspec/specs/metrics/spec.md and move the change to the archive, as asked in review.

Also fix the metrics spec so `openspec validate --specs --strict` passes:
- replace a literal NUL byte with the text `\0` (git treated the file as binary)
- put SHALL on the first line of the type-collision warning requirement
- put MUST on the first line of the safe dimensions requirement

Generated-By: PostHog Desktop
Task-Id: 4805f701-2902-4ced-8fbd-e75e250fd319

Copy link
Copy Markdown
Member Author

🤖 (robot reply on behalf of @pauldambra)

Thanks @marandaneto. Done in 3414b36:

  • The change is archived to openspec/changes/archive/2026-11-06-add-network-request-metrics/.
  • The new requirements are synced directly into openspec/specs/metrics/spec.md.

I also fixed the Validate specs check. The metrics spec from #30 had a literal NUL byte and one requirement without SHALL on its first line. openspec validate --specs --strict now passes locally.

Copy link
Copy Markdown
Member Author

🤖 (robot comment on behalf of @pauldambra)

Closing this PR. Network request timing should follow the OpenTelemetry HTTP client semantic conventions (http.client.request.duration, unit s, standard attributes). It should not use names that this spec leaves undefined. This also needs a change to the base Metrics spec (#30), because its fixed buckets do not work with durations in seconds.

@pauldambra pauldambra closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants