Skip to content

Instantly share code, notes, and snippets.

@smith
smith / spans.json
Created December 3, 2026 19:10
Some spans
{
resource: {
attributes: {
'host.name': 'Nathans-MacBook-Pro',
'host.arch': 'arm64',
'host.id': '9C7C78DF-D9A7-5313-8E04-0E8074F0B1CE',
'process.pid': 95836,
'process.executable.name': 'node',
'process.executable.path': '/Users/smith/.nvm/versions/node/v24.19.0/bin/node',
'process.command_args': [
@smith
smith / userscript.js
Created November 19, 2026 18:26
Checkout with VS Code userscript
// ==UserScript==
// @name GitHub: Checkout PR in VS Code
// @namespace local.github.vscode
// @version 1.0.0
// @description Adds a "Checkout in VS Code" action to GitHub's PR Code menu
// @match https://github.com/*/*/pull/*
// @run-at document-idle
// ==/UserScript==
(() => {
'use strict';
@smith
smith / kibana es otlp setup.md
Last active August 26, 2026 12:55
Send development kibana telemetry directly to development ES over OTLP

These instructions can get your local Kibana development environment set up to send logs, metrics, and traces directly to a development Elasticsearch cluster using the Elasticsearch OTLP/HTTP endpoint.

You might want to do this in development so you can have basic otel data without having to run a collector.

These instructions are for running locally in Serverless mode but most things apply for non-serverless also.

This is not a supported configuration and some parts of the Elastic Observability UI will not work as expected.

Elasticsearch

---
description: '"pro" command — open the GitHub Pull Request Overview in VS Code'
globs:
alwaysApply: false
---
## "pro" — Pull Request Overview
When the user says **"pro"**, open the GitHub Pull Requests extension's PR overview page (the description/overview tab) for the specified PR.
@smith
smith / workflows-not-tasks.md
Created March 4, 2026 17:58
Workflows, Not Tasks: Rethinking Elastic's Background Execution Architecture

Workflows, Not Tasks: Rethinking Elastic's Background Execution Architecture

2026-03-04 — Nathan Smith, Tech Lead, APM @ Elastic Observability


The Problem

Kibana Task Manager is an application-level job queue embedded in a UI server. It is simultaneously the scheduler, the claimer, and the executor — all inside a Node.js process that also serves HTTP requests. These concerns can't scale independently, and the polling-based claim model generates wasted load on Elasticsearch at scale.

@smith
smith / job-queue-architecture-discussion.md
Created March 4, 2026 16:58
Background job architecture for Elastic — discussion notes (2026-03-04)

Background Job Architecture for Elastic — Discussion Notes

2026-03-04 — Starting from @platformatic/job-queue, ending at first principles


1. @platformatic/job-queue — What Is It?

Matteo Collina (Node.js TSC, Fastify creator) and Platformatic shipped a new job queue library for Node.js with a clean pluggable storage interface:

---
description: Code review workflow — triggered by "let's do code review", "review", or "review <number/URL>"
globs:
alwaysApply: false
---
## Code Review Process
When the user says "let's do code review", "review", or similar:
@smith
smith / kibana-sre-session-start.mdc
Created February 20, 2026 14:32
Kibana SRE session start agent rule
---
description: Auto-sync Kibana repo with upstream and bootstrap on session start
globs:
alwaysApply: true
---
When the user starts a new session in the Kibana workspace (`/Users/smith/Code/kibana`) with a greeting or "kibana-sre" prompt:
1. **Sync with upstream**: `git fetch upstream main && git merge --ff-only upstream/main`
2. **Push to origin**: `git push origin main` (only if on main)
@smith
smith / session-2026-02-19-observability-es-clients.md
Created February 20, 2026 04:48
Observability ES Client Usage Report — Kibana audit of which apps use which Elasticsearch client abstractions

Session — 2026-02-19

Summary

Audited all Elasticsearch client usage across x-pack/solutions/observability/ in Kibana. Produced a comprehensive report showing which observability apps use which ES client abstractions (direct ElasticsearchClient, custom wrappers, IScopedClusterClient) and where the key client factories/types are defined.


Request: Find all ES client imports in observability and report which apps use which clients

@smith
smith / edot-components.yml
Created May 21, 2025 18:05
`otelcol components`: upstream vs edot
# ~/Desktop/elastic-agent-9.0.1-darwin-aarch64/otelcol components
buildinfo:
command: /Users/smith/Desktop/elastic-agent-9.0.1-darwin-aarch64/elastic-agent
description: Elastic opentelemetry-collector distribution
version: 9.0.1
receivers:
- name: filebeatreceiver
stability:
logs: Alpha