// Copyright 2025 Envoy Project Authors
//
// 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.

syntax = "proto3";

package envoy.extensions.tracers.opentelemetry.samplers.v3;

import "envoy/config/core/v3/http_service.proto";

import "udpa/annotations/status.proto";

option java_package = "io.envoyproxy.envoy.extensions.tracers.opentelemetry.samplers.v3";
option java_outer_classname = "DynatraceSamplerProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/tracers/opentelemetry/samplers/v3;samplersv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Dynatrace Sampler config]

// Configuration for the Dynatrace Sampler extension.
// [#extension: envoy.tracers.opentelemetry.samplers.dynatrace]
message DynatraceSamplerConfig {
  // The Dynatrace tenant.
  //
  // The value can be obtained from the Envoy deployment page in Dynatrace.
  string tenant = 1;

  // The id of the Dynatrace cluster id.
  //
  // The value can be obtained from the Envoy deployment page in Dynatrace.
  int32 cluster_id = 2;

  // The HTTP service to fetch the sampler configuration from the Dynatrace API (root spans per minute). For example:
  //
  // .. code-block:: yaml
  //
  //    http_service:
  //      http_uri:
  //        cluster: dynatrace
  //        uri: <tenant>.dev.dynatracelabs.com/api/v2/samplingConfiguration
  //        timeout: 10s
  //      request_headers_to_add:
  //      - header:
  //          key : "authorization"
  //          value: "Api-Token dt..."
  //
  config.core.v3.HttpService http_service = 3;

  // Default number of root spans per minute, used when the value can't be obtained from the Dynatrace API.
  //
  // A default value of ``1000`` is used when:
  //
  // - ``root_spans_per_minute`` is unset
  // - ``root_spans_per_minute`` is set to 0
  //
  uint32 root_spans_per_minute = 4;
}
