Comments (3)
Related to this, in the example curl statement used to show how ubbagent is used, it looks like this:
date -u +"%Y-%m-%dT%H:%M:%S.%NZ"
This produces output like 2018-03-26T12:55:49.NZ
which is malformed and makes ubbagent fail.
This date format string works:
date -u +"%Y-%m-%dT%H:%M:%SZ"
from ubbagent.
Date parsing errors make the HTTP agent very unhappy, it instantly closes the connection and returns nothing (not even HTTP 400*)
$ curl -v -X POST -d "{\"name\": \"requests\", \"startTime\": \"$(date -u +"%Y-%m-%dT%H:%M:%S.%NZ")\", \"endTime\": \"$(date -u +"%Y-%m-%dT%H:%M:%S.%NZ")\", \"value\": { \"int64Value\": 10 }, \"labels\": { \"foo\": \"bar2\" } }" 'http://localhost:3456/report'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3456 (#0)
> POST /report HTTP/1.1
> Host: localhost:3456
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 157
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 157 out of 157 bytes
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
from ubbagent.
Regarding the timezone parsing error: this is a really horrible error message generated by Go's time library when parsing a timestamp in RFC3339 format. The "07:00" text comes from the format described here: https://github.com/golang/go/blob/master/src/time/format.go#L78. The message is basically telling you that a timezone is required: either "Z" or something like "+07:00". I'll see if I can wrap this in a more meaningful message.
The '%N' in the example curl command adds nanoseconds. I guess this is platform-dependent (and assume you're using OS X?). I've removed '%N' from the example commands.
And regarding the HTTP response: I'm not able to reproduce the closed connection. I get a 500 on parse error which, while not ideal, is at least a response, and is what I would expect given this line: https://github.com/GoogleCloudPlatform/ubbagent/blob/master/http/http.go#L56. Is the closed connection always reproducible for you?
from ubbagent.
Related Issues (14)
- -v argument in documentation and ubbagent-start appears to be unused by code HOT 1
- HTTP Availability and Port HOT 2
- Consider ref'ing client secrets as files rather than base64 encoded data HOT 1
- servicecontrol -- ??? HOT 1
- Additional way of configuration Keys and Ids. HOT 2
- Error: identity: too many service account keys HOT 3
- Upgrade from python2 to python3
- unable to configure ubb agent with my application on gke
- Panic in ubbagent HOT 11
- Memory leak in python sdks
- make is failing with golang errors
- Go SDK
- message dequeue panic
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ubbagent.