/// <summary>
        /// Initializes a new instance of the <see cref="PrometheusExporter"/> class.
        /// </summary>
        /// <param name="options">Options for the exporter.</param>
        public PrometheusExporter(PrometheusExporterOptions options)
        {
            this.Options = options;

            if (options.StartHttpListener)
            {
                try
                {
                    this.metricsHttpServer = new PrometheusExporterMetricsHttpServer(this);
                    this.metricsHttpServer.Start();
                }
                catch (Exception ex)
                {
                    throw new InvalidOperationException(HttpListenerStartFailureExceptionMessage, ex);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrometheusExporter"/> class.
 /// </summary>
 /// <param name="options">Options for the exporter.</param>
 public PrometheusExporter(PrometheusExporterOptions options)
 {
     this.Options = options;
 }