Skip to content

Instantly share code, notes, and snippets.

View braydonk's full-sized avatar

Braydon Kains braydonk

  • Google
View GitHub Profile
@braydonk
braydonk / otel_matching_spec.md
Last active May 28, 2024 14:29
OpenTelemetry Name Matching Specification Draft

OpenTelemetry Wildcard Name Matching

Background

What and Why

The following is a specification for OpenTelemetry Wildcard Name Matching grammar that I propose to add to the generated metadata packages from mdatagen. This grammar will facilitate the use of wildcards in metric and resource attribute configurations to enabling/disabling metrics/resource attributes in a more concise way, allowing a configuration like:

metrics:
@braydonk
braydonk / processesscraper_deprecation_testing.md
Last active January 30, 2024 20:10
Processes Scraper Deprecation Testing

Processes Scraper Deprecation Testing

Unit Tests

Unit tests for the scraping functionality were added to process_scraper_test.go. The tests pass in mock process handles and expect the system.processes.count and system.processes.created metrics to have the correct values. It also expects the correct values to be produced with different combinations of the two metrics enabled/disabled.

Compatibility Tests

I added compatibility tests between the process and processes scrapers, expecting the system.processes.* metrics produced by each to be the same.

@braydonk
braydonk / main.go
Created September 26, 2023 19:27
Minimal NVML linking reproduction
package main
/*
#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
#cgo CFLAGS: -DNVML_NO_UNVERSIONED_FUNC_DEFS=1
#include "nvml.h"
#include <stdlib.h>
*/
import "C"
@braydonk
braydonk / hostmetrics.yaml
Created September 19, 2023 18:41
Hostemetrics only otelopscol config
exporters:
googlecloud:
metric:
instrumentation_library_labels: false
prefix: ""
resource_filters: []
service_resource_labels: false
skip_create_descriptor: true
retry_on_failure:
enabled: false
@braydonk
braydonk / main.go
Created September 11, 2023 18:02
Script to generate Fluent Bit config from Ops Agent config stdin
package main
import (
"bufio"
"context"
"flag"
"io"
"log"
"os"
braydon@pop-os:~/Work/fluent-bit/build/bin$ valgrind --leak-check=full --log-file=valgrind.log ./fluent-bit --conf config.conf
Fluent Bit v2.1.9
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2023/08/26 20:19:44] [ info] Configuration:
[2023/08/26 20:19:44] [ info] flush time | 1.000000 seconds
[2023/08/26 20:19:44] [ info] grace | 5 seconds
[2023/08/26 20:19:44] [ info] daemon | 0
braydon@pop-os:~/Work/fluent-bit/build/bin$ cat config.conf
[SERVICE]
Log_Level debug
[INPUT]
name fluentbit_metrics
tag internal_metrics
scrape_interval 2
[INPUT]
@braydonk
braydonk / benchmark.sh
Last active September 19, 2023 19:59
Benchmarking Fluent Bit Shell Script
#!/usr/bin/env bash
set -e
if [[ -z "$DATA_DIR" ]]; then
echo "please set a DATA_DIR environment variable to specify where generated log data and buffers should go."
exit 0
fi
# Usage:
@braydonk
braydonk / x.json
Created May 26, 2023 15:36
process.handle enabled results
This file has been truncated, but you can view the full file.
{
"resourceMetrics": [
{
"resource": {},
"scopeMetrics": [
{
"scope": {
"name": "otelcol/hostmetricsreceiver/disk",
"version": "latest"
},