Skip to content

fix(samples): copy Directory.Build.props into Docker build context - #6

Merged
FranRuiz98 merged 2 commits into
masterfrom
test/resolve-xunit-analyzer-warnings
Jul 24, 2026
Merged

fix(samples): copy Directory.Build.props into Docker build context#6
FranRuiz98 merged 2 commits into
masterfrom
test/resolve-xunit-analyzer-warnings

Conversation

@FranRuiz98

Copy link
Copy Markdown
Owner

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).

FranRuiz98 and others added 2 commits July 24, 2026 17:57
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>
@FranRuiz98
FranRuiz98 merged commit 29777fc into master Jul 24, 2026
2 checks passed
@FranRuiz98
FranRuiz98 deleted the test/resolve-xunit-analyzer-warnings branch July 24, 2026 20:12
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.

1 participant