fix(samples): copy Directory.Build.props into Docker build context - #6
Merged
Merged
Conversation
Without it, the SDK never sees ImplicitUsings/Nullable and Stampede.Http fails to compile inside the client image (CS0246 on basic BCL types like HttpRequestMessage, TimeSpan, CancellationToken). The API sample worked by accident — its .csproj sets these properties itself — but both should inherit from the same repo-wide file. Verified: both images now build, and docker compose up --build runs the full stack end-to-end (2 client replicas sharing state via Redis). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each client instance now exports the Stampede.Http meter via OpenTelemetry.Exporter.Prometheus.HttpListener (port 9464), scraped by Prometheus every 5s and graphed by a pre-provisioned Grafana dashboard (datasource + dashboard auto-loaded, no manual setup) at http://localhost:3000/d/stampede-http-overview. 10 panels cover every instrument, broken down per instance so the cache-shared / coalescing-per-process nuance is directly visible. Replaces the client's deploy.replicas:2 with two named services (client-a/client-b) so Prometheus has stable, individually addressable scrape targets instead of round-robin DNS across anonymous replicas. Two non-obvious fixes needed to get here, both verified against real containers rather than assumed: - The exporter's Host option is validated via UriBuilder (rejects wildcard +/*) and .NET's HttpListener itself refuses a literal 0.0.0.0 too. The only value that binds unprivileged AND is reachable from other containers is the container's own hostname, so each client sets and METRICS__HOST to the same value. - HttpListener does Host-header-based virtual hosting for a non-wildcard prefix, so a manual from the host 404s (Host header is localhost, not the registered name) even though Prometheus's own scrape works fine (it naturally sends the target address as Host header). Also, Prometheus 3.x negotiates UTF-8 metric names (dots preserved) with targets that support it; prometheus.yml pins metric_name_escaping_scheme: underscores so names stay in the classic Prometheus form the dashboard queries against. Verified end-to-end from a clean 'docker compose up --build': both scrape targets report healthy, and the dashboard's exact PromQL queries (via Prometheus directly and through Grafana's own datasource proxy) return real data — e.g. cache hit ratio and per-instance coalescing dedup counts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without it, the SDK never sees ImplicitUsings/Nullable and Stampede.Http fails to compile inside the client image (CS0246 on basic BCL types like HttpRequestMessage, TimeSpan, CancellationToken). The API sample worked by accident — its .csproj sets these properties itself — but both should inherit from the same repo-wide file.
Verified: both images now build, and docker compose up --build runs the full stack end-to-end (2 client replicas sharing state via Redis).