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

Commit c76b7e0

Browse files
authored
Add agent/common proto and BUILD. (#81)
* Add agent/common proto and BUILD. * Reorder Language enum. * Update comments. * Small fix
1 parent ed45831 commit c76b7e0

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed

opencensus/proto/agent/BUILD.bazel

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2018, OpenCensus Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
package(default_visibility = ["//visibility:public"])
16+
17+
proto_library(
18+
name = "common_proto",
19+
srcs = ["common/v1/common.proto"],
20+
deps = [
21+
"@com_google_protobuf//:timestamp_proto",
22+
],
23+
)
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// Copyright 2018, OpenCensus Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
// NOTE: This proto is experimental and is subject to change at this point.
18+
// Please do not use it at the moment.
19+
20+
package opencensus.proto.agent.common.v1;
21+
22+
import "google/protobuf/timestamp.proto";
23+
24+
option java_multiple_files = true;
25+
option java_package = "io.opencensus.proto.agent.common.v1";
26+
option java_outer_classname = "CommonProto";
27+
28+
option go_package = "github.com/census-instrumentation/opencensus-proto/gen-go/agentproto/commonproto/v1";
29+
30+
// Identifier metadata of the Node that connects to OpenCensus Agent.
31+
// In the future we plan to extend the identifier proto definition to support
32+
// additional information (e.g cloud id, monitored resource, etc.)
33+
message Node {
34+
// Identifier that uniquely identifies a process within a VM/container.
35+
ProcessIdentifier identifier = 1;
36+
37+
// Information on the OpenCensus Library who initiates the stream.
38+
LibraryInfo library_info = 2;
39+
40+
// Additional informantion on service.
41+
ServiceInfo service_info = 3;
42+
43+
// Additional attributes.
44+
map<string, string> attributes = 4;
45+
46+
// TODO(songya): Add more identifiers in the future as needed, like cloud
47+
// identifiers.
48+
}
49+
50+
// Identifier that uniquely identifies a process within a VM/container.
51+
message ProcessIdentifier {
52+
53+
// The host name. Usually refers to the machine/container name.
54+
// For example: os.Hostname() in Go, socket.gethostname() in Python.
55+
string host_name = 1;
56+
57+
// Process id.
58+
uint32 pid = 2;
59+
60+
// Start time of this ProcessIdentifier. Represented in epoch time.
61+
google.protobuf.Timestamp start_timestamp = 3;
62+
63+
// TODO(songya): Add more fields in the future as needed.
64+
}
65+
66+
// Information on OpenCensus Library.
67+
message LibraryInfo {
68+
69+
enum Language {
70+
LANGUAGE_UNSPECIFIED = 0;
71+
CPP = 1;
72+
C_SHARP = 2;
73+
ERLANG = 3;
74+
GO_LANG = 4;
75+
JAVA = 5;
76+
NODE_JS = 6;
77+
PHP = 7;
78+
PYTHON = 8;
79+
RUBY = 9;
80+
}
81+
82+
// Language of OpenCensus Library.
83+
Language language = 1;
84+
85+
// Version of Agent exporter of Library.
86+
string version = 2;
87+
}
88+
89+
// Additional service information.
90+
message ServiceInfo {
91+
92+
// Name of the service.
93+
string name = 1;
94+
95+
// TODO(songya): add more fields as needed.
96+
}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
5353
<protoSourceRoot>.</protoSourceRoot>
5454
<includes>
55+
<include>opencensus/proto/agent/*.proto</include>
5556
<include>opencensus/proto/exporter/*.proto</include>
5657
<include>opencensus/proto/stats/*.proto</include>
5758
<include>opencensus/proto/metrics/*.proto</include>

0 commit comments

Comments
 (0)