Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.ObjectSyntax
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
.ctor Inherited
Inherited from
objectSyntax
Properties
Alerting
Gets or sets the alerting configuration.Syntax
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The metric name. |
type | Microsoft.OData.Mcp.Core.Configuration.MetricType | The metric type. |
description | string | The metric description. |
unit | string? | The metric unit. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when name is null or whitespace. |
AddLogFilter
Adds a log filter.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
category | string | The log category to filter. |
level | string | The minimum log level for the category. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when category is null or whitespace. |
Clone
Creates a copy of this configuration.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration
A new instance with the same settings.
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ForDevelopment
Creates a configuration optimized for development environments.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration
A monitoring configuration suitable for development.
ForProduction
Creates a configuration optimized for production environments.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration
A monitoring configuration suitable for production.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
MergeWith
Merges another configuration into this one, with the other configuration taking precedence.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
other | Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration | The configuration to merge into this one. |
Exceptions
| Exception | Description |
|---|---|
ArgumentNullException | Thrown when other is null. |
Minimal
Creates a minimal monitoring configuration.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration
A monitoring configuration with minimal overhead.
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Validate
Validates the monitoring configuration.Syntax
Returns
Type:System.Collections.Generic.IEnumerable<string>
A collection of validation errors, or empty if the configuration is valid.