Skip to content

docs(DevEx): Add guidelines for metrics, logs, and feature flags#7268

Open
khvn26 wants to merge 1 commit intomainfrom
docs/api-planning-guidelines
Open

docs(DevEx): Add guidelines for metrics, logs, and feature flags#7268
khvn26 wants to merge 1 commit intomainfrom
docs/api-planning-guidelines

Conversation

@khvn26
Copy link
Copy Markdown
Member

@khvn26 khvn26 commented Apr 16, 2026

Changes

Contributes to #7012

Expands the Code guidelines part of api/README.md so metrics, logs, and feature flags sit as consecutive sections between testing and migrations. The goal is that engineers reach for events, metrics, and flags at planning time, in the same way they already reach for tests.

Logs is the substantive addition: structlog conventions (entity.action naming, double-underscore attribute namespacing, logger.bind), a worked example with the resulting OTLP event annotated inline, a pytest_structlog / StructuredLogCapture snippet for tests, and PII guidance. The section briefly names the OpenTelemetry pipeline so readers understand events can also feed a CDP or data warehouse for product analytics.

The existing Flagsmith on Flagsmith section is migrated from the Flagsmith SDK to OpenFeature (get_openfeature_client(), get_boolean_value(..., evaluation_context=...), Organisation.openfeature_evaluation_context) and moved up from the bottom of the file to sit next to metrics and logs.

How did you test this code?

Documentation only. Proofread locally and verified the referenced symbols (get_openfeature_client, openfeature_evaluation_context, StructuredLogCapture, environments/metrics.py) exist in the current codebase.

Group metrics, logs, and feature flags as consecutive sections after
testing so engineers encounter them when scanning the README. Migrate
the Flagsmith on Flagsmith section from the Flagsmith SDK to
OpenFeature, and move it up from the bottom of the file.

beep boop
@khvn26 khvn26 requested a review from a team as a code owner April 16, 2026 17:03
@khvn26 khvn26 requested review from Zaimwa9 and removed request for a team April 16, 2026 17:03
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Apr 16, 2026 5:04pm
flagsmith-frontend-preview Ignored Ignored Apr 16, 2026 5:04pm
flagsmith-frontend-staging Ignored Ignored Apr 16, 2026 5:04pm

Request Review

@github-actions github-actions bot added api Issue related to the REST API docs Documentation updates labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7268 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7268 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7268 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7268 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7268 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7268 Finished ✅ Results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  11 passed

Details

stats  11 tests across 8 suites
duration  39.8 seconds
commit  f305e5f
info  🔄 Run: #16131 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  48 seconds
commit  f305e5f
info  🔄 Run: #16131 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  54.4 seconds
commit  f305e5f
info  🔄 Run: #16131 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 3 seconds
commit  f305e5f
info  🔄 Run: #16131 (attempt 1)

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.29%. Comparing base (6c69f6e) to head (f305e5f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7268   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files        1357     1357           
  Lines       50851    50851           
=======================================
  Hits        49984    49984           
  Misses        867      867           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

Visual Regression

16 screenshots compared. See report for details.
View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants