Features/otel#49
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry tracing and metrics across OpenCertServer protocol surfaces (EST, ACME, CA/OCSP/CRL) and introduces acceptance coverage and documentation to validate emitted metrics.
Changes:
- Introduces centralized OpenTelemetry metric/span naming (
MetricNames,ActivityNames,TagKeys) and instrument registries (*Instruments) for EST, ACME, and CA handlers/endpoints. - Wraps key handlers/endpoints and background validation work with spans plus request/success/failure/duration (and active) instruments.
- Adds certserver acceptance tests and support assets for validating metrics emission, plus an OTel collector test container and a reference markdown doc.
Reviewed changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/opencertserver.certserver.tests/opencertserver.certserver.tests.csproj | Adds Testcontainers dependency for new test infrastructure. |
| tests/opencertserver.certserver.tests/Support/otel-collector-config.yaml | OpenTelemetry Collector config used by tests (OTLP receive + debug/prometheus export). |
| tests/opencertserver.certserver.tests/Support/OpenTelemetryCollectorContainer.cs | Testcontainers wrapper to run an OTel collector during acceptance tests. |
| tests/opencertserver.certserver.tests/StepDefinitions/OpenTelemetryMetrics.cs | Reqnroll steps asserting selected counters increment via MeterListener. |
| tests/opencertserver.certserver.tests/Features/OpenTelemetryMetrics.feature | New feature scenarios validating metrics for EST/OCSP/CRL operations. |
| tests/opencertserver.certserver.tests/Features/OpenTelemetryMetrics.feature.cs | Reqnroll-generated test binding for the OpenTelemetryMetrics feature. |
| src/opencertserver.est.server/MetricNames.cs | Centralized EST metric name constants. |
| src/opencertserver.est.server/ActivityNames.cs | Centralized EST span name constants. |
| src/opencertserver.est.server/TagKeys.cs | Centralized EST attribute/tag key constants. |
| src/opencertserver.est.server/EstInstruments.cs | Creates/hosts EST Meter, ActivitySource, counters, and histograms. |
| src/opencertserver.est.server/Handlers/CaCertHandler.cs | Adds EST /cacerts metrics + span instrumentation. |
| src/opencertserver.est.server/Handlers/CsrAttributesHandler.cs | Adds EST /csrattrs metrics + span instrumentation. |
| src/opencertserver.est.server/Handlers/SimpleEnrollHandler.cs | Adds EST /simpleenroll metrics + span instrumentation. |
| src/opencertserver.est.server/Handlers/SimpleReEnrollHandler.cs | Adds EST /simplereenroll metrics + span instrumentation. |
| src/opencertserver.est.server/Handlers/ServerKeyGenHandler.cs | Adds EST /serverkeygen metrics + span instrumentation. |
| src/opencertserver.ca.server/MetricNames.cs | Centralized CA/OCSP/CRL metric name constants. |
| src/opencertserver.ca.server/ActivityNames.cs | Centralized CA/OCSP/CRL span name constants. |
| src/opencertserver.ca.server/TagKeys.cs | Centralized CA/OCSP/CRL attribute/tag key constants. |
| src/opencertserver.ca.server/CaInstruments.cs | Creates/hosts CA Meter, ActivitySource, counters, and histograms. |
| src/opencertserver.ca.server/Handlers/OcspHandler.cs | Adds OCSP metrics + span instrumentation for POST and GET flows. |
| src/opencertserver.ca.server/Handlers/CrlHandler.cs | Adds CRL request + generation metrics + span instrumentation. |
| src/opencertserver.ca.server/Handlers/CsrHandler.cs | Adds CA CSR signing metrics + span instrumentation. |
| src/opencertserver.ca.server/Handlers/RevocationHandler.cs | Adds CA revoke metrics + span instrumentation and per-outcome reporting. |
| src/opencertserver.ca.server/Handlers/InventoryHandler.cs | Adds CA inventory metrics + span instrumentation. |
| src/opencertserver.ca.server/Handlers/CertificateRetrievalHandler.cs | Adds certificate retrieval metrics + span instrumentation. |
| src/opencertserver.acme.server/MetricNames.cs | Centralized ACME metric name constants. |
| src/opencertserver.acme.server/ActivityNames.cs | Centralized ACME span name constants. |
| src/opencertserver.acme.server/TagKeys.cs | Centralized ACME attribute/tag key constants. |
| src/opencertserver.acme.server/AcmeInstruments.cs | Creates/hosts ACME Meter, ActivitySource, counters, histograms, and up/down counter. |
| src/opencertserver.acme.server/Endpoints/DirectoryEndpoints.cs | Adds ACME /directory metrics + span instrumentation. |
| src/opencertserver.acme.server/Endpoints/NonceEndpoints.cs | Adds ACME /new-nonce metrics + span instrumentation for HEAD/GET. |
| src/opencertserver.acme.server/Endpoints/AccountEndpoints.cs | Adds ACME /new-account and /key-change metrics + span instrumentation. |
| src/opencertserver.acme.server/Endpoints/OrderEndpoints.cs | Adds ACME /new-order, /finalize, and /certificate metrics + span instrumentation. |
| src/opencertserver.acme.server/Endpoints/RevocationEndpoints.cs | Adds ACME /revoke-cert metrics + span instrumentation. |
| src/opencertserver.acme.server/Workers/ValidationWorker.cs | Adds ACME challenge validation metrics + span instrumentation including active tracking. |
| OpenTelemetryMetricsTraces.md | Documents metric/span naming strategy and the intended instrument set per protocol. |
Files not reviewed (1)
- tests/opencertserver.certserver.tests/Features/OpenTelemetryMetrics.feature.cs: Language not supported
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jjrdk/opencertserver/sessions/d87a50af-e7f6-49cc-b1db-35e94ccd0339 Co-authored-by: jjrdk <149390+jjrdk@users.noreply.github.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.
Add OpenTelemetry tracing and metrics