You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
⚙️ Core Changes
The command line now beats environment variables and config files. Before, a config file beat it, so --OpenTelemetry:Otlp:Enabled=true lost to a false in OpenTelemetry.json. Environment variables still beat every config file.
🧪 Diagnostics Module
Each OpenTelemetry signal can be turned off on its own for OTLP.Otlp.Metrics, Otlp.Tracing and Otlp.Logging are new keys, each true by default, so an existing config sends the same as before. A signal turned off is not exported over OTLP at all. Azure Monitor ignores these keys and still gets all three. With all three off, OTLP sends nothing and a warning is logged at startup.
With any of the three off, the per-signal OTEL_EXPORTER_OTLP_<SIGNAL>_* environment variables are not read. The signals still on share the one endpoint from Otlp.Endpoint or OTEL_EXPORTER_OTLP_ENDPOINT. With all three on they work as before.
ServiceInstanceId is now null by default, so each start gets its own unique id. It shipped as "1", which made every running copy look like the same one. If a dashboard or alert filters on "1", change it, or set ServiceInstanceId yourself to keep one id across restarts.
The AdditionalAttributes under Metrics, Tracing and Logging are deprecated. They still work, and a warning is logged at startup when one has values. Move the values to the top-level AdditionalAttributes, which applies to every signal. They will be removed in 4.0.0.
Packing spans are now sent in production. The Binacle.Net trace source was only listed in the Development config, so other environments never sent the pack and fit spans. It is now always on, and Tracing.AdditionalSources is only for extra sources.
The resource now carries host.name and process.pid. Before, only log records carried the machine name and process id, so traces and metrics had no host at all. A value set in AdditionalAttributes still wins.
The resource now carries deployment.environment.name, the host environment in lowercase, such as production. Dashboards can now split production from development. OTEL_RESOURCE_ATTRIBUTES and AdditionalAttributes still win over it.
The Binacle.Net and Binacle.Net.DiagnosticsModule meters and the Binacle.Net trace source now carry the Binacle version. OpenTelemetry sends it with every batch, so a backend can tell which release produced a series.
OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME now work. They were read, but lost to the values Binacle sets, so host.name, process.pid, the instance id and the service name could not be changed through them. They now win over Binacle's defaults and over ServiceInstanceId. The top-level AdditionalAttributes still wins over them. With Azure Monitor, OTEL_SERVICE_NAME also changes the role name.
Health-check requests no longer appear in traces or in the HTTP request metrics. Each probe made a span and counted as a request, which buried real traffic under probes. The health checks themselves are unchanged.
Health checks can now be opened with a key as well as by address. Set AccessKey in HealthChecks.json, or HealthChecks__AccessKey in the environment, and send it in the X-Health-Key header. A probe whose address changes, such as one on a home connection, then gets in from anywhere. With RestrictedIPs set too, either one lets a request in. A wrong key is refused even from an allowed address. With a key set and RestrictedIPs empty, only the key gets in. With no key set the header is ignored, so an existing config behaves as before. The key must be at least 32 printable ASCII characters with no spaces, or startup fails. Send it over HTTPS only.
Binacle now sends its own metrics. On the Binacle.Net meter, binacle.packing.operation.duration is the time spent packing, in seconds. binacle.packing.operation.items is the number of items in an operation, counting quantity. binacle.packing.results counts the results returned, by algorithm and status, so it shows which algorithm wins when none is given and how often items do not fit. With packing logs on, the Binacle.Net.DiagnosticsModule meter adds binacle.packing_log.processed, which counts every entry: written, dropped because the queue was full, lost because the write failed, or not written because the packing log had stopped. On a normal stop or restart the packing log now writes what is queued first, for up to 5 seconds, and only what is left after that counts as not written. Before, every restart lost the queue, and a write in progress at the stop was logged as a failure. After too many failed writes in a row the packing log stops at once and takes no more entries. binacle.packing_log.queue.size shows how full the queue is, and binacle.packing_log.queue.capacity its limit when ChannelLimit is set. Before, a full queue or a failing disk lost entries without any sign.
The packing spans now carry the request and the result. Each operation span is tagged with fit or pack, the mode, the algorithm asked for, the bin and item counts, and for a single result its algorithm and status. A failed operation marks its span as an error and records the exception.
The packing spans are renamed, and the endpoint spans are gone. The operation span is now named for the operation and the mode, such as pack single_bin, instead of Single Bin Operation. Create Response is now create response, and Send Channel Request is now queue packing_log. The per-endpoint spans, such as Pack Custom Bin: v4, are removed: the HTTP request span already carries the route. The operation's log line uses the new name too.
The Binacle.Lib spans are renamed and tagged.Process Bins: Loop and Process Bins: Parallel are now process bins, and the same for process algorithms and process multi_algorithm_bins. Build Operation Result is now build result. Each processor span carries binacle.lib.processor, loop or parallel, and binacle.packing.operation, fit or pack. Each build result span carries the result's algorithm and status. They are still sent only when Tracing.AdditionalSources lists Binacle.Lib, as the Development config does.
Binacle's own metric, attribute and span names are experimental in 3.x. That covers every binacle.* metric and attribute, the span names on the Binacle.Net and Binacle.Lib sources, and the Binacle.Net, Binacle.Net.DiagnosticsModule and Binacle.Lib meter and source names. A minor release may change one, and the changelog will say so. The built-in names, such as http.server.request.duration, follow OpenTelemetry and .NET.
The per-operation log line, such as pack single_bin completed in 12.3ms, is now Debug instead of Information. The span and binacle.packing.operation.duration already carry the same time, and at Information every request also sent one log record over OTLP. It no longer shows in the console, the log file or OTLP at the default level. To see it again, set Serilog:MinimumLevel:Override:Binacle.Net.Telemetry to Debug. OperationDurationMs stays in milliseconds.
Log records sent over OpenTelemetry now carry the finished message as their body. Before, the body was the template, such as pack single_bin completed in {OperationDurationMs}ms, with the value only in an attribute. Text values appear in quotes, as Serilog renders them, such as Now listening on: "https://localhost:7194". The attributes and the trace id are unchanged.
Otlp.Endpoint is now checked at startup. With OTLP on, it must be an absolute http or https URL, such as http://localhost:4317. Before, nothing checked it, and a value that is not a URL threw a raw UriFormatException. A bad Otlp.Protocol next to an endpoint also threw a raw exception before its own check ran. Both now stop startup with a clear message naming the key.
🔌 Service Module
With Postgres, database calls now appear in traces and metrics. Each command gets a span with its SQL text, and no password. Npgsql's own metrics, such as db.client.operation.duration and the connection pool ones, are sent too. Nothing changes with OpenTelemetry off. SQLite and Azure Storage send nothing new.
🏗️ Internal Work
The OpenTelemetry packages inside the image moved from 1.18 to 1.21.
Minor and patch updates to the other NuGet packages inside the image: Scalar 2.21.0, Swagger UI 10.3.1, FluentValidation 12.2.0, Azure.Data.Tables 12.13.0, Microsoft.OpenApi 2.13.1 and the bundled SQLite build 2.1.14.
Test and build dependencies updated: code coverage 18.12.0, Grpc.Tools 2.85.0 and the time provider testing package 10.11.0.