Skip to content

Instantly share code, notes, and snippets.


Miguel Ping mping-exo

  • Lisbon, Portugal
View GitHub Profile
import io.netty.buffer.ByteBuf;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.InvalidMarkException;
import java.nio.charset.Charset;
import java.util.Collections;
xml='<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/checkouts" />
<excludeFolder url="file://$MODULE_DIR$/target" />
mping-exo / metrics
Created Jul 16, 2021
ot collector metrics
View metrics
# HELP otelcol_exporter_queue_size Current size of the retry queue (in batches)
# TYPE otelcol_exporter_queue_size gauge
otelcol_exporter_queue_size{exporter="otlp",service_instance_id="0afa6250-8064-4913-9a60-fe23ae50dd52"} 0
# HELP otelcol_exporter_send_failed_spans Number of spans in failed attempts to send to destination.
# TYPE otelcol_exporter_send_failed_spans counter
otelcol_exporter_send_failed_spans{exporter="logging",service_instance_id="0afa6250-8064-4913-9a60-fe23ae50dd52"} 0
otelcol_exporter_send_failed_spans{exporter="otlp",service_instance_id="0afa6250-8064-4913-9a60-fe23ae50dd52"} 675
# HELP otelcol_exporter_sent_spans Number of spans successfully sent to destination.
# TYPE otelcol_exporter_sent_spans counter
otelcol_exporter_sent_spans{exporter="logging",service_instance_id="0afa6250-8064-4913-9a60-fe23ae50dd52"} 1.974518e+06
View interceptors.clj
(defn fn-1arity [one-arg]
(inc one-arg))
(defn fn-future [res]
(Thread/sleep 1000)
(defn fn-2arity [a b]
View either.clj
(require '[clojure.spec.alpha :as s])
(s/def ::test (s/and (s/keys :req-un [(or ::key1 ::key2)])
(fn [{:keys [key1 key2]}]
(not (and key1 key2)))))
;; s/or validates some of the keys
;; the (fn..) ensures that both keys CANNOT be present
View manifold.clj
(d/on-realized (d/chain (d/success-deferred 1)
#(println "ok" %))
(fn ok [v] (println "Realized" v))
(fn fail [e] (println "fail " e)))
;; ok 1
;; realized nil
(d/on-realized (d/chain (d/error-deferred 1)
#(println "ok" %))
(fn ok [v] (println "Realized" v))