Skip to content

Instantly share code, notes, and snippets.

👨‍🍳
Cooking up great code

Nathan LeClaire nathanleclaire

👨‍🍳
Cooking up great code
Block or report user

Report or block nathanleclaire

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View beeline_test.js
var http = require('http');
var beeline = require('honeycomb-beeline')({
writeKey: "key",
dataset: "nathanleclaire.nodejsbeelinetest",
serviceName: "frameworks-are-bloated-http-directly-rules"
});
//create a server object:
http.createServer(function (req, res) {
let trace = beeline.startTrace();
@nathanleclaire
nathanleclaire / Dockerfile
Last active May 7, 2020
Secure Tenancy on Kubernetes
View Dockerfile
FROM debian:stretch-slim
RUN mkdir -p /srv/hny && \
apt-get update && \
apt-get install -y ca-certificates openssl bzip2
WORKDIR /srv/hny
# Need to build with tarball (provided by HNY team) adjacent in docker build directory
COPY st.tbz st.tbz
RUN tar --strip-components 1 -xjf st.tbz && \
@nathanleclaire
nathanleclaire / DebugResponseObserver.java
Created Mar 10, 2020
Generic filter with context injection - Honeycomb Java Beeline implementation
View DebugResponseObserver.java
package com.mycompany.config.filters;
import io.honeycomb.libhoney.ResponseObserver;
import io.honeycomb.libhoney.responses.ClientRejected;
import io.honeycomb.libhoney.responses.ServerAccepted;
import io.honeycomb.libhoney.responses.ServerRejected;
import io.honeycomb.libhoney.responses.Unknown;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
@nathanleclaire
nathanleclaire / HoneycombFilterRegistration.java
Created Mar 9, 2020
filters with Honeycomb Java Beeline - Spring Boot Filter version
View HoneycombFilterRegistration.java
package org.springframework.samples.petclinic.system;
import io.honeycomb.beeline.DefaultBeeline;
import io.honeycomb.beeline.spring.beans.SpringServletFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.swing.*;
import java.util.Arrays;
View osso11y.md

prom metrics -

class YourClass {
    static final Counter requests = Counter.build()
     .name("http_requests_total")
     .help("Total requests.")
     .labelNames(
         Arrays.asList(
         "http_status",
View example.java
import java.io.Serializable;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.ml.evaluation.RegressionEvaluator;
import org.apache.spark.ml.recommendation.ALS;
import org.apache.spark.ml.recommendation.ALSModel;
public static class Rating implements Serializable {
private int userId;
private int productId;
View FilterExampleServlet.java
package com.mycompany.servlet.filterlistener;
import io.honeycomb.beeline.DefaultBeeline;
import io.honeycomb.beeline.tracing.Span;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
View gist.md
INFO[0000] accepted connection                           authority=10.0.0.3:63349 port=80
INFO[0000] basic authentication accepted                 user=foo
INFO[0000] processing request                            path=/super/slow/server
INFO[0000] sent response code                            status=200
INFO[0000] closed connection                             authority=10.0.0.3:63349
View events.js
$('body').on("click mousedown mouseup focus blur keydown change dblclick mousemove mouseover mouseout mousewheel keydown keyup keypress textInput touchstart touchmove touchend touchcancel resize scroll zoom select change submit reset",function(e){
libhoney.sendNow(e);
});
View DatabaseService.java
public static class DatabaseService {
public void queryDb(String id) {
try (Span childSpan = beeline.startChildSpan("customer-db-query")) {
String data = getCustomerDataById(id);
childSpan.addField("customer-data", data);
}
}
public String getCustomerDataById(String id) {
You can’t perform that action at this time.