Merge 879ea3afc6
into d5d80953a8
commit
75b356e97b
4 changed files with 129 additions and 10 deletions
@ -0,0 +1,41 @@ |
||||
# Copyright 2019, OpenCensus 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. |
||||
|
||||
package(default_visibility = ["//visibility:public"]) |
||||
|
||||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") |
||||
|
||||
proto_library( |
||||
name = "tags_proto", |
||||
srcs = ["tags.proto"], |
||||
) |
||||
|
||||
cc_proto_library( |
||||
name = "tags_proto_cc", |
||||
deps = [":tags_proto"], |
||||
) |
||||
|
||||
java_proto_library( |
||||
name = "tags_proto_java", |
||||
deps = [":tags_proto"], |
||||
) |
||||
|
||||
go_proto_library( |
||||
name = "tags_proto_go", |
||||
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/tags/v1", |
||||
proto = ":tags_proto", |
||||
deps = [ |
||||
"@com_github_golang_protobuf//ptypes/timestamp:go_default_library", |
||||
], |
||||
) |
@ -0,0 +1,82 @@ |
||||
// Copyright 2019, OpenCensus 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 opencensus.proto.tags.v1; |
||||
|
||||
option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/tags/v1"; |
||||
|
||||
option java_multiple_files = true; |
||||
option java_package = "io.opencensus.proto.tags.v1"; |
||||
option java_outer_classname = "TagsProto"; |
||||
|
||||
// TagScope is used to determine the scope of a Tag. |
||||
// |
||||
// |
||||
enum TagScope { |
||||
// Unknown type. |
||||
TYPE_UNSPECIFIED = 0; |
||||
// Tag with Local scope are used within the process it created. |
||||
LOCAL_SCOPE = 1; |
||||
// A tag is created with the Request scope then it is propagated across |
||||
// process boundaries subject to outgoing and incoming (on remote side) |
||||
// filter criteria. |
||||
REQUEST_SCOPE = 2; |
||||
} |
||||
|
||||
// TagKey is the name of the Tag. |
||||
message TagKey { |
||||
// Restrictions: |
||||
// * MUST contain only printable ASCII (codes between 32 and 126 inclusive) |
||||
// * MUST have length greater than zero and less than 256. |
||||
// * MUST not be empty. |
||||
// |
||||
// This field is required. |
||||
string value = 1; |
||||
} |
||||
|
||||
// TagValue is the value associated with a Tag. |
||||
message TagValue { |
||||
// It MUST contain only printable ASCII (codes between 32 and 126) |
||||
// |
||||
// This field is required. |
||||
string value = 1; |
||||
} |
||||
|
||||
// A Tag consists of TagScope, TagKey, and TagValue. |
||||
message Tag { |
||||
// This field is required. |
||||
TagKey key = 1; |
||||
|
||||
// This field is required. |
||||
TagValue value = 2; |
||||
|
||||
// This field is optional, if not present the default scope is REQUEST_SCOPE |
||||
// (the motivation is backwards compatibility). |
||||
// |
||||
// This field is only needed for data generation and tags defining cases, not |
||||
// for exporting. |
||||
TagScope scope = 3; |
||||
} |
||||
|
||||
// TagMap is an abstract data type that represents collection of tags. i.e., |
||||
// each key is associated with exactly one value. |
||||
message TagMap { |
||||
// The list of tags MUST contains unique TagKeys. |
||||
// |
||||
// Not a map becuase the proto3 map does not allow a message as the key. |
||||
// https://developers.google.com/protocol-buffers/docs/proto3#maps |
||||
repeated Tag tags = 1; |
||||
} |
Loading…
Reference in new issue