Skip to content

release: 1.7.1 - #264

Merged
jpfaria merged 9 commits into
mainfrom
bugfix/1.7.1
Oct 20, 2026
Merged

jpfaria merged 9 commits into
mainfrom
bugfix/1.7.1

Conversation

@jpfaria

@jpfaria jpfaria commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Patch release from develop (milestone 1.7.1: #256, #257, #262).

Only the version in README and site changes on this branch.

release: 1.7.0 back to develop
…ics are exported (#257)

Nothing kept the SDK providers Start built, so nothing could flush them:
a stop dropped the spans still in the batch and the metrics since the last
interval (60s), and a short job could exit before its first export.

The factory now keeps both providers and exposes Shutdown(ctx), which
flushes and stops them at once (one export timeout, not two) and is final:
a later Start only warns. The fx module calls it from an OnStop hook and
logs a failure instead of returning it, so an unreachable collector does
not turn a successful run into exit code 1.

oteltest.Collector is an in-process OTLP/gRPC collector, so tests can
assert what really reached the exporter instead of dialing localhost:4317.
fix(otel): shut the providers down on stop so the last spans and metrics are exported (#257)
…ses otel (#256)

An app generated by builder could list the otel plugin on a server, the
opentelemetry middleware on a function or the otel plugin on a client, and
still export nothing: no generated module started the OpenTelemetry
providers, so every plugin reported to the noop global provider.

The door of a server that lists otel (rest, mcp, the cloudevents adapter),
the door of a function that runs the opentelemetry middleware and the
module of a client built with the otel plugin (resty, redis, mongo, sql)
now include otelfx.Module(), which starts the providers on boot and shuts
them down on stop. The module is once-guarded, so an app with several such
doors starts them once.

The builder example builds its warehouse client with otel and tests that
the span of the call reaches a collector with the trace context sent on;
examples/stock tests that the worker exports the span of an event.
fix(builder,inject): start the OTel providers when a door or client uses otel (#256)
…n context (#262)

The cloudevents_http command served on context.Background(), so its
receiver never returned: on SIGTERM the OnStop of the function module
waited the whole fx stop timeout (15s) and the app exited 1 with
"Failed to stop cleanly: context deadline exceeded".

It now runs RunContext(cmd.Context(), ...): when the app stops it takes
no new request, shuts its server down once the events in hand are
answered and returns, so the worker exits 0 at once. The handler runs
with a context the stop does not cancel, so the event it holds finishes.
A protocol option that fails now fails Run instead of a nil protocol.
Run is deprecated in favour of RunContext.

The generated main of examples/stock worker gets a test that sends
SIGTERM after a reservation and requires exit 0 within two seconds.
fix(bootstrap/function): the cloudevents http adapter stops on the run context (#262)
Bumps the version shown in README and site: generated apps start and shut
down the OpenTelemetry providers, and the cloudevents http adapter stops on
SIGTERM, since 1.7.0.
@jpfaria
jpfaria merged commit 22ad0ba into main Oct 20, 2026
4 checks passed
@jpfaria
jpfaria deleted the bugfix/1.7.1 branch October 20, 2026 13:54
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