Skip to content

Commit

Permalink
updated with public opt
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-b committed Jul 5, 2023
1 parent c0531b5 commit 6a4bf59
Show file tree
Hide file tree
Showing 15 changed files with 712 additions and 712 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ PROTO_FILES=($(ls opentelemetry/proto/*/*/*/*.proto opentelemetry/proto/*/*/*.pr
# generate swift proto files
for file in "${PROTO_FILES[@]}"
do
protoc --swift_out=./out ${file}
protoc --swift_opt=Visibility=Public --swift_out=./out ${file}
done
# genearate GRPC swift proto files
protoc --swift_out=./out --grpc-swift_out=./out opentelemetry/proto/collector/trace/v1/trace_service.proto
protoc --swift_out=./out --grpc-swift_out=./out opentelemetry/proto/collector/metrics/v1/metrics_service.proto
protoc --swift_out=./out --grpc-swift_out=./out opentelemetry/proto/collector/logs/v1/logs_service.proto
protoc --swift_opt=Visibility=Public --grpc-swift_opt=Visibility=Public --swift_out=./out --grpc-swift_out=./out opentelemetry/proto/collector/trace/v1/trace_service.proto
protoc --swift_opt=Visibility=Public --grpc-swift_opt=Visibility=Public --swift_out=./out --grpc-swift_out=./out opentelemetry/proto/collector/metrics/v1/metrics_service.proto
protoc --swift_opt=Visibility=Public --grpc-swift_opt=Visibility=Public --swift_out=./out --grpc-swift_out=./out opentelemetry/proto/collector/logs/v1/logs_service.proto
```
Replace the generated files in `Sources/Exporters/OpenTelemetryProtocolCommon/proto` & `Sources/Exporters/OpenTelemetryGrpc/proto`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
import OpenTelemetryApi
import OpenTelemetrySdk
public class LogRecordAdapter {
static func toProtoResourceRecordLog(logRecordList: [ReadableLogRecord]) -> [Opentelemetry_Proto_Logs_V1_ResourceLogs] {
public static func toProtoResourceRecordLog(logRecordList: [ReadableLogRecord]) -> [Opentelemetry_Proto_Logs_V1_ResourceLogs] {
let resourceAndScopeMap = groupByResourceAndScope(logRecordList: logRecordList)
var resourceLogs = [Opentelemetry_Proto_Logs_V1_ResourceLogs]()
resourceAndScopeMap.forEach { resMap in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public enum MetricsAdapter {
return resourceMetrics
}

static func toProtoResourceMetrics(metricDataList: [Metric]) -> [Opentelemetry_Proto_Metrics_V1_ResourceMetrics] {
public static func toProtoResourceMetrics(metricDataList: [Metric]) -> [Opentelemetry_Proto_Metrics_V1_ResourceMetrics] {
let resourceAndScopeMap = groupByResouceAndScope(metricDataList: metricDataList)
var resourceMetrics = [Opentelemetry_Proto_Metrics_V1_ResourceMetrics]()

Expand Down
120 changes: 60 additions & 60 deletions Sources/Exporters/OpenTelemetryProtocolCommon/proto/common.pb.swift

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions Sources/Exporters/OpenTelemetryProtocolCommon/proto/logs.pb.swift

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
typealias Version = _2
}

struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest {
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -44,14 +44,14 @@ struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest {
/// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
/// data from multiple origins typically batch the data before forwarding further and
/// in that case this array will contain multiple elements.
var resourceLogs: [Opentelemetry_Proto_Logs_V1_ResourceLogs] = []
public var resourceLogs: [Opentelemetry_Proto_Logs_V1_ResourceLogs] = []

var unknownFields = SwiftProtobuf.UnknownStorage()
public var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
public init() {}
}

struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse {
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -71,23 +71,23 @@ struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse {
/// A `partial_success` message with an empty value (rejected_<signal> = 0 and
/// `error_message` = "") is equivalent to it not being set/present. Senders
/// SHOULD interpret it the same way as in the full success case.
var partialSuccess: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
public var partialSuccess: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
get {return _partialSuccess ?? Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess()}
set {_partialSuccess = newValue}
}
/// Returns true if `partialSuccess` has been explicitly set.
var hasPartialSuccess: Bool {return self._partialSuccess != nil}
public var hasPartialSuccess: Bool {return self._partialSuccess != nil}
/// Clears the value of `partialSuccess`. Subsequent reads from it will return its default value.
mutating func clearPartialSuccess() {self._partialSuccess = nil}
public mutating func clearPartialSuccess() {self._partialSuccess = nil}

var unknownFields = SwiftProtobuf.UnknownStorage()
public var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
public init() {}

fileprivate var _partialSuccess: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess? = nil
}

struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -96,7 +96,7 @@ struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
///
/// A `rejected_<signal>` field holding a `0` value indicates that the
/// request was fully accepted.
var rejectedLogRecords: Int64 = 0
public var rejectedLogRecords: Int64 = 0

/// A developer-facing human-readable message in English. It should be used
/// either to explain why the server rejected parts of the data during a partial
Expand All @@ -105,11 +105,11 @@ struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
///
/// error_message is an optional field. An error_message with an empty value
/// is equivalent to it not being set.
var errorMessage: String = String()
public var errorMessage: String = String()

var unknownFields = SwiftProtobuf.UnknownStorage()
public var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
public init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
Expand All @@ -123,12 +123,12 @@ extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess: @unche
fileprivate let _protobuf_package = "opentelemetry.proto.collector.logs.v1"

extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".ExportLogsServiceRequest"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
public static let protoMessageName: String = _protobuf_package + ".ExportLogsServiceRequest"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "resource_logs"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
Expand All @@ -140,27 +140,27 @@ extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest: SwiftP
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.resourceLogs.isEmpty {
try visitor.visitRepeatedMessageField(value: self.resourceLogs, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest, rhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest) -> Bool {
public static func ==(lhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest, rhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest) -> Bool {
if lhs.resourceLogs != rhs.resourceLogs {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".ExportLogsServiceResponse"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
public static let protoMessageName: String = _protobuf_package + ".ExportLogsServiceResponse"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "partial_success"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
Expand All @@ -172,7 +172,7 @@ extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse: Swift
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every if/case branch local when no optimizations
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
Expand All @@ -183,21 +183,21 @@ extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse: Swift
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse, rhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse) -> Bool {
public static func ==(lhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse, rhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse) -> Bool {
if lhs._partialSuccess != rhs._partialSuccess {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".ExportLogsPartialSuccess"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
public static let protoMessageName: String = _protobuf_package + ".ExportLogsPartialSuccess"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "rejected_log_records"),
2: .standard(proto: "error_message"),
]

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
Expand All @@ -210,7 +210,7 @@ extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess: SwiftP
}
}

func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if self.rejectedLogRecords != 0 {
try visitor.visitSingularInt64Field(value: self.rejectedLogRecords, fieldNumber: 1)
}
Expand All @@ -220,7 +220,7 @@ extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess: SwiftP
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess, rhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess) -> Bool {
public static func ==(lhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess, rhs: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess) -> Bool {
if lhs.rejectedLogRecords != rhs.rejectedLogRecords {return false}
if lhs.errorMessage != rhs.errorMessage {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
Expand Down
Loading

0 comments on commit 6a4bf59

Please sign in to comment.