This file contains hidden or 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: '2' | |
services: | |
pythonmetrics: | |
image: mateobur/pythonmetric | |
ports: | |
- 9100:9100 | |
restart: on-failure | |
networks: |
This file contains hidden or 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
from flask import Flask, request | |
import os | |
from sdcclient import SdcClient | |
app = Flask(__name__) | |
sdclient = SdcClient(open("/etc/sysdigtoken/token.txt","r").read().rstrip()) | |
metrics = [{ "id": "net.http.request.count", "aggregations": { "time": "timeAvg", "group": "avg" } }] | |
podname = os.environ['POD_NAME'] | |
def get_request_time(): |
This file contains hidden or 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
AWSTemplateFormatVersion: '2010-09-09' | |
Metadata: {} | |
Parameters: | |
########### | |
KeyName: | |
Description: The EC2 Key Pair to allow SSH access to the instance | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
AvailabilityZone: | |
Description: Availability zone to deploy |
This file contains hidden or 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
[OSEv3:children] | |
masters | |
etcd | |
nodes | |
[OSEv3:vars] | |
ansible_ssh_user=centos | |
ansible_sudo=true | |
ansible_become=true |
This file contains hidden or 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
--- | |
- hosts: nodes | |
gather_facts: no | |
pre_tasks: | |
- name: 'install python2' | |
raw: sudo yum install -y python | |
tasks: | |
- name: upgrade packages |
This file contains hidden or 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
type CustomMetricsProvider interface { | |
// GetRootScopedMetricByName fetches a particular metric for a particular root-scoped object. | |
GetRootScopedMetricByName(groupResource schema.GroupResource, name string, metricName string) (*custom_metrics.MetricValue, error) | |
// GetRootScopedMetricByName fetches a particular metric for a set of root-scoped objects | |
// matching the given label selector. | |
GetRootScopedMetricBySelector(groupResource schema.GroupResource, selector labels.Selector, metricName string) (*custom_metrics.MetricValueList, error) | |
// GetNamespacedMetricByName fetches a particular metric for a particular namespaced object. | |
GetNamespacedMetricByName(groupResource schema.GroupResource, namespace string, name string, metricName string) (*custom_metrics.MetricValue, error) |
This file contains hidden or 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
&custom_metrics.MetricValue{ | |
DescribedObject: custom_metrics.ObjectReference{ | |
APIVersion: info.GroupResource.Group + "/" + runtime.APIVersionInternal, | |
Kind: kind.Kind, | |
Name: name, | |
Namespace: namespace, | |
}, | |
MetricName: info.Metric, | |
Timestamp: metav1.Time{time.Now()}, | |
Value: *resource.NewMilliQuantity(int64(metricdatapoint*1000.0), resource.DecimalSI), |
This file contains hidden or 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
- name: custom-metrics-server | |
image: mateobur/custom-metrics-adapter:latest | |
args: | |
- --deploymentname=flask | |
- --servicename=flask | |
- --kubernetesnamespace=default | |
- --targetmetric=net.http.request.count | |
- --metrics-relist-interval=30s | |
- --v=10 | |
- --logtostderr=true |
This file contains hidden or 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
... | |
{ | |
"id": 14787, | |
"version": 17, | |
"createdOn": 1511433414000, | |
"modifiedOn": 1519827129000, | |
"type": "WEBHOOK", | |
"enabled": true, | |
"sendTestNotification": true, | |
"name": "Splunk", |
This file contains hidden or 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
{ | |
"id": 14787, | |
"version": 18, | |
"createdOn": 1511433414000, | |
"modifiedOn": 1519828577000, | |
"type": "WEBHOOK", | |
"enabled": true, | |
"sendTestNotification": false, | |
"name": "Splunk", | |
"options": { |