add zone to GAE Flex logging enhancer#1589
add zone to GAE Flex logging enhancer#1589garrettjonesgoogle merged 11 commits intogoogleapis:masterfrom
Conversation
|
@garrettjonesgoogle Can you please take a look? |
|
There is a release going out on Tuesday that I don't want to destabilize; I'll take a look after that goes out. |
garrettjonesgoogle
left a comment
There was a problem hiding this comment.
BTW, someone pointed out that LoggingHandler.Enhancer is package-private. Could you make it public in this PR?
| try { | ||
| HttpURLConnection metadata = (HttpURLConnection) new URL( | ||
| "http://metadata.google.internal/computeMetadata/v1/instance/zone").openConnection(); | ||
| metadata.setRequestProperty("Metadata-Flavor", "Google"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Handler initialization may now call user supplied code in enhancers during initialization and logging. This commit catches any exceptions thrown and uses the existing error reporting mechanism to log the exception the stderr. The GaeFlexEnhancer now separately logs any exception when obtaining the zone, but does not throw it as having the zone is only optional and should be non fatal to the logger.
|
Changes Unknown when pulling 881e75f on jetty-project:enhance-zone into ** on GoogleCloudPlatform:master**. |
|
Changes Unknown when pulling b661c62 on jetty-project:enhance-zone into ** on GoogleCloudPlatform:master**. |
|
Changes Unknown when pulling 744ca64 on jetty-project:enhance-zone into ** on GoogleCloudPlatform:master**. |
|
@garrettjonesgoogle Would this make into the next release, and when is it scheduled to go out? |
| MonitoredResource resource = monitoredResource != null ? monitoredResource : getDefaultResource(resourceType); | ||
| writeOptions = new WriteOption[]{WriteOption.logName(logName), WriteOption.resource(resource)}; | ||
| } | ||
| catch (Exception ex) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| try { | ||
| HttpURLConnection metadata = (HttpURLConnection) new URL( | ||
| "http://metadata.google.internal/computeMetadata/v1/instance/zone").openConnection(); | ||
| metadata.setRequestProperty("Metadata-Flavor", "Google"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
This should make it into the next release. I'm intending on doing a release tomorrow (Friday). |
|
@garrettjonesgoogle I have fixed those issues. Note the unit tests are not passing, but neither are they in master (for me). I'll try to investigate later today. |
|
LGTM - once you figure out the tests I will merge it. |
🤖 I have created a release *beep* *boop* --- ## [3.17.0](https://togithub.com/googleapis/java-logging/compare/v3.16.3...v3.17.0) (2024-04-25) ### Features * Add Cloud Run Jobs support ([#1574](https://togithub.com/googleapis/java-logging/issues/1574)) ([1dd64d0](https://togithub.com/googleapis/java-logging/commit/1dd64d078e0d4cbb1e16cb1d050ba192492d6a60)) ### Bug Fixes * **deps:** Update the Java code generator (gapic-generator-java) to 2.39.0 ([#1587](https://togithub.com/googleapis/java-logging/issues/1587)) ([848418b](https://togithub.com/googleapis/java-logging/commit/848418b426c2e93e636dbd9de71985c386ccb9d2)) ### Dependencies * Update dependency com.google.cloud:sdk-platform-java-config to v3.29.0 ([#1586](https://togithub.com/googleapis/java-logging/issues/1586)) ([edcaf8d](https://togithub.com/googleapis/java-logging/commit/edcaf8de643a7f7f419ee6059c706d0ef0ef4873)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: JSON parsing of S2A addresses. * extract extra parsing logic to calling method. * cast once + use defined constant.
🤖 I have created a release *beep* *boop* --- ## [3.17.0](https://togithub.com/googleapis/java-logging/compare/v3.16.3...v3.17.0) (2024-04-25) ### Features * Add Cloud Run Jobs support ([googleapis#1574](https://togithub.com/googleapis/java-logging/issues/1574)) ([265b535](https://togithub.com/googleapis/java-logging/commit/265b5352433ae754f08f5f33518d5effbf31a9aa)) ### Bug Fixes * **deps:** Update the Java code generator (gapic-generator-java) to 2.39.0 ([googleapis#1587](https://togithub.com/googleapis/java-logging/issues/1587)) ([4e6381d](https://togithub.com/googleapis/java-logging/commit/4e6381def407f81c61955d4fa0ddbac6d66fca90)) ### Dependencies * Update dependency com.google.cloud:sdk-platform-java-config to v3.29.0 ([googleapis#1586](https://togithub.com/googleapis/java-logging/issues/1586)) ([ae1c4eb](https://togithub.com/googleapis/java-logging/commit/ae1c4eb2b1cfe3e722c3854382463c20d57744be)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
* fix: JSON parsing of S2A addresses. * extract extra parsing logic to calling method. * cast once + use defined constant.
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…ncy-plugin to v3.6.0 (#1589)
…ncy-plugin to v3.6.0 (#1589)
* feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. (#1531) * feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. * Address code review feedback. * feat: Add com.google.cloud.firestore.telemetry package. (#1533) * feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. * feat: Add com.google.cloud.firestore.telemetry package. * Address code review feedback. * Factor out the otel version in pom.xml. * fix: Remove OpenCensus tracing code. (#1589) * feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. * feat: Add com.google.cloud.firestore.telemetry package. * fix: Remove OpenCensus tracing code. * feat: tracing for aggregate queries, bulkwriter, partition queries, a… (#1590) * feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. * feat: Add com.google.cloud.firestore.telemetry package. * fix: Remove OpenCensus tracing code. * feat: tracing for aggregate queries, bulkwriter, partition queries, and listDocuments. * Address code review feedback. * Address feedback. * don't use wildcard imports. * feat: trace instrumentation for DocumentReference methods. (#1591) * feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. * feat: Add com.google.cloud.firestore.telemetry package. * fix: Remove OpenCensus tracing code. * feat: tracing for aggregate queries, bulkwriter, partition queries, and listDocuments. * feat: trace instrumentation for DocumentReference methods. * feat: trace instrumentation for queries and transactions. (#1592) * feat: Add FirestoreOpenTelemetryOptions to FirestoreOptions. * feat: Add com.google.cloud.firestore.telemetry package. * fix: Remove OpenCensus tracing code. * feat: tracing for aggregate queries, bulkwriter, partition queries, and listDocuments. * feat: trace instrumentation for DocumentReference methods. * feat: trace instrumentation for queries and transactions. * test: Adding first e2e client-tracing test w/ Custom Root Span (#1621) * test: Adding first e2e client-tracing test w/ Custom Root Span * Roll back E2E tests commit. * Address feedback. * Address feedback (better event log message). * Address feedback. --------- Co-authored-by: Jimit J Shah <[email protected]> * test: End-to-End Integration Test for Client-side Tracing in Firestore Java Server SDK using OpenTelemetry SDK and Cloud Trace Exporter against Cloud Trace. (#1635) * Adding first e2e client-tracing test w/ Custom Root Span * test: Adding first e2e client-tracing test w/ Custom Root Span * Fixing test dependencies and use default GCP testing project. Fixing * Fixing test dependencies and use default GCP testing project. * Fixing formatting * Add aggregationQueryGet Test * Add bulkWriterCommitTrace Test * Fixing running multiple-tests * Add partitionQuery Test * Add collectionListDocumentsTrace Test * Add docRef*Trace Tests * Add docRefUpdate*Trace and docRefDelete*Trace Tests * Fixing Trace fetching using retries for missing or incomplete traces due to eventual consistency of Cloud Trace * Add get/query Trace Tests * Add Transaction test * Added TraceContainer to be able to test transaction test-cases * test: Adding Transaction tests * test: Adding Transaction tests * test: Adding TestParameterInjector to run the test for global and non-global opentelemetry SDK instances * test: formatting and cleanup * test: Adding first e2e client-tracing test w/ Custom Root Span * test: Add aggregationQueryGet Test * test: Add bulkWriterCommitTrace Test and fixed running multiple-tests * test: Add partitionQuery Test * test: Add collectionListDocumentsTrace Test * test: Add docRefUpdate*Trace and docRefDelete*Trace Tests and fixed Trace fetching using retries for missing or incomplete traces due to eventual consistency of Cloud Trace * test: Add get/query Trace Tests * test: Added Transaction tests using TraceContainer to verify traces for Transaction ops (BeginTransaction, Rollback etc) * test: Adding TestParameterInjector to run the test for global and non-global opentelemetry SDK instances * test: Formatting and cleanup * test: review comments * test: fixing dfs to handle case where the compareTo callstack may be shorter than the trace callstack - don't need to throw an exception in that case * test: Consolidating verification methods * test: review comments * fix: Make telemetry-related fields transient. (#1638) * fix: Rename 'enabled' to 'tracingEnabled'. (#1639) * fix: Rename 'enabled' to 'tracingEnabled'. In the future, FirestoreOpenTelemetryOptions will support enabling/disabling Logging and Metrics as well. So we should use a better name for this field. * address feedback. * fix: Minor improvement to the ITE2ETracingTest. (#1637) * fix: Minor improvement to the ITE2ETracingTest. * revert the numExpectedSpans change. * feat: Add 'isTransactional' attribute. (#1657) * fix: Necessary test improvements for CI environments. (#1673) * fix: Necessary test improvements for CI environments. * Address feedback. * feat: Disable the tracing feature and remove public APIs. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add the Firestore SDK version to the attributes. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update the "test" dependency versions. * Address feedback related to attributes. * Add 'project_id' attribute. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Revert a736fcc ("Disable the tracing feature and remove public APIs"). * GlobalOtel reset for test must happen in `before`, not `after`. * Address feedback. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Jimit J Shah <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
The google stackdriver logging console requires that the zone label be set in the monitored resource before it can aggregate logs by trace ID.