Skip to content

Instantly share code, notes, and snippets.

View brbarmex's full-sized avatar

Bruno Melo brbarmex

View GitHub Profile
@brbarmex
brbarmex / main.go
Created October 1, 2025 17:38
servicebus
package main
import (
"context"
"encoding/base64"
"encoding/json"
"log"
"net/http"
"os"
"time"
@brbarmex
brbarmex / httpmetrics.go
Last active September 25, 2025 16:48
RoundTripper que mede métricas HTTP e Cosmos
// go:build go1.20
package httpmetrics
import (
"net/http"
"strconv"
"strings"
"time"
"github.com/DataDog/datadog-go/v5/statsd"
@brbarmex
brbarmex / dd.json
Created September 23, 2025 14:37
dd
{
"title": "HTTP Golden Signals - Gin API",
"description": "Golden Signals (latência, tráfego, erros, saturação, apdex) para serviços HTTP instrumentados com Gin + Datadog (dd-trace-go v2 + datadog-go v5).",
"layout_type": "ordered",
"is_read_only": false,
"notify_list": [],
"reflow_type": "auto",
"template_variables": [
{ "name": "service", "prefix": "service", "default": "my-gin-api" },
{ "name": "env", "prefix": "env", "default": "perf" },
@brbarmex
brbarmex / main.go
Created September 23, 2025 12:48
datadog metric custom middleware
package main
import (
"context"
"log"
"net/http"
"os"
"strconv"
"strings"
"sync/atomic"
@brbarmex
brbarmex / hourglass.go
Last active October 19, 2021 13:12
2D Array - DS | HackerRank
package hourglass
import "math"
func Sum(arr [][]int) int {
a, b, c, d, bigger := -1, 0, 1, 0, math.MinInt32
for h := 0; h < 4; h++ {
for v := 0; v < 4; v++ {
a, b, c, d = a+1, b+1, c+1, d+1