Skip to content

fix: ADDON-85914 findings fixes#458

Merged
wtobis-splunk merged 7 commits into
developfrom
fix/ADDON-85914-findings-fixes
May 13, 2026
Merged

fix: ADDON-85914 findings fixes#458
wtobis-splunk merged 7 commits into
developfrom
fix/ADDON-85914-findings-fixes

Conversation

@wtobis-splunk
Copy link
Copy Markdown
Contributor

Summary

  • Fix DELTA temporality on OTLPMetricExporter — both Counter and
    Histogram now explicitly declare AggregationTemporality.DELTA, matching
    the existing LoggerMetricExporter behaviour and ensuring each export
    interval reports only the delta, not a cumulative total.

  • Add ObservabilityService.flush() — public method that calls
    MeterProvider.force_flush() via the OTel SDK's public API. Replaces the
    previous pattern of reaching into private SDK internals to drain metric
    readers before process exit.

  • Safe lazy import of grpcioimport grpc and OTLPMetricExporter
    are moved from module top-level into _create_otlp_exporter().
    from solnlib.observability import StanzaObservabilityRecorder now succeeds
    in environments where grpcio is not installed.

  • Add StanzaObservabilityRecorder — stanza-scoped recorder that wraps
    ObservabilityService with a per-process singleton cache (one service per
    modinput_type). Key design decisions:

    • Singleton held in ClassVar on the class itself, making it
      straightforward to reset in tests.
    • register_instrument(callback) delegates to
      ObservabilityService.register_instrument() — no need to access the
      underlying service directly.
    • ATTR_MODINPUT_NAME is always applied last in record() and cannot be
      overridden by extra_attrs, preserving the stanza-scoped guarantee.
    • Implements context manager protocol; __exit__ calls flush()
      automatically.
    • _emit_zero_baseline() records add(0, 0) on construction so the metric
      series is visible from the first collection cycle even when no events were
      ingested.

wtobis-splunk and others added 7 commits May 11, 2026 16:05
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…loading

Make solnlib.observability importable without grpcio by deferring grpc and
OTLPMetricExporter imports to the point where they are actually used inside
_create_otlp_exporter. This allows modules to import StanzaObservabilityRecorder
in environments where grpcio is not installed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implements a stanza-scoped observability recorder backed by a shared
ObservabilityService singleton cache, enabling efficient per-stanza event
metrics collection with automatic flush-on-exit lifecycle management.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
extra_attrs is now merged first and stanza_name is applied last, so the
stanza-scoped guarantee is always preserved.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@wtobis-splunk wtobis-splunk requested a review from a team as a code owner May 12, 2026 11:38
@wtobis-splunk wtobis-splunk merged commit 175b546 into develop May 13, 2026
15 checks passed
@wtobis-splunk wtobis-splunk deleted the fix/ADDON-85914-findings-fixes branch May 13, 2026 10:40
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants