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

Accepts Zipkin v2 Span format in all current transports #1684

Merged
merged 1 commit into from
Aug 12, 2017

Conversation

codefromthecrypt
Copy link
Member

@codefromthecrypt codefromthecrypt commented Aug 10, 2017

This accepts the json format from #1499 on current transports. It does
so by generalizing format detection from the two Kafka libraries, and
a new SpanDecoder interface. Types are still internal, but this allows
us to proceed with other work in #1644, including implementing reporters
in any language.

Concretely, you can send a json list of span2 format as a Kafka or Http
message. If using http, use the /api/v2/spans endpoint like so:

$ curl -X POST -s localhost:9411/api/v2/spans -H'Content-Type: application/json' -d'[{
  "traceId": "9032b04972e475c5",
  "id": "9032b04972e475c5",
  "kind": "SERVER",
  "name": "get",
  "timestamp": 1502101460678880,
  "duration": 612898,
  "localEndpoint": {
    "serviceName": "brave-webmvc-example",
    "ipv4": "192.168.1.113"
  },
  "remoteEndpoint": {
    "serviceName": "",
    "ipv4": "127.0.0.1",
    "port": 60149
  },
  "tags": {
    "error": "500 Internal Server Error",
    "http.path": "/a"
  }
}]'

This was referenced Aug 10, 2017
@codefromthecrypt
Copy link
Member Author

@openzipkin/core @bplotnick @llinder @aliostad @devinsba @flier @ellispritchard @mosesn @pavolloffay @clguimanMSFT @neilstevenson @goller @SergeyKanzhelev

So this change is pretty significant as it means folks can start using the new simplified json format defined in #1499 as soon as this is released (likely zipkin 1.30). In reality a lot of sites won't automatically upgrade to this, but it is important to know anyway.

Concretely, this means tracers can start offering the ability to send in the new format, ex via kafka (sqs azure hub etc) or POST /api/v2/spans. This format is the same as what we're using internally in Elasticsearch 6.x (#1674), and will be the default choice for document stores.

I'm cc'ing you for heads up in case you'd like to try using this, or update your libraries to support it. In the next few weeks a lot of stuff around this will be landing tracked in #1644. Watch or comment on that issue if you want others to know your status.

@pavolloffay
Copy link

What is the format for annotations?

@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Aug 10, 2017 via email

@codefromthecrypt
Copy link
Member Author

not merging this, yet due to #1499 (comment)

This accepts the json format from #1499 on current transports. It does
so by generalizing format detection from the two Kafka libraries, and
a new `SpanDecoder` interface. Types are still internal, but this allows
us to proceed with other work in #1644, including implementing reporters
in any language.

Concretely, you can send a json list of span2 format as a Kafka or Http
message. If using http, use the /api/v2/spans endpoint like so:

```bash
$ curl -X POST -s localhost:9411/api/v2/spans -H'Content-Type: application/json' -d'[{
  "timestamp_millis": 1502101460678,
  "traceId": "9032b04972e475c5",
  "id": "9032b04972e475c5",
  "kind": "SERVER",
  "name": "get",
  "timestamp": 1502101460678880,
  "duration": 612898,
  "localEndpoint": {
    "serviceName": "brave-webmvc-example",
    "ipv4": "192.168.1.113"
  },
  "remoteEndpoint": {
    "serviceName": "",
    "ipv4": "127.0.0.1",
    "port": 60149
  },
  "tags": {
    "error": "500 Internal Server Error",
    "http.path": "/a"
  }
}]'
```
@codefromthecrypt
Copy link
Member Author

ok ES indexing problem has been resolved. will merge on green

@codefromthecrypt codefromthecrypt merged commit 4cac5b2 into master Aug 12, 2017
@codefromthecrypt codefromthecrypt deleted the v2api branch August 12, 2017 10:54
@newguylhl newguylhl mentioned this pull request Dec 13, 2017
2 tasks
@pvprsd
Copy link

pvprsd commented Jul 8, 2018

Hi,

I am new to the zipkin. I have started using zipkin from docker image from docker hub i.e. openzipkin/zipkin:latest .
I found that the /spans POST API is not supported by default. Do we need to enable it explicitly?
Is this supported zipkin v2?

Thanks,
Prasad

@shakuzen
Copy link
Member

shakuzen commented Jul 9, 2018

@pvprsd please join us on Gitter (https://gitter.im/openzipkin/zipkin) if you have questions.

abesto pushed a commit to abesto/zipkin that referenced this pull request Sep 10, 2019
)

This accepts the json format from openzipkin#1499 on current transports. It does
so by generalizing format detection from the two Kafka libraries, and
a new `SpanDecoder` interface. Types are still internal, but this allows
us to proceed with other work in openzipkin#1644, including implementing reporters
in any language.

Concretely, you can send a json list of span2 format as a Kafka or Http
message. If using http, use the /api/v2/spans endpoint like so:

```bash
$ curl -X POST -s localhost:9411/api/v2/spans -H'Content-Type: application/json' -d'[{
  "timestamp_millis": 1502101460678,
  "traceId": "9032b04972e475c5",
  "id": "9032b04972e475c5",
  "kind": "SERVER",
  "name": "get",
  "timestamp": 1502101460678880,
  "duration": 612898,
  "localEndpoint": {
    "serviceName": "brave-webmvc-example",
    "ipv4": "192.168.1.113"
  },
  "remoteEndpoint": {
    "serviceName": "",
    "ipv4": "127.0.0.1",
    "port": 60149
  },
  "tags": {
    "error": "500 Internal Server Error",
    "http.path": "/a"
  }
}]'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants