Skip to content

Instantly share code, notes, and snippets.

View axw's full-sized avatar

Andrew Wilkins axw

View GitHub Profile
@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"
@axw
axw / main.go
Created July 31, 2020 09:44
Testing Jaeger service maps
package main
import (
"context"
"fmt"
"io"
"log"
"net/http"
"time"
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 / 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"]
@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 / 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 / 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 / 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 / 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 / cockroachdb-elasticapm.diff
Last active September 13, 2018 05:07
Diff adding Elastic APM tracing to Cockroach DB
diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html
index 68d2949eaa..84d0f67f56 100644
--- a/docs/generated/settings/settings.html
+++ b/docs/generated/settings/settings.html
@@ -77,6 +77,7 @@
<tr><td><code>timeseries.storage.30m_resolution_ttl</code></td><td>duration</td><td><code>2160h0m0s</code></td><td>the maximum age of time series data stored at the 30 minute resolution. Data older than this is subject to deletion.</td></tr>
<tr><td><code>timeseries.storage.enabled</code></td><td>boolean</td><td><code>true</code></td><td>if set, periodic timeseries data is stored within the cluster; disabling is not recommended unless you are storing the data elsewhere</td></tr>
<tr><td><code>trace.debug.enable</code></td><td>boolean</td><td><code>false</code></td><td>if set, traces for recent requests can be seen in the /debug page</td></tr>
+<tr><td><code>trace.elastic.server</code></td><td>string</td><td><code></code></td><td>if set, traces go to the given Elastic APM server