Skip to content

Instantly share code, notes, and snippets.

@codefromthecrypt
codefromthecrypt / create-some-load.sh
Created October 11, 2017 07:28
create some load against your docker server
while true; do curl -s http://192.168.99.100:9411/api/v2/spans -H'Content-Type: application/json' -H 'Expect:' -d'[{
"traceId": "4d1e00c0db9010db86154a4ba6e91385",
"parentId": "86154a4ba6e91385",
"id": "4d1e00c0db9010db",
"kind": "CLIENT",
"name": "get",
"timestamp": 1472470996199000,
"duration": 207000,
"localEndpoint": {
"serviceName": "frontend",
@codefromthecrypt
codefromthecrypt / my-misunderstandings.md
Last active October 31, 2020 12:39
My take on: Misunderstanding "Open Tracing" for the Enterprise

This is a reaction post to Misunderstanding "Open Tracing" for the Enterprise by @jkowall

This is opinions with citations (imagine that!). This is not wikipedia. sorry. I didn't run this by anyone, Jonah or otherwise. I do not represent OpenTracing or OpenCensus (or my employer or whatever you might think) in this view. I will give critical thoughts on both from a technical view as people complained to me mostly about lack of details. I do have "a dog in the race" but it isn't what you might think. Yes, I'm the primary maintainer of Zipkin, but my goal is not to disparage anything rather to keep the community healthy with options that exist and free from the suffering caused in my opinion by complete lack of technical view on what things do. Particularly, this is dangerous in interop, and I'll get to that.

I have experience with both tools. Though I left within months, I was implicated in the beginning of OpenTracing. I still mainta

[
{
"traceId": "5aab74dbb904746bb33447baae403ed6",
"parentId": "05e3ac9a4f6e3b90",
"id": "e457b5a2e4d86bd1",
"kind": "CONSUMER",
"name": "next-message",
"timestamp": 1521186011929043,
"duration": 14,
"localEndpoint": {
@codefromthecrypt
codefromthecrypt / differences.diff
Created April 29, 2018 08:57
differences in grafana due to metrics changes
92c92
< "expr": "rate(zipkin_collector_messages{instance=~\"$instances\"}[1m])\n",
---
> "expr": "rate(zipkin_collector_messages_total{instance=~\"$instances\"}[1m])\n",
100c100
< "expr": "rate(zipkin_collector_messages_dropped{instance=~\"$instances\"}[1m])\n",
---
> "expr": "rate(zipkin_collector_messages_dropped_total{instance=~\"$instances\"}[1m])\n",
103c103
< "metric": "{{instance}} {{transport}} dropped messages",
@codefromthecrypt
codefromthecrypt / troubleshooting_cassandra.md
Created January 27, 2019 12:38
troubleshooting cassandra

Load testing example of cassandra3 storage

Hypothesis: a recent change to the code caused a problem which would be visible under load as dropped spans.

Validation approach: create a lot of load and check if there are any dropped spans

Conclusion: Hypothesis isn't supported. there could be a different explanation for dropped spans, possibly data in nature.

Steps

Changed brave-webmvc-example to make a lot of separate requests instead of buffering.

import brave.propagation.Propagation;
import brave.propagation.TraceContext;
import brave.propagation.TraceContextOrSamplingFlags;
import brave.propagation.TraceIdContext;
import java.util.List;
import java.util.Locale;
import java.util.UUID;
/**
* <p>Tries to extract a trace ID and span ID using the supplied default implementation, such as
@codefromthecrypt
codefromthecrypt / elasticsearch-secondary.md
Last active December 24, 2020 23:55
secondary zipkin template for elasticsearch 7

Zipkin by default does special indexing to deal with limitations around names with dots and to reduce storage costs. Normal elasticsearch queries for tags won't work because of this. However, you can always add a second indexing template with the tags you feel you need to work with other tools like kibana. This shows you how to do that.

Before asking any questions please run exactly as mentioned here. These instructions are Elasticsearch v7 specific. If you do something different like use Elasticsearch 6, or do things out of order, it might not work. In other words, use our docker-compose stuff so to eliminate variance and understand how things work before changing variables.

$ git clone https://github.com/openzipkin/zipkin
$ cd zipkin/docker/examples/

Edit docker-compose-elasticsearch.yml and uncomment out po

@codefromthecrypt
codefromthecrypt / curl-tls1.3.md
Created June 17, 2019 07:55
Mystery of TLS 1.3 and curl on osx

I forget all the things I needed to install first. Some of these may be irrelevant.

brew install libtool pkg-config shtool grep gcc [email protected]
# from your checkout of curl
glibtoolize
aclocal
autoconf
autoheader
automake --force-missing --add-missing
@codefromthecrypt
codefromthecrypt / add-accesslog.sh
Last active September 11, 2019 09:08
Add custom armeria configuration to zipkin
#!/bin/sh
#
# NOTE: if you are reading this, probably you should upvote https://github.com/line/armeria/issues/1909
#
# get normal zipkin server
curl -sSL https://zipkin.io/quickstart.sh | bash -s
# Write pom.xml thats responsible for generating armeria-configurator.jar
cat << 'EOF' > pom.xml
@codefromthecrypt
codefromthecrypt / duped.md
Last active July 28, 2019 04:09
you've been had! a short list of ways people trick you into using their stuff

In the last 4 years I've noticed an increase in marketing things vs making them better. Here are some tricks I've learned about and am now more wary about. Purely my own opionions as an open source person.

My company made X (but they didn't)

We know it is often the case that ideas are not executed, or poorly executed. When people quit google to make a startup competing with their employer, it is tempting to claim they invented something invented at google. You can tell this when people clarify that they "really made" X. This hints they didn't make it. Regardless of who invented something, there is value in popularizing it (provided the "it" was a good idea). There's possibly most value in enduring it through support.

It can be strange that a big company would allow a small company to literally compete with them and misattribute simultaneously. First, check to see if it is california, if so, that's probably the answer :) Also, a big company maybe doesn't want the publicity of picking on a smaller one, or