Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ entropy*.dev.yml
test_*.yml
test_*.json
requests.http
entropy.yaml
entropy.yaml
.DS_Store
2 changes: 1 addition & 1 deletion core/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (svc *Service) handleSync(ctx context.Context, res resource.Resource) (*res

func setupCounter(meter metric.Meter, countername SyncStatus) (metric.Int64Counter, error) {
return meter.Int64Counter(
fmt.Sprintf("%s_counter", countername),
fmt.Sprintf("entropy_%s_counter", countername),
metric.WithDescription(fmt.Sprintf("Total number of %s performed", countername)),
metric.WithUnit("1"),
)
Expand Down
14 changes: 8 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
pg14:
image: "postgres:14-alpine"
Expand All @@ -9,11 +7,15 @@ services:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- PUID=1000
- PGID=1000
restart: unless-stopped
container_name: pg14

otel-collector:
image: otel/opentelemetry-collector-contrib:0.123.0
command: [ "--config=/etc/otel/otel-collector-config.yaml" ]
volumes:
- ./docker:/etc/otel
ports:
- "4317:4317" # Otel grpc port`
- "4318:4318" # Otel http port`
volumes:
pgdata:
43 changes: 43 additions & 0 deletions docker/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
receivers:
otlp:
protocols:
grpc:
endpoint: :4317
http:
endpoint: :4318

exporters:
debug:
verbosity: detailed

extensions:
health_check: {}
processors:
batch: {}
# If set to null, will be overridden with values based on k8s resource limits
memory_limiter:
check_interval: 1s
limit_percentage: 50
service:
telemetry:
metrics:
address: 0.0.0.0:8888
extensions:
- health_check
pipelines:
logs:
exporters:
- debug
processors:
- memory_limiter
- batch
receivers:
- otlp
metrics:
exporters:
- debug
processors:
- memory_limiter
- batch
receivers:
- otlp
4 changes: 2 additions & 2 deletions entropy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ telemetry:
newrelic_api_key: ""

# enable_otel_agent enables the OpenTelemetry Exporter for both traces and views.
enable_otel_agent: false
enable_otel_agent: true

# otel_agent_addr is the addr of OpenTelemetry Collector/Agent. This is where the
# opene-telemetry exporter will publish the collected traces/views to.
otel_agent_addr: "localhost:8088"
otel_agent_addr: "localhost:4317"
22 changes: 13 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/Masterminds/squirrel v1.5.4
github.com/ghodss/yaml v1.0.0
github.com/go-playground/validator/v10 v10.15.4
github.com/google/go-cmp v0.6.0
github.com/google/go-cmp v0.7.0
github.com/gorilla/mux v1.8.0
github.com/goto/salt v0.3.7
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
Expand All @@ -25,13 +25,15 @@ require (
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.10.0
github.com/xeipuuv/gojsonschema v1.2.0
go.nhat.io/otelsql v0.15.0
go.opencensus.io v0.24.0
go.opentelemetry.io/otel v1.34.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0
go.opentelemetry.io/otel v1.35.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0
go.opentelemetry.io/otel/exporters/prometheus v0.56.0
go.opentelemetry.io/otel/metric v1.34.0
go.opentelemetry.io/otel/sdk v1.34.0
go.opentelemetry.io/otel/sdk/metric v1.34.0
go.opentelemetry.io/otel/metric v1.35.0
go.opentelemetry.io/otel/sdk v1.35.0
go.opentelemetry.io/otel/sdk/metric v1.35.0
go.uber.org/zap v1.26.0
google.golang.org/api v0.141.0
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97
Expand All @@ -46,6 +48,8 @@ require (
sigs.k8s.io/kind v0.23.0
)

require github.com/felixge/httpsnoop v1.0.4 // indirect

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
Expand Down Expand Up @@ -91,7 +95,7 @@ require (
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-errors/errors v1.5.0 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand Down Expand Up @@ -123,7 +127,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/microcosm-cc/bluemonday v1.0.25 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
Expand Down Expand Up @@ -176,7 +180,7 @@ require (
golang.org/x/net v0.32.0 // indirect
golang.org/x/oauth2 v0.24.0
golang.org/x/sync v0.10.0
golang.org/x/sys v0.29.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.3.0 // indirect
Expand Down Expand Up @@ -228,7 +232,7 @@ require (
github.com/valyala/fasthttp v1.50.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/runtime v0.59.0
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/arch v0.5.0 // indirect
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
Expand Down
Loading
Loading