Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Add Resource to Span (#174)
Browse files Browse the repository at this point in the history
* Add Resource to Span

* Add missing import

* Update to correct id and increment next id

* PR comments

* Add resource to bazel build dep

* Add another dependency

* PR comments
  • Loading branch information
Steven Karis authored and Bogdan Drutu committed Jan 25, 2019
1 parent 6d79e46 commit fb7c17e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/opencensus/proto/agent/common/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ option java_outer_classname = "CommonProto";

option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1";

// Identifier metadata of the Node (Application instrumented with OpenCensus)
// that connects to OpenCensus Agent.
// Identifier metadata of the Node that produces the span or tracing data.
// Note, this is not the metadata about the Node or service that is described by associated spans.
// In the future we plan to extend the identifier proto definition to support
// additional information (e.g cloud id, etc.)
message Node {
Expand Down
2 changes: 2 additions & 0 deletions src/opencensus/proto/trace/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ proto_library(
deps = [
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"//opencensus/proto/resource/v1:resource_proto",
],
)

Expand Down Expand Up @@ -58,6 +59,7 @@ go_proto_library(
deps = [
"@com_github_golang_protobuf//ptypes/timestamp:go_default_library",
"@com_github_golang_protobuf//ptypes/wrappers:go_default_library",
"//opencensus/proto/resource/v1:resource_proto_go",
],
)

Expand Down
8 changes: 7 additions & 1 deletion src/opencensus/proto/trace/v1/trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package opencensus.proto.trace.v1;

import "opencensus/proto/resource/v1/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

Expand All @@ -33,7 +34,7 @@ option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/t
// multiple root spans, or none at all. Spans do not need to be
// contiguous - there may be gaps or overlaps between spans in a trace.
//
// The next id is 16.
// The next id is 17.
// TODO(bdrutu): Add an example.
message Span {
// A unique identifier for a trace. All spans from the same trace share
Expand Down Expand Up @@ -290,6 +291,11 @@ message Span {
// Status.Ok (code = 0).
Status status = 11;

// An optional resource that is associated with this span. If not set, this span
// should be part of a batch that does include the resource information, unless resource
// information is unknown.
opencensus.proto.resource.v1.Resource resource = 16;

// A highly recommended but not required flag that identifies when a
// trace crosses a process boundary. True when the parent_span belongs
// to the same process as the current span. This flag is most commonly
Expand Down

0 comments on commit fb7c17e

Please sign in to comment.