在Java/Jetty的运行时从我的代码中获得GAE flexible环境中的AppEngine服务名称和版本? [英] AppEngine service name and version in the GAE flexible env from my code at runtime in Java/Jetty?

查看:85
本文介绍了在Java/Jetty的运行时从我的代码中获得GAE flexible环境中的AppEngine服务名称和版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Java 8/Jetty运行时中的运行时从Java代码中获得GAE flexible环境中的AppEngine服务名称和版本?

How do I get the AppEngine service name and version in the GAE flexible env from my Java code at runtime in the Java 8/Jetty runtime?

我需要服务和版本以在GCP上的stackdriver错误报告中填充ServiceContext信息. https://cloud.google.com/error-reporting/docs/formatting -错误消息

I need the service and version to populate the ServiceContext info in the stackdriver error reporting on GCP. https://cloud.google.com/error-reporting/docs/formatting-error-messages

推荐答案

我是Stackdriver Error Reporting产品经理.

I am the Stackdriver Error Reporting product manager.

要回答您的问题: 虽然找不到适合它的清晰文档页面.看来环境变量GAE_MODULE_NAMEGAE_MODULE_VERSION包含您要查找的数据.

To answer your question: While I cannot find a clear documentation page for it. It seems that the environment variables GAE_MODULE_NAME and GAE_MODULE_VERSION contain the data you are looking for.

但是,我们最近更改了在App Engine灵活环境中处理错误的方式:日志条目有效负载中现在不需要自动提取服务名称和版本. serviceContext字段现在在GAE Flex上是可选的.

However, we recently changed how errors are processed on App Engine flexible environment: service name and version are now extracted automatically are not needed in the log entry payload. The serviceContext field is now optional on GAE Flex.

格式化错误消息页面应在接下来的几天以反映这一变化.

The formatting error messages page should be updated in the following days to reflect this change.

这篇关于在Java/Jetty的运行时从我的代码中获得GAE flexible环境中的AppEngine服务名称和版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆