-
Notifications
You must be signed in to change notification settings - Fork 39
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
Wip fix for trace 1.0 #70
Conversation
- Create an absurdly named exception to help gradle test failures tell users how to fix issues. - Add better `--info` output on test failure for mock server - Update README to show how to build the project. Note: The best errors we get out of gradle by default look like this now: ``` > Task :exporter-metrics:test com.google.cloud.opentelemetry.metric.EndToEndTest > testExportEmptyMetricsList FAILED com.google.cloud.opentelemetry.metric.MockServerStartupFailedPleaseReadmeException at EndToEndTest.java:58 Caused by: java.io.IOException at EndToEndTest.java:42 Caused by: java.io.IOException at EndToEndTest.java:42 java.lang.NullPointerException at EndToEndTest.java:64 ```
- Start of a refactor to improve handling of multiple-items-in-a-timeseries (see #64) - Add new aggregation tactic to look at ALL timeseries before generating MetricDescriptors - Lazy-create metric descriptors and TimeSeries as we see new metrics - Post-synthesis of time-series, check sanity and push to GCM. - Attempt to leverage new "less casting" interfaces in 0.14 - Update API/build for re-arranged 0.14.1 artifacts and metrics "alpha" stage.
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 just left some nits/questions
...s/trace/src/main/java/com/google/cloud/opentelemetry/example/trace/TraceExporterExample.java
Outdated
Show resolved
Hide resolved
"Metric type {} not supported. Only gauge and cumulative types are supported.", | ||
metricData.getType()); |
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.
nit inconsistent indent
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.
fixed
// Extract all the underlying points. | ||
switch(metricData.getType()) { | ||
case LONG_GAUGE: | ||
for(LongPoint point : metricData.getLongGaugeData().getPoints()) { |
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.
I'm not too familiar with the Java SDK – in practice, is there always just one point?
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.
No, that's one of the issues we're fixing here.
exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/MetricExporter.java
Outdated
Show resolved
Hide resolved
List<TimeSeries> series = builder.getTimeSeries(); | ||
createTimeSeriesBatch(metricServiceClient, ProjectName.of(projectId), series); | ||
// TODO: better error reporting. | ||
if (series.size() < metrics.size()) { |
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.
Re above comment about each MetricData
having a list of points; if that's not the case, this would report failure. Should we just remove the check for now if its not adding anything?
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.
I'm trying to not change the behavior right before 1.0. I agree this needs to get fixed, but I'd rather spend some time on it.
Given metrics is alpha, I think the TODO and a bug to fix is the right way to go for now.
// } | ||
} | ||
List<TimeSeries> series = builder.getTimeSeries(); | ||
createTimeSeriesBatch(metricServiceClient, ProjectName.of(projectId), series); |
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.
Where do GCM API errors get surfaced? It doesn't look like createTimeSeriesBatch()
throws. API errors seem like the most reasonable case to return CompletableResultCode.ofFailure()
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.
I need to refactor all of that code. I opened up an issue to track it, but yeah... it's not clear what happens right now.
Even more, we may want to use an asynchronous client to avoid blocking, as we return a completable result (i.e an async observable). We'll fix this up more post-1.0 as it won't break existing usage, just make it better.
// Start the mock server. This assumes the binary is present and in $PATH. | ||
// Typically, the CI will be the one that curls the binary and adds it to $PATH. |
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.
This doesn't seem to assume it's in $PATH
? Is the comment outdated?
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.
Yeah, I'm going to fix this up in a follow-on. I want to use test-containers here, maybe we discuss that more offline.
// Start the mock server. This assumes the binary is present and in $PATH. | ||
// Typically, the CI will be the one that curls the binary and adds it to $PATH. |
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.
Same as above
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.
same comment as above, also I'd like to share this in a test-util library component that's not released.
…ample/trace/TraceExporterExample.java Co-authored-by: Aaron Abbott <[email protected]>
…/metric/MetricExporter.java Co-authored-by: Aaron Abbott <[email protected]>
…dPlatform/opentelemetry-operations-java into wip-fix-for-trace-1.0
createMetricDescriptor
on everyExport
call #68 via new design for exporter where metric descriptors are first aggregated before calling create.