GeezerVison is showing github.com (truncated) — Fix : moving instance_name logging to log entry label by jabubake · Pull Request #2011 · googleapis/google-cloud-java
Conversation
#1994 removing unsupported resource labels for standard, flex
Adding instance_name to log entries instead of resource for Flex.
@meltsufin
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
removing unsupported resource labels for standard, flex
|

Changes Unknown when pulling 7d2d3ef on jabubake:flex_logging_fix into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@meltsufin I've build @jabubake's branch locally and run the GoogleCloudPlatform/jetty-runtime#81 against it. The exception is gone and I can see the correct logs in the console - however the remote tests are failing as the logs are not being found by the API calls the test has made, so perhaps the filter is now wrong against the labels used.
tl;dr; It's fixed the #1994 issue but I need to check if other labels are missing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Greg, Mike,
The trace id label is now just trace_id , I noticed the naming was done
more in the format of logging v1 labels, so I moved them to v2 style with
URL not being in the label name. I also wanted to set it standardized to
not be tied to app engine in the URL.
Let me know if this is an issue
…
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@jabubake Ah thanks. Updating my tests and redeploying now...
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@jabubake @meltsufin the branch works fine with my tests now that I have updated the traceId and instance_name checks.
However, I do not know if the shorter name will prevent the log console from matching the nginx log entries (which still use the long name) with the gae_log entries. The matching is currently not working for other reasons so I cannot test.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@meltsufin , @gregw : given the complexity, I'll update this for now to be in sync with what used to exist. We can take the rename to shorter v2 type versions in a separate CL.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling 51131e4 on jabubake:flex_logging_fix into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@garrettjonesgoogle : the changes address the bug fix to resource labels and also reverting to the currently supported Stackdriver API name for trace_id. ptal.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
}
|
|
|
}
|
|
|
|
|
|
private static String appEngineLabelPrefix = "appengine.googleapis.com/";
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
// Trace logging enhancer is supported on GAE Flex and Standard.
|
|
|
case GaeAppStandard:
|
|
|
case GaeAppFlex:
|
|
|
enhancers = new ArrayList<>();
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
* are restricted to a supported set per resource.
|
|
|
* @see <a href="https://cloud.google.com/logging/docs/api/v2/resource-list">Logging Labels</a>
|
|
|
*/
|
|
|
static class LabelLoggingEnhancer implements LoggingEnhancer {
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
/* Adds tracing support for logging with thread-local trace ID tracking. */
|
|
|
public class TraceLoggingEnhancer implements LoggingEnhancer {
|
|
|
|
|
|
String prefix;
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@vam-google I added some comments - could you finish the review?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling 33bccbd on jabubake:flex_logging_fix into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, all comments are optional but please consider making the suggested changes.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
private static List<LoggingEnhancer> getEnhancers(Resource resourceType) {
|
|
|
List<LoggingEnhancer> enhancers;
|
|
|
List<LoggingEnhancer> enhancers = new ArrayList<>();
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
enhancers.add(new TraceLoggingEnhancer(APPENGINE_LABEL_PREFIX));
|
|
|
break;
|
|
|
default:
|
|
|
enhancers = Collections.emptyList();
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -193,18 +195,47 @@ private static String getAppEngineInstanceName() { |
|
|
}
|
|
|
|
|
|
private static List<LoggingEnhancer> getEnhancers(Resource resourceType) {
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (posting 2 more comments)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
String prefix;
|
|
|
List<Label> labels;
|
|
|
|
|
|
LabelLoggingEnhancer(String prefix, List<Label> labels) {
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
* are restricted to a supported set per resource.
|
|
|
* @see <a href="https://cloud.google.com/logging/docs/api/v2/resource-list">Logging Labels</a>
|
|
|
*/
|
|
|
private static class LabelLoggingEnhancer implements LoggingEnhancer {
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling 8936d80 on jabubake:flex_logging_fix into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling bf7b47b on jabubake:flex_logging_fix into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
*/
|
|
|
private static class LabelLoggingEnhancer implements LoggingEnhancer {
|
|
|
|
|
|
Map<String, String> labels;
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling c2fc97a on jabubake:flex_logging_fix into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|