using System;
using System.Collections.Generic;

namespace EonaCat.LogStack.Telemetry;

/// <summary>
/// Point-in-time telemetry snapshot for dashboards, exporters and health probes.
/// </summary>
public sealed class TelemetrySnapshot
{
    public LoggerMetrics Metrics { get; set; } = new();
    public TelemetryHealth Health { get; set; } = new();
    public TelemetryResource Resource { get; set; } = new();

    public DateTime Timestamp { get; set; } = DateTime.UtcNow;
    public string ServiceName { get; set; } = string.Empty;
    public string Environment { get; set; } = string.Empty;
    public long LogsWritten { get; set; }
    public long LogsDropped { get; set; }
    public long ActiveTraces { get; set; }
    public long ActiveSpans { get; set; }
    public double CpuUsagePercent { get; set; }
    public long WorkingSetBytes { get; set; }
    public IReadOnlyDictionary<string, long> Counters { get; set; } = new Dictionary<string, long>();
}

/// <summary>
/// Options for telemetry collection intervals and retention.
/// </summary>
public sealed class TelemetryOptions
{
    public bool Enabled { get; set; } = true;
    public TimeSpan CollectionInterval { get; set; } = TimeSpan.FromSeconds(10);
    public bool IncludeRuntimeMetrics { get; set; } = true;
    public bool IncludeProcessMetrics { get; set; } = true;
    public bool IncludeTraceMetrics { get; set; } = true;
}
