This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import boto3 | |
import json | |
from boto3.dynamodb.conditions import Key, Attr | |
from datetime import datetime | |
DIMENSION = 'logicalCpuCount' | |
TABLE_NAME = 'ms-usage-metering' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# cc-viz.py | |
# | |
# A hastily-thrown together collection of functions that gets confluent cloud metrics into datadog, graphite, or prometheus (or any combination of those) | |
# | |
GRAPHITE_HOST = '10.1.2.3' | |
GRAPHITE_PORT = 2003 | |
GRAPHITE_METRIC_PREFIX = 'confluent.cloud.kafka' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FIXED_HOURLY_COSTS = { | |
'DISKS': { | |
'aws': { | |
'us-east-1': { | |
'io1': 0.125 / 30 / 24, | |
'gp2': 0.1 / 30 / 24, | |
'st1': 0.045 / 30 / 24, | |
'sc1': 0.025 / 30 / 24 | |
}, | |
'us-east-2': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### how to upload to gist with bash / curl | |
DESC="file that I'm uploading" | |
FNAME="file_to_upload" | |
FPATH="/tmp/file_to_upload" | |
# 1. Somehow sanitize the file content | |
# Remove \r (from Windows end-of-lines), | |
# Replace tabs by \t | |
# Replace " by \" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################### | |
Instance: 10.74.147.10:7203 | |
##################################### | |
Matching: 1/350. Bean name: kafka.network:type=RequestMetrics,name=RequestsPerSec,request=OffsetCommit,version=6 - Attribute name: Count - Attribute type: long | |
Matching: 2/350. Bean name: kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=FetchConsumer - Attribute name: 50thPercentile - Attribute type: double | |
Matching: 3/350. Bean name: kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=FetchConsumer - Attribute name: Mean - Attribute type: double | |
Matching: 4/350. Bean name: kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=FetchConsumer - Attribute name: 99thPercentile - Attribute type: double | |
Matching: 5/350. Bean name: kafka.network:type=RequestMetrics,name=ResponseSendTimeMs,request=FetchConsumer - Attribute name: 999thPercentile - Attribute type: double |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################### | |
Instance: 10.74.147.10:7203 | |
##################################### | |
Not Matching: Bean name: kafka.log:type=Log,name=Size,topic=lkc-4vndj__confluent-ksql-ksql-prodtransient_5013047390911865834_1548275444821-KSTREAM-AGGREGATE-STATE-STORE-0000000006-repartition,partition=1 - Attribute name: Value - Attribute type: java.lang.Object | |
Not Matching: Bean name: kafka.cluster:type=Partition,name=InSyncReplicasCount,topic=__consumer_offsets,partition=37 - Attribute name: Value - Attribute type: java.lang.Object | |
Not Matching: Bean name: kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=ListGroups - Attribute name: Count - Attribute type: long | |
Not Matching: Bean name: kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=ListGroups - Attribute name: Min - Attribute type: double | |
Not Matching: Bean name: kafka.network:type=RequestMetrics,name=ResponseQueueTimeMs,request=ListGroups - Attribute name: 50thPercentile - A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/confluentinc/confluent-kafka-go/kafka" | |
"github.com/prometheus/common/model" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyUnEncryptedObjectUploads", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::prod-secrets/*", | |
"Condition": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```#!/usr/bin/env python | |
""" | |
Exports Issues from a specified repository to a CSV file | |
Uses basic authentication (Github username + password) to retrieve Issues | |
from a repository that username has access to. Supports Github API v3. | |
""" | |
import csv | |
import requests | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you're having problems creating an admin role binding in k8s on GKE, | |
# make sure you're a project owner first in the project the cluster is in | |
# Then you can do this: | |
~$ kubectl create clusterrolebinding foo-cluster-admin-binding --clusterrole=cluster-admin --user="[email protected]" | |
clusterrolebinding "foo-cluster-admin-binding" created |
NewerOlder