Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where are the allowed log entry protobuf types documented? #1577

Closed
tseaver opened this issue Mar 7, 2016 · 9 comments
Closed

Where are the allowed log entry protobuf types documented? #1577

tseaver opened this issue Mar 7, 2016 · 9 comments
Assignees
Labels
api: logging Issues related to the Cloud Logging API. type: question Request for information or clarification. Not an issue.

Comments

@tseaver
Copy link
Contributor

tseaver commented Mar 7, 2016

The LogEntry API docs say:

The log entry payload, represented as a protocol buffer. You can only use protoPayload values that belong to a set of approved types.

An object containing fields of an arbitrary type. An additional field "@type" contains a URI identifying the type. Example: { "id": 1234, "@type": "types.example.com/standard/id" }.

Where are the allowed protobuf types documented, and the corresponding URIs?

@tseaver tseaver added type: question Request for information or clarification. Not an issue. api: logging Issues related to the Cloud Logging API. labels Mar 7, 2016
@tseaver
Copy link
Contributor Author

tseaver commented Mar 7, 2016

The discovery docs don't provide any more information about the allowed types.

@dhermes
Copy link
Contributor

dhermes commented Mar 8, 2016

👍

@tseaver
Copy link
Contributor Author

tseaver commented Mar 8, 2016

Absent any way to type-check the inputs, I'm thinking we just punt on allowing users to create entries with protoPayload set: we will still parse those created via other services (#1578).

@dhermes
Copy link
Contributor

dhermes commented Mar 9, 2016

Yeah punt until we hear from real users. @jgeewax WDYT?

@jgeewax
Copy link
Contributor

jgeewax commented Mar 25, 2016

That's one option.

Another is that we can do zero client-side checking, send the protobuf as it is. If it's an invalid type it'll get rejected, right ? That might be the better way to go as different versions of the API might allow new types...

@tseaver
Copy link
Contributor Author

tseaver commented Mar 25, 2016

OK, I guess we just use google.protobuf.json_format.MessageToJson to render whatever message is passed, and then re-parse it using json.loads.

I will also add a helper which parses/merges the JSON protoPayload into a user-supplied protobuf messge object using google.protobuf.json_format.Parse, after dumping the value via json.dumps.

@tseaver
Copy link
Contributor Author

tseaver commented Mar 25, 2016

I wish google.protobuf.json_format._AnyMessageToJsonObject wasn't private -- it looks like exactly what I need.

@jgeewax
Copy link
Contributor

jgeewax commented Mar 25, 2016

@tseaver
Copy link
Contributor Author

tseaver commented Mar 29, 2016

Via #1661.

@tseaver tseaver closed this as completed Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants