-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds zipkin.internal.Span2Codec.JSON (#1671)
This adds an internal copy of a span json codec issue #1499. This starts internal to ease review and allow incremental progress. The first consumer will be Elasticsearch, as this format removes nested queries. Note: this change also introduces json serialization of Span2, which allows future use in Spark.
- Loading branch information
1 parent
e58e3a8
commit 998f50d
Showing
8 changed files
with
696 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"traceId": "86154a4ba6e91385", | ||
"parentId": "86154a4ba6e91385", | ||
"id": "4d1e00c0db9010db", | ||
"kind": "CLIENT", | ||
"name": "get", | ||
"timestamp": 1472470996199000, | ||
"duration": 207000, | ||
"localEndpoint": { | ||
"serviceName": "frontend", | ||
"ipv4": "127.0.0.1" | ||
}, | ||
"remoteEndpoint": { | ||
"serviceName": "backend", | ||
"ipv4": "192.168.99.101", | ||
"port": 9000 | ||
}, | ||
"annotations": [ | ||
{ | ||
"timestamp": 1472470996238000, | ||
"value": "ws" | ||
}, | ||
{ | ||
"timestamp": 1472470996403000, | ||
"value": "wr" | ||
} | ||
], | ||
"tags": { | ||
"http.path": "/api", | ||
"clnt/finagle.version": "6.45.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright 2015-2017 The OpenZipkin Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package zipkin.internal; | ||
|
||
import java.util.List; | ||
|
||
/** Utilities for working with {@link Span2} */ | ||
public interface Span2Codec { | ||
Span2Codec JSON = new Span2JsonCodec(); | ||
|
||
/** Serialize a span recorded from instrumentation into its binary form. */ | ||
byte[] writeSpan(Span2 span); | ||
|
||
/** Serialize a list of spans recorded from instrumentation into their binary form. */ | ||
byte[] writeSpans(List<Span2> spans); | ||
|
||
/** throws {@linkplain IllegalArgumentException} if a span couldn't be decoded */ | ||
Span2 readSpan(byte[] bytes); | ||
|
||
/** throws {@linkplain IllegalArgumentException} if the spans couldn't be decoded */ | ||
List<Span2> readSpans(byte[] bytes); | ||
} |
Oops, something went wrong.