// Copyright 2024, OpenTelemetry 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 opentelemetry.proto.collector.profiles.v1development;

import "./profiles.proto";

option csharp_namespace = "OpenTelemetry.Proto.Collector.Profiles.V1Development";
option java_multiple_files = true;
option java_package = "io.opentelemetry.proto.collector.profiles.v1development";
option java_outer_classname = "ProfilesServiceProto";
option go_package = "go.opentelemetry.io/proto/otlp/collector/profiles/v1development";

// Service that can be used to push profiles between one Application
// instrumented with OpenTelemetry and a collector, or between a collector and a
// central collector.
service ProfilesService {
  // For performance reasons, it is recommended to keep this RPC
  // alive for the entire life of the application.
  rpc Export(ExportProfilesServiceRequest) returns (ExportProfilesServiceResponse) {}
}

message ExportProfilesServiceRequest {
  // An array of ResourceProfiles.
  repeated opentelemetry.proto.profiles.v1development.ResourceProfiles resource_profiles = 1;
}

message ExportProfilesServiceResponse {
  // The details of a partially successful export request.
  ExportProfilesPartialSuccess partial_success = 1;
}

// ExportProfilesPartialSuccess is used when some profiles in the request could not be processed.
message ExportProfilesPartialSuccess {
  // The number of rejected profiles.
  int64 rejected_profiles = 1;

  // A developer-facing human-readable message.
  string error_message = 2;
}
