|
42 | 42 | import org.junit.runners.Parameterized; |
43 | 43 |
|
44 | 44 | /** |
45 | | - * Integration test that verifies both the default built-in Cloud Monitoring export path and a |
46 | | - * user-configured OpenTelemetry backend (backed by {@link InMemoryMetricReader}) are active |
47 | | - * simultaneously via the {@link |
48 | | - * com.google.cloud.datastore.telemetry.CompositeDatastoreMetricsRecorder}. |
| 45 | + * Integration test that verifies a user-configured OpenTelemetry backend (backed by {@link |
| 46 | + * InMemoryMetricReader}) correctly captures metrics emitted by the Datastore SDK. |
49 | 47 | * |
50 | 48 | * <h3>What this test covers</h3> |
51 | 49 | * |
|
54 | 52 | * emitted by the Datastore SDK. After each operation the test collects all metrics |
55 | 53 | * synchronously and asserts that expected names, types, and attributes are present. Because |
56 | 54 | * the in-memory reader is under full test control, these assertions are deterministic. |
57 | | - * <li><b>Built-in Cloud Monitoring backend</b> — a private {@link OpenTelemetrySdk} configured |
58 | | - * with {@link com.google.cloud.datastore.telemetry.DatastoreCloudMonitoringExporter} is |
59 | | - * created alongside the custom backend. The test verifies the composite recorder is in place |
60 | | - * (confirming both backends are wired up) and that no exception is thrown during the export |
61 | | - * path. The periodic export interval means data will not appear in Cloud Monitoring |
62 | | - * immediately; manual verification steps are provided at the bottom of this class Javadoc. |
63 | 55 | * </ol> |
64 | 56 | * |
65 | | - * <h3>Setup</h3> |
66 | | - * |
67 | | - * <p>Requires a real GCP project with Application Default Credentials that have the {@code |
68 | | - * monitoring.timeSeries.create} IAM permission. Set the following environment variables: |
69 | | - * |
70 | | - * <ul> |
71 | | - * <li>{@code GOOGLE_CLOUD_PROJECT} — GCP project ID (required) |
72 | | - * <li>{@code DATASTORE_DATABASE_ID} — Datastore database ID (defaults to {@code ""} for the |
73 | | - * default database) |
74 | | - * </ul> |
75 | | - * |
76 | | - * <h3>Cloud Monitoring verification</h3> |
77 | | - * |
78 | | - * <p>After running this test, navigate to <b>Cloud Console → Monitoring → Metrics Explorer</b> and |
79 | | - * query: |
80 | | - * |
81 | | - * <pre> |
82 | | - * Metric : custom.googleapis.com/internal/client/transaction_latency |
83 | | - * Resource: global |
84 | | - * Filter : project_id = <YOUR_PROJECT_ID> |
85 | | - * </pre> |
86 | | - * |
87 | | - * <p>Data may take up to 60 seconds (one periodic flush interval) to appear. |
88 | | - * |
89 | | - * <p><b>Note on Cloud Monitoring verification:</b> This test does not programmatically verify that |
90 | | - * metrics are successfully received by the Cloud Monitoring backend. Querying Cloud Monitoring for |
91 | | - * recently written metrics can be flaky due to ingestion delays (which can take up to 10 minutes |
92 | | - * for new metrics). Following the strategy used in tracing tests (which only use in-memory |
93 | | - * exporters), this test relies on {@link InMemoryMetricReader} to verify that metrics are correctly |
94 | | - * generated with expected attributes. |
| 57 | + * <p>Following the strategy used in tracing tests, this test relies on {@link InMemoryMetricReader} |
| 58 | + * to verify that metrics are correctly generated with expected attributes. |
95 | 59 | */ |
96 | 60 | @RunWith(Parameterized.class) |
97 | 61 | @SuppressWarnings("checkstyle:abbreviationaswordinname") |
|
0 commit comments