Skip to content

Instantly share code, notes, and snippets.

View ImDevinC's full-sized avatar
🏡
Building tools!

Devin Collins ImDevinC

🏡
Building tools!
View GitHub Profile
@ImDevinC
ImDevinC / processor.go
Created November 14, 2023 22:03
json flattener processor
package oteljsonlogflattenerprocessor
import (
"context"
"encoding/json"
"reflect"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/pdata/plog"
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
_ "github.com/joho/godotenv/autoload"
resource "aws_elasticsearch_domain" "temp_replication_testing" {
count = var.deploy_config.environment == "jupiterone-prod-eu" ? 1 : 0
domain_name = "temp-replication-testing" # domain names have to be unique
elasticsearch_version = var.es_version
cluster_config {
instance_type = var.es_instance_type
instance_count = var.es_instance_count
dedicated_master_enabled = var.es_dedicated_master_enabled
dedicated_master_count = var.es_dedicated_master_count
@ImDevinC
ImDevinC / index.ts
Last active August 29, 2023 16:17
Serverless OTEL Example
// index.ts
import { initializeTelemetry } from './initialize';
import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda';
import { SQSClient, SendMessageCommand, SendMessageCommandInput } from '@aws-sdk/client-sqs';
const sqsClient = new SQSClient({});
const publishMessage = async () => {
const input: SendMessageCommandInput = {
QueueUrl: process.env.QUEUE_URL,
// This will check for cortex.yaml or cortex.yml in all JupiterOne repositories.
// Run with go run main.go <github_pat>
package main
import (
"context"
"fmt"
"log"
"net/http"
@ImDevinC
ImDevinC / deploy.tf
Created May 11, 2023 06:49
Lambda Otel Wrapper
locals {
consumer_package_name = "message-consumer.zip"
consumer_package_path = "${path.module}/dist/${local.consumer_package_name}"
}
resource "aws_lambda_function" "message_consumer" {
s3_bucket = aws_s3_bucket_object.consumer_s3_source.bucket
s3_key = aws_s3_bucket_object.consumer_s3_source.id
s3_object_version = aws_s3_bucket_object.consumer_s3_source.version_id
function_name = "apm-message-consumer"
@ImDevinC
ImDevinC / test.yaml
Last active January 21, 2023 23:59
Sample websocket service
apiVersion: v1
kind: Namespace
metadata:
name: test-ws
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-ws
namespace: test-ws
[
{
"name": "nobl9",
"ring": "Assess",
"quadrant": "Tools",
"isNew": true,
"description": "Nobl9 is a platform that helps build SLO's from existing metrics"
},
{
"name": "Spacelift",
[
{
"name": "nobl9",
"ring": "Assess",
"quadrant": "Tools",
"isNew": true,
"description": "Nobl9 is a platform that helps build SLO's from existing metrics"
},
{
"name": "Spacelift",
@ImDevinC
ImDevinC / turn_off_time.yaml
Last active April 3, 2022 06:16
[HA] Turn off lights at a specific time
blueprint:
name: Turn off lights at specific time
description: Turn off lights at a specific time
domain: automation
input:
switch_target:
name: Switch
description: The switch(es) to turn off at sunrise
selector:
target: