GeezerVison is showing github.com — Stackdriver Monitoring internal error HTTP/2 · Issue #2066 · googleapis/google-cloud-java
Stackdriver Monitoring internal error HTTP/2 #2066Labels api: monitoringIssues related to the Cloud Monitoring API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionWe are testing the stackdriver monitoring class and seeing a large amount of the exceptions attached on and off in our environments.
com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException:
INTERNAL: HTTP/2 error code:
INTERNAL_ERROR Received Rst Stream at
com.google.api.gax.grpc.ExceptionTransformingCallable$ExceptionTransformingFuture.onFailure(ExceptionTransformingCallable.java:108)
exception.txt Reacted by yonran and Stefano Massera Activitytcoffee-google commented on May 22, 2017 garrettjonesgoogle commented on May 30, 2017 @zsiegel I think we will need more details to investigate. Can you provide information on the environment you're running in, and the versions of your dependencies? Also, could you describe the conditions that this happens in more specifically? zsiegel commented on May 30, 2017 We are running this on a number of nodes in a GKE cluster.
We have 3 web services running and we use an end of request handler to calculate the request timing and send them to stackdriver as a custom metric.
We inserted the middleware on just our /health endpoints to test out the dependency which was the latest in maven central at the time of testing (com.google.cloud:google-cloud-monitoring:0.17.2-alpha). We then let the Google Cloud load balancers hit our health endpoints as the normal do and watched our metrics (the load balancers in gcloud hit the endpoint 2-3 times a second)
After a few minutes of metrics we notice a ton of the stacktraces above. We are not doing anything to batch this data up we are simply logging a single Int64Value with a timestamp to StackDriver.
Let me know if you need anything else. garrettjonesgoogle commented on May 30, 2017 I don't know if you can provide the exact code you use to call StackDriver, but would you be able to at least provide a distilled version? It would help to know both the API method and types of parameters you are passing in. zsiegel commented on May 30, 2017 sure can. see the near complete method call below.
long endTime = System.currentTimeMillis();
long responseTime = Math.max(1, endTime - startTime);
TimeInterval interval = TimeInterval.newBuilder()
.setEndTime(Timestamps.fromMillis(System.currentTimeMillis()))
.build();
TypedValue value = TypedValue.newBuilder()
.setInt64Value(responseTime)
.build();
Point point = Point.newBuilder()
.setInterval(interval)
.setValue(value)
.build();
List<Point> dataPoints = Collections.singletonList(point);
Metric metric = Metric.newBuilder()
.setType(CUSTOM_METRIC_DOMAIN + "/" + env + "/response_time")
.build();
Map<String, String> resourceLabels = new HashMap<>();
resourceLabels.put("project_id", LoggingOptions.getDefaultProjectId());
MonitoredResource resource = MonitoredResource.newBuilder()
.setType("global")
.putAllLabels(resourceLabels)
.build();
TimeSeries timeSeries = TimeSeries.newBuilder()
.setMetric(metric)
.setResource(resource)
.addAllPoints(dataPoints)
.build();
CreateTimeSeriesRequest request = CreateTimeSeriesRequest.newBuilder()
.setNameWithProjectName(ProjectName.create(LoggingOptions.getDefaultProjectId()))
.addAllTimeSeries(Collections.singleton(timeSeries))
.build();
metricsClient.createTimeSeries(request);
garrettjonesgoogle commented on May 30, 2017 Thanks! I'll see if I can reproduce this. added priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. on May 30, 2017garrettjonesgoogle commented on Jun 2, 2017 I tried out code similar to yours and I observed the error once. Since this is a purely auto-generated client and our other auto-generated clients don't have this issue, this seems to be a server-side problem. zsiegel commented on Jun 12, 2017 Hmm thats quite interesting... So if it indeed is a server side issue how would you go about reporting this to the Google Cloud / Stackdriver team? @garrettjonesgoogle tracycollins commented on Jun 12, 2017 +1
I'm seeing similar errors. It had been working fine for months. Errors started appearing consistently a few days ago:
"Received RST_STREAM with error code 2"
{
"code": 13,
"metadata": {
"_internal_repr": {}
},
"note": "Exception occurred in retry method that was not classified as transient"
}
I'm using the google monitoring node api:
https://github.com/googleapis/googleapis/tree/master/google/monitoring/v3
I thought I was updating too quickly, so I've throttled way below the quota but still get errors.
It is Alpha, so I've not been complaining. sundewei commented on Jun 14, 2017 +1 I am having the same errors.
I only wanted to send 20 metrics in a for-loop and this error showed up after 4th attempt...
Any update on what we should do in our end to avoid it?
Thanks.
Dewei sundewei commented on Jun 15, 2017 Just FYI...
As of now, this error happens so frequently that I cannot even sent metrics any more.
Exception in thread "main" com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException: INTERNAL: HTTP/2 error code: INTERNAL_ERROR
Received Rst Stream
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
<version>0.19.0-alpha</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
private static void sendDataPoints(final MetricServiceClient client, String projectId, String metricType,
String monitoredResourceType, Map<String, String> resLabels,
long endTimeMs, TypedValue... values) throws Exception {
// Prepares an individual data point
TimeInterval interval = TimeInterval.newBuilder()
.setEndTime(Timestamps.fromMillis(endTimeMs))
.build();
Point[] points = getPoints(interval, values);
ProjectName name = ProjectName.create(projectId);
// Prepares the metric descriptor
Metric metric = Metric.newBuilder()
.setType(metricType)
.putAllLabels(resLabels)
.build();
// Prepares the monitored resource descriptor
MonitoredResource resource = MonitoredResource.newBuilder().setType(monitoredResourceType).build();
// Prepares the time series request
TimeSeries timeSeries = TimeSeries.newBuilder()
.setMetric(metric)
.setResource(resource)
.addAllPoints(Arrays.asList(points))
.build();
List<TimeSeries> timeSeriesList = new ArrayList<>();
timeSeriesList.add(timeSeries);
CreateTimeSeriesRequest request = CreateTimeSeriesRequest.newBuilder()
.setNameWithProjectName(name)
.addAllTimeSeries(timeSeriesList)
.build();
// Writes time series data
client.createTimeSeries(request);
System.out.println("Done writing time series value.");
}
sundewei commented on Jun 15, 2017 FYI:
Here is some more info...
This error only happens to the CustomMetric that have been explicitly created.
If I don't send the create request and just let it be "automatically" created, then the subsequent send metric requests are successfully.
I am guessing maybe the resource allocation logic at the server side for explicitly created CustomMetric has some problem.
Thanks.
Dewei added priority: p2Moderately-important priority. Fix may not be included in next release. and removed priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release. on Nov 9, 2017pongad commented on Jan 25, 2018 @garrettjonesgoogle Have we ever reached out to API team about this? I have been able to publish about 1000 times with no error. pongad commented on Jan 30, 2018 @SJAnderson @manuellazzarijr @mrunesson @zsiegel
Could you provide us with some additional information?
- Are you creating time series close to metric creation? If so, we might encounter error since the metric hasn't been fully created yet.
- Could you give us your project ID and some of your
CreateTimeSeriesRequest? This will help the monitoring team debug this.
pongad commented on Feb 16, 2018 I'll close this for now due to inactivity. Please reopen if the issue persist.
MetadataMetadataapi: monitoringIssues related to the Cloud Monitoring API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|