OpenAPI Specification
openapi: 3.1.0
info:
title: Zipkin autocomplete traces 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: traces
description: Query trace data
paths:
/traces:
get:
tags:
- traces
summary: Search traces matching filter criteria
operationId: getTraces
parameters:
- name: serviceName
in: query
schema:
type: string
- name: spanName
in: query
schema:
type: string
- name: annotationQuery
in: query
schema:
type: string
- name: minDuration
in: query
schema:
type: integer
format: int64
- name: maxDuration
in: query
schema:
type: integer
format: int64
- name: endTs
in: query
schema:
type: integer
format: int64
- name: lookback
in: query
schema:
type: integer
format: int64
- name: limit
in: query
schema:
type: integer
default: 10
responses:
'200':
description: Array of traces (each a list of spans)
content:
application/json:
schema:
$ref: '#/components/schemas/ListOfTraces'
/trace/{traceId}:
get:
tags:
- traces
summary: Get a single trace by id
operationId: getTrace
parameters:
- name: traceId
in: path
required: true
schema:
type: string
pattern: ^[0-9a-f]{16,32}$
responses:
'200':
description: Trace (array of spans)
content:
application/json:
schema:
$ref: '#/components/schemas/Trace'
'404':
description: Trace not found
/traceMany:
get:
tags:
- traces
summary: Get multiple traces by comma-delimited ids
operationId: getTracesByIds
parameters:
- name: traceIds
in: query
required: true
schema:
type: string
responses:
'200':
description: Array of traces
content:
application/json:
schema:
$ref: '#/components/schemas/ListOfTraces'
components:
schemas:
Endpoint:
type: object
properties:
serviceName:
type: string
ipv4:
type: string
format: ipv4
ipv6:
type: string
format: ipv6
port:
type: integer
ListOfTraces:
type: array
items:
$ref: '#/components/schemas/Trace'
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
Trace:
type: array
items:
$ref: '#/components/schemas/Span'