package com.example.tracing;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
module HealthCheckable
extend ActiveSupport::Concern
CheckResult = Struct.new(:name, :ok, :message, keyword_init: true)
private
package observability
import (
"time"
"go.uber.org/zap"
module QueryBudget
class Counter
IGNORED = %w[SCHEMA CACHE TRANSACTION].freeze
attr_reader :count
package com.example.health;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
const withTimeout = (promise, timeoutMs, name) => {
let timer;
const timeout = new Promise((_, reject) => {
timer = setTimeout(
() => reject(new Error(`check '${name}' timed out after ${timeoutMs}ms`)),
timeoutMs
import time
from collections import namedtuple
from sqlalchemy import text
CheckResult = namedtuple("CheckResult", ["name", "healthy", "latency_ms", "detail"])
class ApplicationError < StandardError
attr_reader :context
class << self
def context_keys(*keys)
@context_keys = keys unless keys.empty?
package health
import (
"context"
"sync"
"time"
package logctx
import (
"context"
"log/slog"
)
const pino = require('pino');
const { AsyncLocalStorage } = require('async_hooks');
const als = new AsyncLocalStorage();
const logger = pino({