/**
 * The OpenTelemetry Metrics Writer feature allows Icinga 2 to export metrics from performance
 * data to an OpenTelemetry Collector or compatible backend.
 *
 * For more information, see the official documentation:
 * https://icinga.com/docs/icinga-2/latest/doc/14-features/#otlpmetrics-writer
 */
object OTLPMetricsWriter "otlp-metrics" {
  // host = "127.0.0.1"
  // port = 4318
  // metrics_endpoint = "/v1/metrics"
  # Optionally, you can set a namespace to be used as OTel service.namespace attribute for all exported metrics.
  // service_namespace = "icinga"

  # By default, basic AUTH is disabled. Uncomment and set the following lines to enable it.
  // basic_auth = {
  //   username = "otel_user"
  //   password = "otel_password"
  // }

  # You can also add custom tags to the exported metrics based on host and service variables.
  # These tags will be included in the OTel metrics as resource attributes for hosts and services, respectively.
  # By default, no additional tags are added. Adjust the templates as needed to include the desired variables.
  // host_resource_attributes = {
  //   "host.vars.env" = "$host.vars.env$"
  //   "host.vars.os" = "$host.vars.os$"
  // }
  // service_resource_attributes = {
  //   "service.vars.env" = "$service.vars.env$"
  //   "service.vars.os" = "$service.vars.os$"
  // }

  # These are the default settings used by the OTel writer. Adjust them as needed.
  # Please refer to the documentation for more details on each option.
  // enable_ha = true
  // flush_interval = 15s
  // flush_threshold = 16*1024*1024
  # When stopping Icinga 2, this timeout defines how long to wait for any pending OTel
  # metrics to be sent before disconnecting and discarding them.
  // disconnect_timeout = 10s

  # Allow the OTLP writer to send the check thresholds as OTel metrics to the configured endpoint.
  # By default, this is disabled but you can enable it to have the thresholds available in the `state_check.threshold` OTel metric.
  // enable_send_thresholds = false

  # You can enable TLS encryption by uncommenting and configuring the following options.
  # By default, the OTel writer uses unencrypted connections (plain HTTP requests).
  // enable_tls = false
  // tls_insecure_noverify = false
  // tls_ca_file = "/path/to/otel/ca.crt"
  // tls_cert_file = "/path/to/otel/client.crt"
  // tls_key_file = "/path/to/otel/client.key"
}
