Apache Zipkin spans API

Ingest spans and query span names

OpenAPI Specification

apache-zipkin-spans-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Zipkin autocomplete spans API
  description: Zipkin's HTTP API for querying and ingesting distributed tracing data. The API exposes span ingestion and trace, dependency, and autocomplete lookup operations under the `/api/v2` base. Authentication is typically handled by a reverse proxy in front of Zipkin and is not part of the core API.
  version: '2.0'
  license:
    name: Apache License 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  contact:
    name: OpenZipkin
    url: https://zipkin.io/zipkin-api/
servers:
- url: http://{host}:{port}/api/v2
  description: Zipkin server (v2 API base)
  variables:
    host:
      default: localhost
    port:
      default: '9411'
tags:
- name: spans
  description: Ingest spans and query span names
paths:
  /spans:
    get:
      tags:
      - spans
      summary: Get span names recorded by a service
      operationId: getSpanNames
      parameters:
      - name: serviceName
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Array of span names
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
    post:
      tags:
      - spans
      summary: Upload a list of spans
      operationId: uploadSpans
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListOfSpans'
          application/x-protobuf:
            schema:
              type: string
              format: binary
      responses:
        '202':
          description: Spans accepted for processing
        '400':
          description: Malformed span payload
components:
  schemas:
    ListOfSpans:
      type: array
      items:
        $ref: '#/components/schemas/Span'
    Span:
      type: object
      required:
      - traceId
      - id
      properties:
        traceId:
          type: string
          pattern: ^[0-9a-f]{16,32}$
        id:
          type: string
          pattern: ^[0-9a-f]{16}$
        parentId:
          type: string
          pattern: ^[0-9a-f]{16}$
        name:
          type: string
        kind:
          type: string
          enum:
          - CLIENT
          - SERVER
          - PRODUCER
          - CONSUMER
        timestamp:
          type: integer
          format: int64
        duration:
          type: integer
          format: int64
        localEndpoint:
          $ref: '#/components/schemas/Endpoint'
        remoteEndpoint:
          $ref: '#/components/schemas/Endpoint'
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/Annotation'
        tags:
          type: object
          additionalProperties:
            type: string
        debug:
          type: boolean
        shared:
          type: boolean
    Annotation:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
        value:
          type: string
    Endpoint:
      type: object
      properties:
        serviceName:
          type: string
        ipv4:
          type: string
          format: ipv4
        ipv6:
          type: string
          format: ipv6
        port:
          type: integer