Skip to content

Instantly share code, notes, and snippets.

View cyriltovena's full-sized avatar
🔥

Cyril Tovena cyriltovena

🔥
View GitHub Profile
@cyriltovena
cyriltovena / engineering-manager.md
Last active November 27, 2024 08:54
The Perfect Engineering Manager (As Told By Their Evil Twin)

Want to Be the Best Engineering Manager? Here's Everything You Shouldn't Do

Ever wondered what makes an exceptional engineering manager? Well, grab your popcorn because we're going to learn from the absolute worst. Meet Chad, the anti-pattern of engineering management, who's here to teach us valuable lessons through his spectacular failures.

On Conflict Resolution

While great managers defuse conflicts early, Chad believes in the "let them fight it out" methodology. His favorite technique? Watching two engineers argue about tabs vs. spaces in Slack for three weeks before declaring "interesting discussion, guys" and changing the subject to his CrossFit routine. Bonus points for bringing up the unresolved conflict six months later during performance reviews!

Cross-Team Communication

Instead of mediating across the organization, Chad perfected the art of "telephone game engineering." Why communicate directly when you can relay messages across six different teams, three time zones, and somehow turn "we

@cyriltovena
cyriltovena / main.go
Created May 15, 2024 12:46
loki tsdb copy
package main
import (
"context"
"math"
"github.com/grafana/loki/v3/pkg/storage/stores/shipper/indexshipper/tsdb/index"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
)
@cyriltovena
cyriltovena / main.go
Last active May 7, 2024 15:58
gcs-bench
package main
import (
"context"
"fmt"
"io"
"sync"
"time"
"cloud.google.com/go/storage"
@cyriltovena
cyriltovena / main.go
Last active September 15, 2020 13:29
ingester kube port forward
package main
import (
"bytes"
"context"
"flag"
"fmt"
"io"
"log"
"net/http"
server:
http_listen_port: 3100
grpc_listen_port: 0
clients:
- url: https://<user id>:<api secret>@logs-prod-us-central1.grafana.net/loki/api/v1/push
positions:
filename: /opt/promtail/positions.yaml
scrape_configs:
- job_name: monitoring
ec2_sd_configs:
- region: us-east-1
port: 9100
relabel_configs:
- action: replace
regex: ".*"
replacement: /var/log/nginx/access.log
target_label: __path__
@cyriltovena
cyriltovena / demo.md
Created April 21, 2020 19:48
Loki Webinar Demo

First deploy the demo app.

kubectl apply -f tns.yaml

Make sure tiller is installed in your cluster.

Add our chart repository

helm repo add loki https://grafana.github.io/loki/charts

@cyriltovena
cyriltovena / setting.json
Created March 24, 2020 14:27
my vscode config go lang
{
"go.testFlags": [
"-v",
"-count=1"
],
"go.languageServerExperimentalFeatures": {
"format": false,
"autoComplete": true,
"rename": true,
"goToDefinition": true,
[{"body":" General Notes Cortex has evolved over several years, and the command-line options sometimes reflect this heritage. In some cases the default value for options is not the recommended value, and in some cases names do not reflect the true meaning. We do intend to clean this up, but it requires a lot of care to avoid breaking existing installations. In the meantime we regret the inconvenience.\nDuration arguments should be specified with a unit like 5s or 3h. Valid time units are \u0026ldquo;ms\u0026rdquo;, \u0026ldquo;s\u0026rdquo;, \u0026ldquo;m\u0026rdquo;, \u0026ldquo;h\u0026rdquo;.\nQuerier -querier.max-concurrent The maximum number of top-level PromQL queries that will execute at the same time, per querier process. If using the query frontend, this should be set to at least (querier.worker-parallelism * number of query frontend replicas). Otherwise queries may queue in the queriers and not the frontend, which will affect QoS.\n -querier.query-parallelism This refers to database queries against t
@cyriltovena
cyriltovena / gist:cff9e21ed78b7be7deda9741b074ea28
Last active November 14, 2019 17:27
logcli query --from=2019-11-07T16:40:00Z --to=2019-11-07T18:40:00Z '{cluster="us-central1", job="prod/distributor"} != "label value too long" != "sample timestamp out of order" != "sample with repeated" != "label names; limit"' --forward
2019-11-07T11:41:14-05:00 {filename="/var/log/pods/prod_distributor-6c946d865-dvlts_2d056b2a-f95b-11e9-96eb-42010a800155/distributor/0.log", instance="distributor-6c946d865-dvlts"} {"level":"warn","ts":"2019-11-07T16:41:14.875Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-726fc2eb-ef3c-43e5-9a88-f45ab6a4722f/etcd-client.prod.svc.cluster.local.:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: request timed out"}
2019-11-07T11:41:14-05:00 {filename="/var/log/pods/prod_distributor-6c946d865-4vw24_24943bd2-f95b-11e9-96eb-42010a800155/distributor/0.log", instance="distributor-6c946d865-4vw24"} {"level":"warn","ts":"2019-11-07T16:41:14.876Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-5375753c-f80b-48e1-bd53-117108a0b39b/etcd-client.prod.svc.cluster.local.:2379","attempt":0,"error":"rpc error: code = Unavailable desc = etcdse