Add agent/common proto and BUILD. (#81)

* Add agent/common proto and BUILD.

* Reorder Language enum.

* Update comments.

* Small fix
pull/83/head
Yang Song 6 years ago committed by GitHub
parent ed45831684
commit c76b7e0632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      opencensus/proto/agent/BUILD.bazel
  2. 96
      opencensus/proto/agent/common/v1/common.proto
  3. 1
      pom.xml

@ -0,0 +1,23 @@
# Copyright 2018, 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"])
proto_library(
name = "common_proto",
srcs = ["common/v1/common.proto"],
deps = [
"@com_google_protobuf//:timestamp_proto",
],
)

@ -0,0 +1,96 @@
// Copyright 2018, 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";
// NOTE: This proto is experimental and is subject to change at this point.
// Please do not use it at the moment.
package opencensus.proto.agent.common.v1;
import "google/protobuf/timestamp.proto";
option java_multiple_files = true;
option java_package = "io.opencensus.proto.agent.common.v1";
option java_outer_classname = "CommonProto";
option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/agentproto/commonproto/v1";
// Identifier metadata of the Node that connects to OpenCensus Agent.
// In the future we plan to extend the identifier proto definition to support
// additional information (e.g cloud id, monitored resource, etc.)
message Node {
// Identifier that uniquely identifies a process within a VM/container.
ProcessIdentifier identifier = 1;
// Information on the OpenCensus Library who initiates the stream.
LibraryInfo library_info = 2;
// Additional informantion on service.
ServiceInfo service_info = 3;
// Additional attributes.
map<string, string> attributes = 4;
// TODO(songya): Add more identifiers in the future as needed, like cloud
// identifiers.
}
// Identifier that uniquely identifies a process within a VM/container.
message ProcessIdentifier {
// The host name. Usually refers to the machine/container name.
// For example: os.Hostname() in Go, socket.gethostname() in Python.
string host_name = 1;
// Process id.
uint32 pid = 2;
// Start time of this ProcessIdentifier. Represented in epoch time.
google.protobuf.Timestamp start_timestamp = 3;
// TODO(songya): Add more fields in the future as needed.
}
// Information on OpenCensus Library.
message LibraryInfo {
enum Language {
LANGUAGE_UNSPECIFIED = 0;
CPP = 1;
C_SHARP = 2;
ERLANG = 3;
GO_LANG = 4;
JAVA = 5;
NODE_JS = 6;
PHP = 7;
PYTHON = 8;
RUBY = 9;
}
// Language of OpenCensus Library.
Language language = 1;
// Version of Agent exporter of Library.
string version = 2;
}
// Additional service information.
message ServiceInfo {
// Name of the service.
string name = 1;
// TODO(songya): add more fields as needed.
}

@ -52,6 +52,7 @@
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
<protoSourceRoot>.</protoSourceRoot>
<includes>
<include>opencensus/proto/agent/*.proto</include>
<include>opencensus/proto/exporter/*.proto</include>
<include>opencensus/proto/stats/*.proto</include>
<include>opencensus/proto/metrics/*.proto</include>

Loading…
Cancel
Save