twitter/twitter-server
58.2
Adequate · 27 September 2026
6.6k
lines of production code
Scala
with JavaScript
5
measurements over time
What this system is
This release introduces a comprehensive new admin server and lifecycle management system for TwitterServer, featuring a suite of diagnostic, metrics, and logging handlers accessible via a unified UI. Key additions include OpenCensus zPages integration, Bootstrap-based admin styling, and pluggable logging support for Logback Classic and SLF4J JDK14, while the legacy admin server is removed. The project also migrates its build system from Maven to SBT and updates the documentation to a Sphinx-based structure.
Features
Add JSON serialization for metric expressions
The /admin/metrics/expressions endpoint now returns a structured JSON representation of each expression, including name, labels, namespace, expression query, bounds, description, and unit. Labels are serialized with default fallback values (e.g., "Unspecified") to ensure compatibility, and the namespace is included as an array when present. This enables clients to parse expression metadata in a stable, machine-readable format.
server/src/main/scala/com/twitter/server/util/exp · high confidence
Add Java-compatible AbstractTwitterServer for JUL logging
A new Scala source file and Bazel build configuration are added to the slf4j-jdk14 module. The AbstractTwitterServer class provides a Java-friendly implementation of the TwitterServer framework that supports backwards-compatible Java Util Logging (JUL) integration. The build file defines the library artifact twitter-server-slf4j-jdk14, depending on the core server and logging components.
slf4j-jdk14/src/main/scala/com/twitter/server/slf4j · high confidence
Add OpenCensus zPages integration for TwitterServer
Users can now enable OpenCensus zPages in their TwitterServer applications by mixing in the new \ZPagesAdminRoutes\ trait. This exposes standard zPages endpoints (such as /rpcz, /statz, /tracez, and /traceconfigz) on the admin server, allowing for runtime inspection of RPCs, statistics, and tracing data.
opencensus · medium confidence
Add generic view rendering for admin endpoints
The admin interface now wraps all combined muxers with an IndexView that provides a consistent HTML template, navigation sidebar, and styling for all admin endpoints. This includes new views for load balancers (BalancersJsonView, BalancerHtmlView), stack registry (StackRegistryView), endpoint registry (EndpointRegistryView), thread status (ThreadsView), and a generic TextBlockView for simple text responses. The IndexView filter selectively wraps HTML fragments in the main layout, while NotFoundView provides a styled 404 page. These changes introduce a unified, responsive UI for the admin stack module registry and other server diagnostics.
server/src/main/scala/com/twitter/server/view · high confidence
Add logback-classic logging handler for admin UI
A new LoggingHandler is introduced for the logback-classic implementation, exposing an admin UI endpoint at /admin/logging. This allows users to view and modify log levels for both logback and java.util.logging (JUL) loggers directly from the admin interface, including the ability to filter for overridden loggers only.
logback-classic/src/main/scala/com · high confidence
Add slf4j-jdk14 logging handler for admin logging configuration
A new \LoggingHandler\ implementation for the \slf4j-jdk14\ module exposes the Java 14 \java.util.logging\ configuration via the admin interface. Users can now view and modify logging levels for all loggers through the \/admin/logging\ endpoint, supporting both HTML and plain text responses.
slf4j-jdk14/src/main/scala/com/twitter/server/handler · high confidence
Add slf4j-jdk14 logging implementation with glog-style formatting
The slf4j-jdk14 module now provides a logging implementation that applies a glog-style log format to the root logger's handlers. This includes a new LogFormatter that outputs structured log lines with level, timestamp, thread ID, trace ID, and class/method information, and a Logging trait that initializes this formatter early in the application lifecycle to ensure consistent log formatting from the start.
slf4j-jdk14/src/main/scala/com/twitter/server/logging · high confidence
Added Bootstrap v3.1.1 CSS framework
The server now includes the full Bootstrap v3.1.1 CSS stylesheet (bootstrap.min.css), providing standard UI components, grid system, and form styling for the admin interface.
server/src/main/resources/twitter-server/css · high confidence
Added client-side charting and histogram visualization for metrics and histograms
The server now serves JavaScript files that render interactive line charts for metrics and area charts for histograms using Google Charts. This includes a new ChartRenderer for dynamic metric updates, a histogram visualization with toggleable log scale and CDF/PDF formats, and a statistics table that displays count, sum, average, min, max, and percentiles. The UI also includes a sidebar toggle and confirmation dialogs for server control actions.
server/src/main/resources/twitter-server/js · high confidence
Added server utility classes for HTML escaping, HTTP response helpers, and JSON serialization
Added new utility classes in the server package: HtmlUtils for escaping HTML characters, HttpUtils for creating HTTP responses and content-type detection, and Json utilities including a base JsonConverter and an AdminJsonConverter with snake\_case naming and custom serializers for metric schemas. Also added JvmStats (deprecated), MetricSchemaJsonModule for Jackson serialization, MetricSchemaSerializer for detailed metric metadata, MetricSchemaSource for schema registry access, and MetricSource for retrieving live metric values and types.
server/src/main/scala/com/twitter/server/util · high confidence
Initial Sphinx-based documentation for TwitterServer
The documentation site is migrated to Sphinx, introducing a new \flask\ theme and a custom \includecode\ extension for embedding Scala and Java code snippets. The new structure includes dedicated pages for Features, Admin endpoints, Java usage, and a Migration guide from Ostrich, alongside a Changelog and FAQ. This replaces the previous documentation format, providing a more structured and interactive reference for developers using TwitterServer.
doc · high confidence
New admin handlers for server diagnostics and metrics
The server introduces a suite of new admin HTTP handlers to expose internal state and metrics. These include handlers for client certificates and SSL info (AttachedClientsHandler), Dtab resolution (DtabHandler), heap profiling (HeapResourceHandler), histogram visualization (HistogramQueryHandler), lint rule status (FailedLintRuleHandler, LintHandler), load balancer status (LoadBalancersHandler), metric expressions and metadata (MetricExpressionHandler, MetricMetadataQueryHandler, MetricQueryHandler, MetricTypeQueryHandler), namespaces, and general index/redirects. This provides users with richer observability into connected clients, metric schemas, and system health via the admin interface.
server/src/main/scala/com/twitter/server/handler · high confidence
New admin server and lifecycle hooks for TwitterServer
The server module now includes a new \AdminHttpServer\ that exposes a suite of administrative HTTP endpoints, including \/admin/ping\, \/admin/health\, \/admin/metrics\, \/admin/metric\_metadata.json\, and \/admin/metric/expressions.json\. The \TwitterServer\ framework has been refactored to include a \Lifecycle\ trait that manages warmup states (exposing \/ready\ and \/health\ endpoints) and supports \Hook\ implementations for \premain\ and \onExit\ events. Additionally, a \BuildProperties\ utility is introduced to load and expose build-time metadata, and global linters are registered to detect issues like metric collisions and duplicate flags.
server/src/main/scala/com/twitter/server · high confidence
New lint rules for server configuration and performance
Added multiple new lint rules to the server module to detect configuration issues and performance anti-patterns. These include checks for duplicate flag definitions, duplicate LoadService bindings, multiple SLF4J implementations, missing or multiple logging handlers, Memcache FailFast misconfiguration, null StatsReceivers, multiple StatsReceivers, scheduler blocking, duplicate StackRegistry names, and excessive cumulative gauges. These rules help developers identify and fix common setup errors and performance pitfalls.
server/src/main/scala/com/twitter/server/lint · high confidence
Repository structure and documentation files added
The repository now includes essential documentation and configuration files to support the project's open-source lifecycle. This includes a comprehensive CHANGELOG.rst detailing version history and runtime behavior changes, a CONTRIBUTING.md guide for developers, a .gitignore file to manage build artifacts, and a sbt wrapper script to ensure consistent build environments. Additionally, standard repository metadata files such as LICENSE, README.md, and PROJECT.yml have been added to establish the project's legal and organizational framework.
(repo-wide) · high confidence
Removals
Removed legacy admin server and handlers from twitter-server
The legacy admin server implementation and its associated HTTP handlers (including /admin, /threads, /tracing, /shutdown, and /pprof endpoints) have been removed from the twitter-server module. This eliminates the built-in HTTP server used for administrative tasks, requiring users to configure their own admin endpoints or rely on external tooling for server management and monitoring.
src/main · high confidence
Behavioural changes
Add logging handler support for Logback Classic and SLF4J JDK14
The server now supports pluggable logging handlers for Logback Classic and SLF4J JDK14. New service provider files register the respective logging implementations, allowing users to configure their preferred logging backend through the server's admin logging handler support.
logback-classic/src/main/resources, slf4j-jdk14/src/main/resources · medium confidence
Admin thread pool isolation moved to dedicated filter package
The \AdminThreadPoolFilter\ object, which provides methods to isolate admin routes and services onto a dedicated thread pool, has been moved from its previous location into the \com.twitter.server.filters\ package. This change improves code organization by grouping filter-related logic with other server-side filters.
server/src/main/scala/com/twitter/server/filters · high confidence
Deprecate slf4j-log4j12 logging handler
The LoggingHandler for the slf4j-log4j12 module has been marked as deprecated, with a recommendation to migrate to the logback-classic implementation. This change affects the admin logging interface, signaling that the log4j12 integration is no longer the preferred path for server logging configuration.
slf4j-log4j12/src/main/scala/com · high confidence
Deprecate slf4j-log4j12 logging implementation
The slf4j-log4j12 module is now marked as deprecated, with a recommendation to migrate to the logback-classic implementation. A new Bazel build file has been added to support the module, and a service provider file has been introduced to register the LoggingHandler for the Twitter server's admin logging system.
slf4j-log4j12/src/main/resources · high confidence
Enable service name-based announcer resolution via configuration
Users can now configure service-to-announcer mappings through the \com.twitter.server.FlagAnnouncer\ class, allowing specific services to be announced via custom announcer implementations defined in the \announcerMap\ global flag. This change introduces the \FlagAnnouncer\ and \FlagResolver\ implementations, registered via Java SPI in \META-INF/services\, enabling dynamic announcer selection based on service names.
server/src/main/resources/META-INF, server/src/main/scala/com/twitter/server/resolver · low confidence
Test coverage
Add comprehensive tests for TwitterServer lifecycle and AdminHttpServer; Add tests for Twitter Server logging and exception handling; Add unit tests for the SLF4J Log4j12 logging handler; Added Java compilation test for the TwitterServer framework; Added test coverage for AdminThreadPoolFilter; Added test coverage for server handlers; Added test coverage for server utility classes; Added test resources for the server module; Added tests for metric expression serialization and namespace handling; Added tests for server lint rules; Added tests for server view components; Added tests for the Logback Classic logging handler; Removed server handler test suites.
Dependencies
Migrate from Maven to SBT build system
The project has switched from Maven (pom.xml) to SBT (build.sbt) for its build configuration. This migration updates the build tooling, which includes upgrading the Scala version to 2.13.6 (with 2.12.12 as a cross-version), updating test dependencies such as ScalaTest to 3.1.2, and modernizing the build script with JDK 11 support and Travis CI environment variables for skipping flaky tests.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 39 → 58 (+19.2)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 50 → 68 (+17.9)
- Architecture 69 → 98 (+28.8)
- Maturity 50 → 51 (+1.2)
- Readiness 22 → 50 (+27.9)
- Security 70 → 93 (+22.5)
Resolved (15)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- Duplicated block (8 lines × 2) (server/src/test/java/com/twitter/server/TwitterServerCompilationTest.java)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- LLM evaluation failed
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- No exposed public API
- No tests found
- Test reliability not included
New (28)
- ClientRegistryHandler.clientProfiles (cognitive 40) (server/src/main/scala/com/twitter/server/handler/ClientRegistryHandler.scala)
- Dormant codebase
- Duplicated block (10 lines × 2) (server/src/main/scala/com/twitter/server/handler/TunableHandler.scala)
- Duplicated block (12 lines × 2) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- Duplicated block (17 lines × 2) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- Duplicated block (6 lines × 2) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- Duplicated block (7 lines × 3) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- Duplicated block (7 lines × 3) (server/src/main/scala/com/twitter/server/handler/ClientRegistryHandler.scala)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- HistogramQueryHandler.apply (cognitive 19) (server/src/main/scala/com/twitter/server/handler/HistogramQueryHandler.scala)
- IncludeCode.run (cognitive 48) (doc/src/sphinx/exts/includecode.py)
- IncludeCode.run (cyclomatic 31) (doc/src/sphinx/exts/includecode.py)
- IndexView.render (cognitive 16) (server/src/main/scala/com/twitter/server/view/IndexView.scala)
- LoggingHandler.renderHtml (cognitive 20) (slf4j-log4j12/src/main/scala/com/twitter/server/handler/slf4j/log4j12/LoggingHandler.scala)
- LoggingHandler.renderHtml (cognitive 36) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- LoggingHandler.renderHtml (cyclomatic 16) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- LoggingHandler.respond (cognitive 16) (logback-classic/src/main/scala/com/twitter/server/handler/logback/classic/LoggingHandler.scala)
- …and 8 more
Architecture
- Containers 0 added · 0 removed · contexts 1 added · 0 removed · edges 0 added · 0 removed
Added bounded contexts (1)
- repository
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
twitter/twitter-server was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 24e15a4b0110e9807ed104c1ae2097ae8769d0db — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.