Skip to content
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

Supports backfilling timestamp for one-way spans #1497

Merged
merged 1 commit into from
Jan 18, 2017

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Jan 18, 2017

Before, we only supported backfilling timestamp and duration for spans
that have at least two annotations. This special cases an incomplete
one-way span (ex only cs), by adding its timestamp. This prevents the
UI from crashing.

See #1243

@codefromthecrypt
Copy link
Member Author

cc @dragontree101

@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Jan 18, 2017

Sending one side separately from the other..

$ curl -s localhost:9411/api/v1/spans -H'Content-type: application/json' -d '[
  {
    "traceId": "77047bf9cf04ed5d",
    "id": "77047bf9cf04ed5d",
    "name": "get",
    "timestamp": 1484722951945904,
    "duration": 156470,
    "annotations": [
      {
        "timestamp": 1484722951945904,
        "value": "sr",
        "endpoint": {
          "serviceName": "client"
        }
      },
      {
        "timestamp": 1484722952102374,
        "value": "ss",
        "endpoint": {
          "serviceName": "client"
        }
      }
    ]
  },
  {
    "traceId": "77047bf9cf04ed5d",
    "id": "40ef4e93ab3b1507",
    "name": "get",
    "parentId": "77047bf9cf04ed5d",
    "annotations": [
      {
        "timestamp": 1484722952100852,
        "value": "cs",
        "endpoint": {
          "serviceName": "client"
        }
      }
    ]
  }
]'
$ curl -s localhost:9411/api/v1/spans -H'Content-type: application/json' -d '[
  {
    "traceId": "77047bf9cf04ed5d",
    "id": "40ef4e93ab3b1507",
    "parentId": "77047bf9cf04ed5d",
    "annotations": [
      {
        "timestamp": 1484722952121651,
        "value": "sr",
        "endpoint": {
          "serviceName": "server"
        }
      }
    ]
  },
  {
    "traceId": "77047bf9cf04ed5d",
    "id": "c8a3701afd819d33",
    "name": "process",
    "parentId": "40ef4e93ab3b1507",
    "timestamp": 1484722952121748,
    "duration": 656,
    "binaryAnnotations": [
      {
        "key": "lc",
        "value": "message-processor",
        "endpoint": {
          "serviceName": "server"
        }
      }
    ]
  }
]'

we get this due to backfilling of timestamp and duration of the middle one-way span
screen shot 2017-01-18 at 3 05 53 pm

@dragontree101
Copy link

now in zipkin-ui one-way is NaN?
image

@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Jan 18, 2017 via email

Before, we only supported backfilling timestamp and duration for spans
that have at least two annotations. This special cases an incomplete
one-way span (ex only cs), by adding its timestamp. This prevents the
UI from crashing.
@codefromthecrypt codefromthecrypt changed the title Supports backfilling timestamp and duration for one-way spans Supports backfilling timestamp for one-way spans Jan 18, 2017
@codefromthecrypt
Copy link
Member Author

simplified code and updated description. key change here is making sure there's a timestamp added (which stops the UI from crashing)

@codefromthecrypt
Copy link
Member Author

PS this is a screenshot of the in-flight span. duration absent appearing as NaN is a separate issue, which I'll raise separately.

screen shot 2017-01-18 at 8 03 46 pm

@codefromthecrypt codefromthecrypt merged commit 77778c5 into master Jan 18, 2017
@codefromthecrypt codefromthecrypt deleted the oneway-duration branch January 18, 2017 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ui Zipkin UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants