Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration

Summary

Configuration for logging, metrics, and health monitoring.

Remarks

Monitoring configuration controls what information is logged, how metrics are collected, and what health checks are performed for operational visibility.

Constructors

.ctor

Initializes a new instance of the MonitoringConfiguration class.

Syntax

public MonitoringConfiguration()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Alerting

Gets or sets the alerting configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration Alerting { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.AlertingConfiguration Configuration for automated alerts based on metrics and logs.

Remarks

Alerting configuration defines when and how to notify operations teams about system issues or performance degradations.

ApplicationInsights

Gets or sets the application insights configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration ApplicationInsights { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.ApplicationInsightsConfiguration Configuration for Azure Application Insights integration.

Remarks

Application Insights provides comprehensive application performance monitoring and analytics for Azure-hosted applications.

CustomMetrics

Gets or sets the custom metric definitions.

Syntax

public System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Configuration.MetricDefinition> CustomMetrics { get; set; }

Property Value

Type: System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Configuration.MetricDefinition> A collection of custom metrics to collect.

Remarks

Custom metrics allow tracking application-specific measurements beyond the standard performance metrics.

CustomProperties

Gets or sets custom monitoring properties.

Syntax

public System.Collections.Generic.Dictionary<string, object> CustomProperties { get; set; }

Property Value

Type: System.Collections.Generic.Dictionary<string, object> A dictionary of custom monitoring configuration values.

Remarks

Custom properties allow extending the configuration with monitoring system-specific settings that don’t fit into the standard configuration properties.

EnableHealthChecks

Gets or sets a value indicating whether to enable health checks.

Syntax

public bool EnableHealthChecks { get; set; }

Property Value

Type: bool true to enable health check endpoints; otherwise, false.

Remarks

Health checks provide automated monitoring of service health status and can be used by load balancers and monitoring systems.

EnableMetrics

Gets or sets a value indicating whether to enable performance metrics collection.

Syntax

public bool EnableMetrics { get; set; }

Property Value

Type: bool true to collect performance metrics; otherwise, false.

Remarks

Performance metrics include response times, throughput, error rates, and other operational metrics useful for monitoring and alerting.

EnableStructuredLogging

Gets or sets a value indicating whether to enable structured logging.

Syntax

public bool EnableStructuredLogging { get; set; }

Property Value

Type: bool true to enable structured logging; otherwise, false.

Remarks

Structured logging outputs log messages in a structured format (like JSON) that can be easily parsed by log aggregation systems.

EnableTracing

Gets or sets a value indicating whether to enable distributed tracing.

Syntax

public bool EnableTracing { get; set; }

Property Value

Type: bool true to enable distributed tracing; otherwise, false.

Remarks

Distributed tracing tracks requests across multiple services and provides end-to-end visibility in microservice architectures.

HealthCheckInterval

Gets or sets the health check interval.

Syntax

public System.TimeSpan HealthCheckInterval { get; set; }

Property Value

Type: System.TimeSpan The interval between health check executions.

Remarks

More frequent health checks provide faster failure detection but increase system load.

HealthCheckTimeout

Gets or sets the health check timeout.

Syntax

public System.TimeSpan HealthCheckTimeout { get; set; }

Property Value

Type: System.TimeSpan The maximum time to wait for health check completion.

Remarks

Health checks that take longer than this timeout will be considered failed.

LogFilters

Gets or sets the log filters.

Syntax

public System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Configuration.LogFilter> LogFilters { get; set; }

Property Value

Type: System.Collections.Generic.List<Microsoft.OData.Mcp.Core.Configuration.LogFilter> A collection of filters to apply to log messages.

Remarks

Log filters can suppress noisy log messages or enhance logging for specific components or scenarios.

LogLevel

Gets or sets the minimum logging level.

Syntax

public string LogLevel { get; set; }

Property Value

Type: string The minimum level of log messages to record.

Remarks

Log levels follow standard .NET logging conventions: Trace, Debug, Information, Warning, Error, Critical. Lower levels include all higher levels.

LogRequestResponse

Gets or sets a value indicating whether to log request/response details.

Syntax

public bool LogRequestResponse { get; set; }

Property Value

Type: bool true to log HTTP request and response details; otherwise, false.

Remarks

Request/response logging provides detailed information about HTTP traffic but can impact performance and may log sensitive information.

LogSensitiveData

Gets or sets a value indicating whether to log sensitive data.

Syntax

public bool LogSensitiveData { get; set; }

Property Value

Type: bool true to include sensitive data in logs; otherwise, false.

Remarks

Sensitive data includes authentication tokens, personal information, and other confidential data. This should be disabled in production environments.

MetricsInterval

Gets or sets the metrics collection interval.

Syntax

public System.TimeSpan MetricsInterval { get; set; }

Property Value

Type: System.TimeSpan The interval between metrics collection cycles.

Remarks

More frequent collection provides better visibility but increases overhead. The optimal interval depends on your monitoring requirements.

OpenTelemetry

Gets or sets the OpenTelemetry configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration OpenTelemetry { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.OpenTelemetryConfiguration Configuration for OpenTelemetry observability.

Remarks

OpenTelemetry provides standardized observability with metrics, logs, and traces that can be exported to various monitoring systems.

TracingSamplingRate

Gets or sets the tracing sampling rate.

Syntax

public double TracingSamplingRate { get; set; }

Property Value

Type: double The percentage of requests to trace (0.0 to 1.0).

Remarks

Sampling reduces the overhead of tracing by only capturing a percentage of requests. A value of 1.0 traces all requests.

Methods

AddCustomMetric

Adds a custom metric definition.

Syntax

public void AddCustomMetric(string name, Microsoft.OData.Mcp.Core.Configuration.MetricType type, string description, string unit = null)

Parameters

NameTypeDescription
namestringThe metric name.
typeMicrosoft.OData.Mcp.Core.Configuration.MetricTypeThe metric type.
descriptionstringThe metric description.
unitstring?The metric unit.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when name is null or whitespace.

AddLogFilter

Adds a log filter.

Syntax

public void AddLogFilter(string category, string level)

Parameters

NameTypeDescription
categorystringThe log category to filter.
levelstringThe minimum log level for the category.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when category is null or whitespace.

Clone

Creates a copy of this configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Clone()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration A new instance with the same settings.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ForDevelopment

Creates a configuration optimized for development environments.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration ForDevelopment()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration A monitoring configuration suitable for development.

ForProduction

Creates a configuration optimized for production environments.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration ForProduction()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration A monitoring configuration suitable for production.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

MergeWith

Merges another configuration into this one, with the other configuration taking precedence.

Syntax

public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration other)

Parameters

NameTypeDescription
otherMicrosoft.OData.Mcp.Core.Configuration.MonitoringConfigurationThe configuration to merge into this one.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when other is null.

Minimal

Creates a minimal monitoring configuration.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Minimal()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration A monitoring configuration with minimal overhead.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?

Validate

Validates the monitoring configuration.

Syntax

public System.Collections.Generic.IEnumerable<string> Validate()

Returns

Type: System.Collections.Generic.IEnumerable<string> A collection of validation errors, or empty if the configuration is valid.