Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exporters/otlp/recordable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ void Recordable::SetName(nostd::string_view name) noexcept
void Recordable::SetStartTime(opentelemetry::core::SystemTimestamp start_time) noexcept
{
const uint64_t nano_unix_time = start_time.time_since_epoch().count();
span_.set_start_time_unixnano(nano_unix_time);
span_.set_start_time_unix_nano(nano_unix_time);
}

void Recordable::SetDuration(std::chrono::nanoseconds duration) noexcept
{
const uint64_t unix_end_time = span_.start_time_unixnano() + duration.count();
span_.set_end_time_unixnano(unix_end_time);
const uint64_t unix_end_time = span_.start_time_unix_nano() + duration.count();
span_.set_end_time_unix_nano(unix_end_time);
}
} // namespace otlp
} // namespace exporter
Expand Down
4 changes: 2 additions & 2 deletions exporters/otlp/recordable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TEST(Recordable, SetStartTime)
std::chrono::duration_cast<std::chrono::nanoseconds>(start_time.time_since_epoch()).count();

rec.SetStartTime(start_timestamp);
EXPECT_EQ(rec.span().start_time_unixnano(), unix_start);
EXPECT_EQ(rec.span().start_time_unix_nano(), unix_start);
}

TEST(Recordable, SetDuration)
Expand All @@ -66,7 +66,7 @@ TEST(Recordable, SetDuration)
rec.SetStartTime(start_timestamp);
rec.SetDuration(duration);

EXPECT_EQ(rec.span().end_time_unixnano(), unix_end);
EXPECT_EQ(rec.span().end_time_unix_nano(), unix_end);
}
} // namespace otlp
} // namespace exporter
Expand Down
2 changes: 1 addition & 1 deletion third_party/opentelemetry-proto/README
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
From: https://github.com/open-telemetry/opentelemetry-proto
Commit: d496c80b353bc4a4f754ae686b59ca3c41de0946
Commit: e43e1abc40428a6ee98e3bfd79bec1dfa2ed18cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is an API configuration to generate an HTTP/JSON -> gRPC gateway for the
# OpenTelemetry service using github.com/grpc-ecosystem/grpc-gateway.
type: google.api.Service
config_version: 3
http:
rules:
- selector: opentelemetry.proto.collector.metrics.v1.MetricsService.Export
post: /v1/metrics
body: "*"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ http:
- selector: opentelemetry.proto.collector.trace.v1.TraceService.Export
post: /v1/trace
body: "*"
- selector: opentelemetry.proto.collector.metrics.v1.MetricsService.Export
post: /v1/trace
body: "*"
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,57 @@ option java_package = "io.opentelemetry.proto.common.v1";
option java_outer_classname = "CommonProto";
option go_package = "github.com/open-telemetry/opentelemetry-proto/gen/go/common/v1";

// AttributeKeyValue is a key-value pair that is used to store Span attributes, Link
// attributes, etc.
message AttributeKeyValue {
// ValueType is the enumeration of possible types that value can have.
enum ValueType {
STRING = 0;
INT = 1;
DOUBLE = 2;
BOOL = 3;
};

// key part of the key-value pair.
string key = 1;
// AnyValue is used to represent any type of attribute value. AnyValue may contain a
// primitive value such as a string or integer or it may contain an arbitrary nested
// object containing arrays, key-value lists and primitives.
message AnyValue {
// The value is one of the listed fields. It is valid for all values to be unspecified
// in which case this AnyValue is considered to be "null".
oneof value {
string string_value = 1;
bool bool_value = 2;
int64 int_value = 3;
double double_value = 4;
ArrayValue array_value = 5;
KeyValueList kvlist_value = 6;
}
}

// type of the value.
ValueType type = 2;
// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
// since oneof in AnyValue does not allow repeated fields.
message ArrayValue {
// Array of values. The array may be empty (contain 0 elements).
repeated AnyValue values = 1;
}

// Only one of the following fields is supposed to contain data (determined by `type` field).
// This is deliberately not using Protobuf `oneof` for performance reasons (verified by benchmarks).
// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
// are semantically equivalent.
message KeyValueList {
// A collection of key/value pairs of key-value pairs. The list may be empty (may
// contain 0 elements).
repeated KeyValue values = 1;
}

string string_value = 3;
int64 int_value = 4;
double double_value = 5;
bool bool_value = 6;
// KeyValue is a key-value pair that is used to store Span attributes, Link
// attributes, etc.
message KeyValue {
string key = 1;
AnyValue value = 2;
}

// StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version
// of AttributeKeyValue that only supports string values.
// of KeyValue that only supports string values.
message StringKeyValue {
string key = 1;
string value = 2;
}

// InstrumentationLibrary is a message representing the instrumentation library information
// such as the fully qualified name and version.
message InstrumentationLibrary {
string name = 1;
string version = 2;
}
Loading