LaunchDarkly Observability plugin for the Server-Side SDK for .NET
Search Results for

    Show / Hide Table of Contents

    Class ObservabilityPlugin

    Inheritance
    object
    PluginBase<ILdClient, Hook>
    Plugin
    ObservabilityPlugin
    Inherited Members
    PluginBase<ILdClient, Hook>.Register(ILdClient, EnvironmentMetadata)
    PluginBase<ILdClient, Hook>.GetHooks(EnvironmentMetadata)
    PluginBase<ILdClient, Hook>.Metadata
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: LaunchDarkly.Observability
    Assembly: LaunchDarkly.Observability.dll
    Syntax
    public class ObservabilityPlugin : Plugin

    Methods

    | Edit this page View Source

    Builder(IServiceCollection)

    Create a new builder for ObservabilityPlugin.

    When using this builder, LaunchDarkly client must be constructed before your application is built. For example:

    var builder = WebApplication.CreateBuilder(args);
    
    
    var config = Configuration.Builder("your-sdk-key")
        .Plugins(new PluginConfigurationBuilder()
            .Add(ObservabilityPlugin.Builder(builder.Services)
                .WithServiceName("ryan-test-service")
                .WithServiceVersion("example-sha")
                .Build())).Build();
    // Building the LdClient with the Observability plugin. This line will add services to the web application.
    var client = new LdClient(config);
    
    // Client must be built before this line.
    var app = builder.Build();
    Declaration
    public static ObservabilityPlugin.ObservabilityPluginBuilder Builder(IServiceCollection services)
    Parameters
    Type Name Description
    IServiceCollection services

    The service collection for dependency injection.

    Returns
    Type Description
    ObservabilityPlugin.ObservabilityPluginBuilder

    A new ObservabilityPlugin.ObservabilityPluginBuilder instance for configuring the observability plugin.

    | Edit this page View Source

    ForExistingServices()

    Construct a plugin which is intended to be used with already configured observability services.

    In a typical configuration, this method will not need to be used.

    This method only needs to be used when observability related functionality must be initialized before it is possible to initialize the LaunchDarkly SDK.

    Declaration
    public static ObservabilityPlugin ForExistingServices()
    Returns
    Type Description
    ObservabilityPlugin

    an observability plugin instance

    | Edit this page View Source

    GetHooks(EnvironmentMetadata)

    Returns a list of hooks to be registered for the plugin, based on the provided environment metadata.

    Declaration
    public override IList<Hook> GetHooks(EnvironmentMetadata metadata)
    Parameters
    Type Name Description
    EnvironmentMetadata metadata

    Metadata about the environment.

    Returns
    Type Description
    IList<Hook>

    A list of hook instances to be registered.

    Overrides
    LaunchDarkly.Sdk.Integrations.Plugins.PluginBase<LaunchDarkly.Sdk.Server.Interfaces.ILdClient, LaunchDarkly.Sdk.Server.Hooks.Hook>.GetHooks(LaunchDarkly.Sdk.Integrations.Plugins.EnvironmentMetadata)
    | Edit this page View Source

    Register(ILdClient, EnvironmentMetadata)

    Registers the plugin with the specified LaunchDarkly client and environment metadata.

    Declaration
    public override void Register(ILdClient client, EnvironmentMetadata metadata)
    Parameters
    Type Name Description
    ILdClient client

    An instance of the LaunchDarkly client to register the plugin with.

    EnvironmentMetadata metadata

    Metadata about the environment.

    Overrides
    LaunchDarkly.Sdk.Integrations.Plugins.PluginBase<LaunchDarkly.Sdk.Server.Interfaces.ILdClient, LaunchDarkly.Sdk.Server.Hooks.Hook>.Register(LaunchDarkly.Sdk.Server.Interfaces.ILdClient, LaunchDarkly.Sdk.Integrations.Plugins.EnvironmentMetadata)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX