Skip to content

Instantly share code, notes, and snippets.

View hughesjj's full-sized avatar

James Hughes (Splunk) hughesjj

  • Splunk
  • Seattle, WA
View GitHub Profile
@hughesjj
hughesjj / gist:c0d3fe334ccae646ce1a367b309a208b
Created December 6, 2023 07:21
otel contrib golang basic build
FROM golang:bookworm
RUN git clone https://github.com/open-telemetry/opentelemetry-collector-contrib.git
WORKDIR ./opentelemetry-collector-contrib
RUN make install-tools
RUN make # as of 2023-12-05 fails first on sigv4
RUN make integration-test # fails on jmx receiver
# How about we at least add to docs (README.md? CONTRIBUTING.md?) how to test individual recievers?

Without unmarshal I get this

sub, err := cm.Sub(tt.id.String())
require.NoError(t, err)
require.NoError(t, component.UnmarshalConfig(sub, cfg))

assert.NoError(t, component.ValidateConfig(cfg))
if diff := cmp.Diff(tt.expected, cfg, cmpopts.IgnoreUnexported(metadata.MetricsBuilderConfig{}), cmpopts.IgnoreUnexported(metadata.MetricSettings{})); diff != "" {
   t.Errorf("Config mismatch (-expected +actual):\n%s", diff)
@hughesjj
hughesjj / Find-OrphanDockerLayers.ps1
Created December 16, 2022 07:41 — forked from olljanat/Find-OrphanDockerLayers.ps1
Find Windows containers orphan layers
param (
[switch]$RenameOrphanLayers
)
If ($RenameOrphanLayers) {
Write-Warning "$($env:COMPUTERNAME) -RenameOrphanLayers option enabled, will rename all orphan layers"
}
# Get known layers on Docker images
[array]$ImageDetails += docker images -q | ForEach { docker inspect $_ | ConvertFrom-Json }
def open_file(filename: str) -> str:
with open(filename) as fin:
return fin.read()
docker = open_file("redis-config-docker-default.txt")
local = open_file("redis-config-local-default.txt")
def to_datastructure(file_contents:str):
tokens = file_contents.split('\n')