Skip to content

Instantly share code, notes, and snippets.

View gouthamve's full-sized avatar
🏠
Working from home

Goutham Veeramachaneni gouthamve

🏠
Working from home
View GitHub Profile
label_replace(group(alertmanager_build_info), "vendor_name", "alertmanager", "", "")
or
label_replace(group(elasticsearch_cluster_health_status), "vendor_name", "elasticsearch_exporter", "", "")
or
label_replace(group(flask_exporter_info), "vendor_name", "flask", "", "")
or
label_replace(group(fluentbit_build_info), "vendor_name", "fluent_bit", "", "")
or
label_replace(group(fluentd_input_status_num_records_total), "vendor_name", "fluentd", "", "")
or
# Tested with OpenTelemetry Collector Contrib v0.88.0
receivers:
otlp:
# https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver
protocols:
grpc:
http:
hostmetrics:
# Optional. Host Metrics Receiver added as an example of Infra Monitoring capabilities of the OpenTelemetry Collector
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver
@gouthamve
gouthamve / telegraf.conf
Last active February 28, 2022 19:40
influx2cortex
# Global tags can be specified here in key="value" format.
[global_tags]
dc = "us-east-1" # will tag all metrics with dc=us-east-1
rack = "1a"
user = "$USER"
# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
package main
import (
"context"
"flag"
"fmt"
"net/url"
"time"
config_util "github.com/prometheus/common/config"
@gouthamve
gouthamve / main.go
Created December 27, 2017 05:02
A complete runnable example
package main
import (
"fmt"
"io/ioutil"
"os"
"time"
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/labels"
@gouthamve
gouthamve / coverage
Created April 27, 2020 08:37
Cortex coverage
➜ cortex git:(master) ✗ go test -cover ./...
ok github.com/cortexproject/cortex/cmd/cortex (cached) coverage: 67.6% of statements
ok github.com/cortexproject/cortex/cmd/query-tee (cached) coverage: 68.3% of statements
? github.com/cortexproject/cortex/cmd/test-exporter [no test files]
? github.com/cortexproject/cortex/integration [no test files]
? github.com/cortexproject/cortex/integration/e2e [no test files]
? github.com/cortexproject/cortex/integration/e2e/cache [no test files]
? github.com/cortexproject/cortex/integration/e2e/db [no test files]
? github.com/cortexproject/cortex/integration/e2e/images [no test files]
? github.com/cortexproject/cortex/integration/e2ecortex [no test files]
@gouthamve
gouthamve / telegraf.conf
Created February 27, 2016 18:30
Telegraf config
# Telegraf Configuration
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
@gouthamve
gouthamve / main.go
Created August 22, 2018 14:41
gokit-log drops keys with spaces in them
package main
import (
"os"
kitlog "github.com/go-kit/kit/log"
)
func main() {
logger := kitlog.NewLogfmtLogger(kitlog.NewSyncWriter(os.Stdout))
package main
import (
"io/ioutil"
"os"
"time"
"github.com/go-kit/kit/log"
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/labels"
package main
import (
"sync/atomic"
)
type sample struct {
t int64
v float64
}