Git Product home page Git Product logo

Comments (3)

moxious avatar moxious commented on June 12, 2024

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.

moxious avatar moxious commented on June 12, 2024

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.

jvolkman avatar jvolkman commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.