pull/172/merge
Bogdan Drutu 6 years ago committed by GitHub
commit 75b356e97b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/opencensus/proto/stats/v1/BUILD.bazel
  2. 12
      src/opencensus/proto/stats/v1/stats.proto
  3. 41
      src/opencensus/proto/tags/v1/BUILD.bazel
  4. 82
      src/opencensus/proto/tags/v1/tags.proto

@ -20,6 +20,7 @@ proto_library(
name = "stats_proto",
srcs = ["stats.proto"],
deps = [
"//opencensus/proto/tags/v1:tags_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:timestamp_proto",
],
@ -37,9 +38,10 @@ java_proto_library(
go_proto_library(
name = "stats_proto_go",
proto = ":stats_proto",
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/stats/v1",
proto = ":stats_proto",
deps = [
"//opencensus/proto/tags/v1:tags_proto_go",
"@com_github_golang_protobuf//ptypes/timestamp:go_default_library",
],
)

@ -17,6 +17,7 @@ syntax = "proto3";
package opencensus.proto.stats.v1;
import "google/protobuf/timestamp.proto";
import "opencensus/proto/tags/v1/tags.proto";
option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/stats/v1";
@ -24,13 +25,6 @@ option java_multiple_files = true;
option java_package = "io.opencensus.proto.stats.v1";
option java_outer_classname = "StatsProto";
// TODO(bdrutu): Consider if this should be moved to a "tags" directory to match the API structure.
message Tag {
string key = 1;
string value = 2;
}
// Measure .
message Measure {
// A string by which the measure will be referred to, e.g. "rpc_server_latency". Names MUST be
// unique within the library.
@ -70,7 +64,7 @@ message View {
// An array of tag keys. These values associated with tags of this name form the basis by which
// individual stats will be aggregated (one aggregation per unique tag value). If none are
// provided, then all data is recorded in a single aggregation.
repeated string columns = 4;
repeated opencensus.proto.tags.v1.TagKey columns = 4;
// The description of the aggregation used for this view which describes how data collected are
// aggregated.
@ -119,7 +113,7 @@ message DistributionAggregation {
// Describes a data point to be collected for a Measure.
message Measurement {
repeated Tag tags = 1;
opencensus.proto.tags.v1.TagMap tag_map = 1;
// The name of the measure to which the value is applied.
string measure_name = 2;

@ -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…
Cancel
Save