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

Add agent/common proto and BUILD.#81

Merged
songy23 merged 4 commits intocensus-instrumentation:masterfrom
songy23:agent-common
Aug 28, 2018
Merged

Add agent/common proto and BUILD.#81
songy23 merged 4 commits intocensus-instrumentation:masterfrom
songy23:agent-common

Conversation

@songy23
Copy link
Copy Markdown
Contributor

@songy23 songy23 commented Aug 27, 2018

Separated from #79.

PHP = 6;
PYTHON = 7;
RUBY = 8;
UNKNOWN = 9;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNKNOWN has to be the first one and = 0. See https://developers.google.com/protocol-buffers/docs/proto3#enum look for default value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

}

// Identifier that uniquely identifies a process within a VM/container.
// In the future we plan to extend the identifier proto definition to support
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be for the Node not here. Also service name is already supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, updated.

uint32 pid = 2;

// Represented in epoch time.
google.protobuf.Timestamp timestamp = 3;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/timestamp/start_timestamp?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe consider:
github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1?

proto is already encoded in the "opencensus-proto/gen-go"?

@rakyll @odeke-em any opinion on this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1 looks good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I would prefer to leave the name as-is, since in other protos the Go package names are similar, e.g:
"github.com/census-instrumentation/opencensus-proto/gen-go/traceproto"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change all the package including the one you showed:
"github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
"github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #82 to keep track of this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rakyll @odeke-em any opinion on this?

LGTM!

map<string, string> attributes = 3;

// Additional informantion on service.
ServiceInfo service_info = 4;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move service_info before attributes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

message LibraryInfo {

enum Language {
UNKNOWN = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with other enums in this repo maybe consider LANGUAGE_UNSPECIFIED

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG, done.

// Additional informantion on service.
ServiceInfo service_info = 4;

// TODO(songya): Add more identifiers in the future as needed, like cloud identifiers.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the line length to 80 characters.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@bogdandrutu
Copy link
Copy Markdown
Contributor

@songy23 I think you can merge this PR (maybe include my suggestion or not) and we can get the feedback later. don't want to block you on that.

@songy23
Copy link
Copy Markdown
Contributor Author

songy23 commented Aug 28, 2018

Thanks!

@songy23 songy23 merged commit c76b7e0 into census-instrumentation:master Aug 28, 2018
@songy23 songy23 deleted the agent-common branch August 28, 2018 16:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants