-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Missing protobuf descriptor: google.appengine.logging.v1.RequestLog #2572
Comments
@bjwatson Is there some kind of automated conversion for |
@bjwatson Do you know how types get registered with The GAE protos don't have the /cc @waprin @jonparrott |
@Fkawala Sorry I missed this and focused on the wrong thing. Why are you manually specifying the contents of the protobuf? The implementation expects usage of "registered" types, and the failure is due to the fact that the type URL you used is not in the registry in |
@dhermes I got the idea here. How could I list the URL in the registry? This PB type is rendered in a particularly convenient way in the Google cloud log browser. |
@Fkawala It's probably not something you want to do. Seems Why do you want to add logs that you copy-pasted from a browser? |
@bjwatson What do you think is the right answer here? The message is essentially an |
@dhermes A side note, the code I provided works with gcloud-python 0.18.3. I wonder where I could find the actual descriptor for this PB type, any hints ? |
Whoa, that's surprising. Let me check it out! |
I confirmed this. Differences in deps are:
Both use: |
@bjwatson This is really crazy, do you think somehow the |
@dhermes Like you said earlier, it looks like only the gRPC-generated code ( @Fkawala Looks like we need to add I don't know why this worked for you in an earlier version of |
@Fkawala This is almost fixed. Once googleapis/api-client-staging#89 is approved by @geigerj, I will publish a new version of https://pypi.python.org/pypi/googleapis-common-protos containing the |
@Fkawala This should now be fixed by the |
@dhermes Please see the discussion in googleapis/packman#147. I am wondering why Note that these links point at the |
@bjwatson The two lines you linked don't always follow one another. The conversion to JSON is nominally for sending an HTTP request, but may be repurposed in the gRPC code as well. It may end up parsed back to protobuf in the gRPC case because @tseaver was trying to minimize the parsing code, so at times was converting PBs as JSON resources to avoid repeating code. Also
I and @jonparrott have said it doesn't belong there. A true "fix" could be for |
@dhermes Thanks. I better understand the design of I'm surprised by your objection to putting I published |
@bjwatson It's not a problem that it's in there, it just isn't a "common" proto, that's all. |
@dhermes and I discussed offline. I see his point that these messages could be in their own separate package, like |
@bjwatson thanks ! |
Just been hit by this myself for the past few days when trying to use the cloud logging api |
@lukesneeringer @bjwatson I can update googleapis/googleapis#226 and googleapis/api-client-staging#144 and have a new |
Just discussed with @geigerj offline, and based on #2572 (comment), I am pretty sure we should not do that. It would just move the problem, because as soon as you installed that package, oauth2client would think you were on GAE. |
@lukesneeringer @geigerj This seems like a P1 issue given the user impact. I assigned to Luke; feel free to re-assign to Jacob if you prefer. |
@jonparrott Do you have thoughts on the right way to handle this? |
@bjwatson good news and bad news:
If the extra types library can have an import path that doesn't start with |
The fix is to loosen the way we parse |
Duplicate of #2674 |
Thanks for investigating and pushing for this @Fkawala, I see dhermes has added support for But François I was curious how you accumulate your application logs? If you've already built that, I'd love to take a peek (if possible!), to save me the trouble of digging into the complexity of python loggers, handlers, exclusions, etc. Thanks! |
@mikelambert Have you seen the "getting started" doc for logging? https://googlecloudplatform.github.io/google-cloud-python/stable/logging-usage.html |
Yup, it's quite helpful, but didn't quite answer the above for me. My confusion was more about python's logging system. If I dig into import logging
import google.cloud.logging
client = google.cloud.logging.Client()
class AggregatingHandler(logging.StreamHandler):
def __init__(self):
super(AggregatingHandler, self).__init__()
self.logs = []
def emit(self, record):
self.logs.append(record)
def build_request_proto(logs):
pass # ...
def aggregated_logging_middleware(app):
def wsgi_app(environ, start_response):
logger = logging.getLogger()
handler = AggregatingHandler()
logger.addHandler(handler)
try:
return app(environ, start_response)
finally:
cloud_logger = client.logger('aggregated_logs')
cloud_logger.log_proto(build_request_proto(handler.logs))
logger.removeHandler(handler)
return wsgi_app I was just hoping to save the time of writing and testing this, if Francois had already done it, since it looks like he's trying to do the same thing I am. I'm already spending enough time reimplementing GAE Standard features, so I can migrate off the now-deprecated Managed VMs onto Flexible VMs, trying to leverage work where I can. :) |
Ah I see, maybe @waprin can give some pointers there. |
Hi @mikelambert, for some reason I missed the notifications from this thread. Sorry. I doubt that you still need help on this topic, but just in case here is some information. My current solution (which I wrote when the PB issue wasn't solved) does not rely on the More precisely, I use If you need it I might be able to share the source, but I'll I have to check with my company first, let me know. |
One of my motivations for working with @Fkawala by looking at your example I guess this was also your motivation. Have you succeeded with multiple In any case I would love if could share your working source code. Thanks. |
@eyalev I was digging into PB logging for the exact same reason :) From what I understood back then PB logging was the only way to achieve that. Note that the google cloud support team kindly suggested me not to spent to much time on that because it is hackish and the log viewer might change without notice. Also, when I opened the issue I was quite short on time so I moved to |
Even if this solution will work for a few months I'm ok with it. If/when it will break I will update to a new solution or fallback to the current setup. From my experience with GCP timelines I'm guessing I have at least a year :) BTW, currently when using |
hi! i've hit this recently too, with google-cloud-logging 1.14.0 and googleapis-common-protos 1.6.0:
we've been discussing this on the google-appengine group and StackOverflow. i've tried to follow the discussions here and in #2674, but i can't tell what the conclusion is. anyone know how i can fix this? |
i ended up generating my own obviously not ideal, i'd rather use an official version of that file maintained by Google instead, but this is an ok workaround in the meantime. |
Hello,
To send a protobuf RequestLog entry through the stackdriver logging facility fails with the error stack below.
The protobuf is created / sent as follows:
This gist provides a docker test environment.
Is this a bug or am I missing something ?
François.
The text was updated successfully, but these errors were encountered: