Skip to content

Instantly share code, notes, and snippets.

View axw's full-sized avatar

Andrew Wilkins axw

View GitHub Profile
@axw
axw / docker-compose.yml
Last active November 2, 2022 20:59
Docker Compose with Elastic Stack and APM Server 6.5.0
version: "2.1"
services:
apm-server:
image: docker.elastic.co/apm/apm-server:${STACK_VERSION:-6.5.0}
ports:
- "127.0.0.1:${APM_SERVER_PORT:-8200}:8200"
- "127.0.0.1:${APM_SERVER_MONITOR_PORT:-6060}:6060"
command: >
apm-server -e
-E apm-server.rum.enabled=true
@axw
axw / feedback.txt
Last active January 30, 2019 10:22
Go 2 Error Inspection feedback: programmatic Frame inspection
The proposal provides a means of printing an error, including the source location.
In the proposal, this is the _only_ way of accessing the source location.
In the Elastic APM Go agent (https://github.com/elastic/apm-agent-go), we provide
users with a means of reporting unexpected errors, along with the source location,
in a structured format. As the proposal is, we would need to print and then parse;
and then the format is not well defined anyway.
It would be ideal if we could access the error's frame directly, and then given
a frame, access the source location directly (say, by providing a method to convert
@axw
axw / goji_apm.go
Created March 29, 2019 02:25
Basic Elastic APM middleware for Goji
package main
import (
"fmt"
"net/http"
"github.com/zenazn/goji"
"github.com/zenazn/goji/web"
"go.elastic.co/apm/module/apmhttp"
)
@axw
axw / geoip_client.js
Created April 5, 2019 03:37
Node.js gRPC client -> Go gRPC server
const apm = require('elastic-apm-node').start({
serviceName: 'geoip-node-client'
});
var grpc = require('grpc');
var interceptor = function(options, nextCall) {
return new grpc.InterceptingCall(nextCall(options), {
start: function(metadata, listener, next) {
var span = apm.startSpan('grpc');
var traceparent = span._context.toString();
@axw
axw / topo-apm.go
Created August 19, 2019 07:40
Elastic APM Go - path generator
package main
import (
"fmt"
"go.elastic.co/apm"
)
type node struct {
tracer *apm.Tracer
@axw
axw / docker-compose.yml
Created January 8, 2020 01:33
Minimal Elastic Stack + APM Docker Compose
version: '2.2'
services:
apm-server:
image: docker.elastic.co/apm/apm-server:7.5.1
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"]
diff --git a/elasticsearch/client.go b/elasticsearch/client.go
index e7df0cde..712a1ba3 100644
--- a/elasticsearch/client.go
+++ b/elasticsearch/client.go
@@ -18,15 +18,9 @@
package elasticsearch
import (
- "bytes"
"context"
@axw
axw / main.go
Created July 31, 2020 09:44
Testing Jaeger service maps
package main
import (
"context"
"fmt"
"io"
"log"
"net/http"
"time"
@axw
axw / main.go
Created October 14, 2021 02:12
modelindexer data generator
package main
import (
"context"
"log"
"time"
"github.com/elastic/beats/v7/libbeat/logp"