ข้ามไปยังเนื้อหา

Class GcpTelemetryExportOptions

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

Namespace: Cephalon.Observability.Gcp.Configuration
Assembly: Cephalon.Observability.Gcp.dll

Configures GCP-hosted observability defaults on top of the shared Cephalon telemetry contract.

public sealed class GcpTelemetryExportOptions

objectGcpTelemetryExportOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Initializes a new instance of the class.

public GcpTelemetryExportOptions()

Gets or sets the hosted GCP platform whose default resource attributes should be applied.

public string? HostedPlatform { get; set; }

string?

Supported values are gce, gke, cloudrun, appengine, and functions. The package maps them to the current OpenTelemetry cloud.platform attribute values.

Gets or sets the GCP location to stamp onto exported resources when one should be made explicit.

public string? Location { get; set; }

string?

When the value looks like a zonal location such as asia-southeast1-b, the package also derives the matching cloud.region. When omitted, the package falls back to common GCP runtime environment variables when they are available.

Gets or sets the optional quota project header used for Google-managed ingestion requests.

public string? QuotaProjectId { get; set; }

string?

This value is written to the x-goog-user-project header only for Google-managed ingestion. Shared collector or self-hosted OTLP paths ignore it.

Gets or sets a value indicating whether Google-managed ingestion should authenticate by using Application Default Credentials.

public bool UseApplicationDefaultCredentials { get; set; }

bool

This setting only applies when is enabled and no shared collector endpoint is configured.

Gets or sets a value indicating whether the package should use Google-managed OTLP ingestion for traces and metrics when no shared collector endpoint is configured.

public bool UseGoogleManagedIngestion { get; set; }

bool

When this flag is enabled, the package targets https://telemetry.googleapis.com for traces and metrics by using OTLP/HTTP plus Application Default Credentials. Logs stay on the shared collector or platform logging path instead of being redirected through the Google-managed ingestion endpoint.

FromConfiguration(IConfiguration, string)

Section titled “ FromConfiguration(IConfiguration, string)”

Binds GCP telemetry export options from configuration.

public static GcpTelemetryExportOptions FromConfiguration(IConfiguration configuration, string sectionPath = "Engine")

configuration IConfiguration

The application configuration root.

sectionPath string

The configuration section path that contains the engine settings. The default is Engine.

GcpTelemetryExportOptions

The bound GCP telemetry export options.