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 / 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 / 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"
@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"
package main
import (
"sync/atomic"
)
type sample struct {
t int64
v float64
}
@gouthamve
gouthamve / broken.go
Created September 15, 2017 16:55
Gzip experiments
// Copyright 2015 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.