Skip to content

Instantly share code, notes, and snippets.

@jsuereth
jsuereth / semconv-nextsteps.md
Created October 5, 2022 16:47
Semantic Conventions - Forward Progress proposal

Problem

When investigating #2775, the TC decided to look into expanding the notion of Resource to include Entity.

During this discussion, we identified a lot of hard, challenging problems OpenTelemetry must tackle going forward, including:

  • Telemetry Identity evolving as "scope" increases. E.g. a Jaeger instance running in a single k8s cluster may not need to know the identity of the k8s cluster, as there's only one. However, a datastore spanning mulitple k8s clusters WILL need this information.
  • A simple "Service" model for OpenTelemetry SDKs (e.g. requiring service.name attribute) works in the short run, but beings to struggle in large distributed systems.
  • Defining a consistent guideline on what resource / entity means in practice, how to choose one and what our Entity <-> Signal modelling needs to look like in the long run.
@jsuereth
jsuereth / CanSink.scala
Last active August 29, 2016 01:04
Staged Sinks (just a lame cofree).
trait CanSink[First, Now, Final, To] {
def result[E](in: StagedSink[First, E, Final], f: E => Now): To
def result2[E](in: StagedSink[First, E, Final], f: E => TraversableOnce[Now]): To
}
trait LowPrioritySinkImplicits {
implicit def sinkChain[First, E, Final]: CanSink[First, E, Final, StagedSink[First, E, Final]] = ???
}
object CanSink extends LowPrioritySinkImplicits {
implicit def finalSink[First, E]: CanSink[First, E,E, Sink[First]] = ???
}
@jsuereth
jsuereth / predicitons.md
Created December 21, 2015 12:47
Scalawags #37 - Xmas special predictions
  • @predef1 - Scala will enter page 2 of Stackoverflow tags and surpass Perl. It'll crack 10K Reddit subscribers and pass Clojure
  • @extempore2 - alpaca exports will be up at least 3%
  • @mariussoutier - My other prediction is that Scala.JS + React Native will take off.
@jsuereth
jsuereth / freer.scala
Last active October 26, 2022 14:19
Freer monad in scala, just toying around.
trait Functor[F[_]] {
def map[A, B](fa: F[A])(f: A => B): F[B]
}
trait Monad[F[_]] {
def apply[A](a: A): F[A]
def flatMap[A,B](fa: F[A])(f: A => F[B]): F[B]
}
sealed trait FFree[G[x], A] {}
case class FPure[G[x], A](data: A) extends FFree[G, A]
@jsuereth
jsuereth / apart.scala
Last active August 29, 2015 14:26
Frustrating case class issue
scala> case class Foo private(x: Int)
defined class Foo
scala> Foo(5)
res5: Foo = Foo(5)
@jsuereth
jsuereth / sbt-build-structure.md
Created June 15, 2015 14:56
Sbt build structure

Here's a short little guide to sbt's build structure.

First off, the key you need to investigate how sbt is building things. Here's a snippet from a build.sbt:

import sbt.Keys._
val bs: sbt.BuildStructure = buildStructure.value

This will give you all the gory details of our build (or builds, as is the case).

@jsuereth
jsuereth / sbt-with-java
Created March 30, 2015 13:41
Script for loading sbt with a particular JDK in ubuntu.
#!/bin/bash
declare -r java_dirs=$(ls /usr/lib/jvm)
declare -r default_java=java-6-openjdk-amd64
function findJavaHome() {
if test "$1" == ""; then
java_version="$default_java"
else
java_version="$1"
@jsuereth
jsuereth / .create-travis-cache.sh
Last active December 7, 2015 14:55
Travis CI caching hackeries
#!/bin/bash
# very simple script to generate a tar of dependencies in ivy cache for extraction in TravisCI.
# usage: ./.create-travis-cache.sh <sbt-command>*
#
# By Default this will run `sbt update` with a clean cache directory and
# generate a .tar.bz2 with all the artifacts. This file can be pushed into
# dropbox and expanded in your TravisCI server later for a slight improvement
# in resolution times.
@jsuereth
jsuereth / spec.md
Last active August 29, 2015 14:04
DOGE lambda language

Lambda DOGE

A really dumb idea put into an even dumber spec.

Notes: Grammar is probably ambiguous. Too lazy to actually implement right now, but was playing with syntactic ideas to stay true to the Meme AND to lambda calculus.

Basic Grammar

Any whitespace acts as a token delimiter.

@jsuereth
jsuereth / test-concurrency.scala
Created August 1, 2014 21:12
Test concurrency fun
import sbt._
import Keys._
object TestBuild extends Build {
lazy val root = Project(id = "root", base = file(".")).aggregate(project1, project2).settings(defaultSettings:_*).settings(
concurrentRestrictions in Global := Seq(
Tags.limit(Tags.ForkedTestGroup, 1)
)
)