/*
 * Copyright 2026 Snowflake Inc.
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <string>

#include "snowflake/ingest/streaming/result.hpp"

namespace snowflake::ingest::streaming {

/// Options for initializing the Snowflake Streaming Ingest SDK runtime.
struct sdk_options {
  /// Log verbosity: "trace", "debug", "info", "warn", "error".
  std::string log_level = "info";

  /// IP address the metrics server binds to (only used when enable_prometheus
  /// is true).
  std::string metrics_ip = "127.0.0.1";

  /// Port the metrics server listens on (only used when enable_prometheus is
  /// true).
  std::string metrics_port = "50000";

  /// Enable the Prometheus metrics endpoint.
  bool enable_prometheus = false;

  /// When true (default), read pod-level memory and CPU limits from cgroup
  /// files if the process is detected to be running inside a Kubernetes pod.
  /// Set to false to always use system-level metrics instead.
  bool check_kubectl_memory = true;
};

/// Initialize the SDK runtime.  Must be called once before any client::create()
/// call.  The first call starts the Rust async runtime, logging, and optional
/// metrics subsystems.  Subsequent calls are no-ops that return the cached
/// result of the first call (options from later calls are ignored).
result<void> initialize(const sdk_options& options = {});

}  // namespace snowflake::ingest::streaming
