发布

  • update AI provider documentation (#2897)

    frostbyte_neo 发布于 2026-05-10 16:14:04 +00:00

    • feat: add prometheus monitoring wrapper

    Reintroduces the Prometheus metrics wrapper previously available in the
    plugins repository, updated for go-micro v5. Exposes request count and
    latency histograms for handlers, subscribers, and outgoing client calls
    via NewHandlerWrapper, NewSubscriberWrapper, NewCallWrapper and
    NewClientWrapper, labelled with service/endpoint/status.

    Options cover namespace, subsystem, const labels, histogram buckets and
    a custom registerer; duplicate collectors (e.g. from multiple wrappers
    sharing the same config) are reused transparently via a cached
    metrics bundle.

    Fixes #2893

    • fix(registry/etcd): clear lease/register caches on KeepAlive channel closure

    When the etcd client's long-lived KeepAlive channel closes (e.g. because
    the lease expired on the server side during a network partition), the
    previous cleanup only removed the channel bookkeeping. The stale entries
    in leases and register caused the next registerNode() heartbeat to
    hit the "unchanged hash" short-circuit and skip re-registration entirely,
    so the service permanently disappeared from etcd.

    Extract the cleanup into handleKeepAliveClosed and also drop the cached
    lease id and hash so the next heartbeat performs a full Grant+Put and
    the service recovers within one RegisterInterval.

    Regression introduced by #2822; fix is symmetric with the existing
    synchronous KeepAliveOnce recovery path that propagates
    rpctypes.ErrLeaseNotFound.

    • docs: add AI provider integration guide and Supported AI Providers section

    Add a step-by-step guide for AI infrastructure companies to implement
    ai.Model and contribute a provider to go-micro. Covers the full
    lifecycle: skeleton, tool call handling, tests, registration, and PR
    checklist.

    Add a "Supported AI Providers" section to the project README that lists
    current providers (Anthropic, OpenAI) in a table and links to the
    integration guide with a call-to-action for new providers and sponsors.

    Streamline the "Adding a New Provider" section in ai/README.md to point
    to the new guide instead of duplicating a full code listing.

    • Update contribution guidelines in README.md

    Removed Discord contact information for platform contributions.


    Co-authored-by: Claude noreply@anthropic.com

    下载附件