Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest otel #17

Merged
merged 15 commits into from
Jan 10, 2024
Merged
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
4 changes: 2 additions & 2 deletions certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setup_certs(){
-nodes \
-x509 \
-subj "/C=US/ST=CA/O=MyOrg/CN=myOrgCA" \
-addext "subjectAltName=DNS:example.com,DNS:example.net,DNS:otel_collector" \
-addext "subjectAltName=DNS:example.com,DNS:example.net,DNS:otel_collector,DNS:jaeger,DNS:prometheus" \
-CA confs/tls/rootCA.crt \
-CAkey confs/tls/rootCA.key \
-keyout confs/tls/server.key \
Expand All @@ -42,7 +42,7 @@ setup_certs(){
-nodes \
-x509 \
-subj "/C=US/ST=CA/O=MyOrg/CN=myOrgCA" \
-addext "subjectAltName=DNS:example.com,DNS:example.net,DNS:otel_collector" \
-addext "subjectAltName=DNS:example.com,DNS:example.net,DNS:otel_collector,DNS:jaeger,DNS:prometheus" \
-CA confs/tls/rootCA.crt \
-CAkey confs/tls/rootCA.key \
-keyout confs/tls/client.key \
Expand Down
17 changes: 17 additions & 0 deletions confs/jaeger-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Docs: https://www.jaegertracing.io/docs/1.53/cli/#jaeger-all-in-one
memory.max-traces: "10000"
query.base-path: "/jaeger/ui"
log-level: "info"
collector:
otlp:
enabled: true # Enables OpenTelemetry OTLP receiver on dedicated HTTP and gRPC ports
grpc:
host-port: "0.0.0.0:4317"
tls:
enabled: true
cert: /etc/tls/server.crt
key: /etc/tls/server.key
client-ca: /etc/tls/rootCA.crt
# http:
# host-port: "127.0.0.1:4318"
# etc
37 changes: 27 additions & 10 deletions confs/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,46 +52,63 @@ processors:

# (c) Exporters
# An exporter, which can be push or pull based, is how you send data to one or more destinations.
# The list of all exporters(that can be used in collector config) is found;
# https://opentelemetry.io/ecosystem/registry/?s=exporter&language=collector
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter

exporters:
# Data sources: traces, metrics, logs
file/mine: # https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/fileexporter
path: /etc/otel_file_exporter.json
rotation:
max_megabytes: 1 # max size in megabytes b4 rotation.
max_megabytes: 100 # max size in megabytes b4 rotation.
max_backups: 2
localtime: true
format: json

# Data sources: traces, metrics, logs
# logging:
# loglevel: debug
# debug: # Prior to v0.86.0 use `logging` instead of `debug`
# verbosity: detailed

# Data sources: traces, metrics, logs
# otlp:
# otlp/some-custom-name:
# endpoint: otel_collector:4317
# headers:
# header1: "header-value1"

# Data sources: traces, metrics
jaeger:
endpoint: jaeger:14250
# jaeger is deprecated and removed as an exporter.
# see: https://github.com/open-telemetry/opentelemetry-specification/pull/2858
# Instead, it can now speak native otlp protocol. See next section.
# jaeger:

# Data sources: traces, metrics, logs
# jaeger has native otlp protocol support. So otel collector can just send/export to it.
otlp/jaeger:
endpoint: "jaeger:4317"
tls:
insecure: true
# insecure: false
cert_file: /etc/tls/server.crt
key_file: /etc/tls/server.key
ca_file: /etc/tls/rootCA.crt # For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA.

# Data sources: metrics
prometheus: # configure OpenTelemetry Collector to export data to Prometheus
endpoint: "otel_collector:9464"


# (d) Extensions
# (d) Connectors
# Connectors join two pipelines, acting as both exporter and receiver.
# A connector consumes data as an exporter at the end of one pipeline and emits data as a receiver at the beginning of another pipeline.

# (e) Extensions
# Extensions are available primarily for tasks that do not involve processing telemetry data
# They are optional

extensions:
zpages: # Enables an HTTP endpoint with data for debugging different components that were properly instrumented for such.

# (e) Service
# (f) Service
# The service section is used to configure what components are enabled in the Collector based on the configuration found in the receivers, processors, exporters, and extensions sections.
# If a component is configured, but not defined within the service section then it is not enabled.
# The service section consists of three sub-sections:
Expand All @@ -107,7 +124,7 @@ service:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [file/mine, jaeger]
exporters: [file/mine, otlp/jaeger]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
Expand Down
33 changes: 13 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,18 @@ services:
# ********************
# Jaeger
jaeger:
image: jaegertracing/all-in-one:1.48.0
image: jaegertracing/all-in-one:1.53.0
command:
- "--memory.max-traces"
- "10000"
- "--query.base-path"
- "/jaeger/ui"
- "--config-file"
- "/etc/jaeger-config.yaml"
volumes:
- ./confs/tls:/etc/tls
- ./confs/jaeger-config.yaml:/etc/jaeger-config.yaml
ports:
# Agent zipkin.thrift compact
- "5775:5775"
# Agent jaeger.thrift compact
- "6831:6831"
# Agent jaeger.thrift binary
- "6832:6832"
# Agent config HTTP
- "5778:5778"
# Collector HTTP
- "14268:14268"
# Collector gRPC
- "14250:14250"
# OTLP over gRPC receiver
- "14317:4317"
# OTLP over HTTP receiver
- "14318:4318"
# Web HTTP
- "16686:16686"
environment:
Expand All @@ -69,7 +62,7 @@ services:

# Prometheus
prometheus:
image: prom/prometheus:v2.47.0
image: prom/prometheus:v2.48.1
container_name: prometheus
command:
- --web.console.templates=/etc/prometheus/consoles
Expand All @@ -88,12 +81,12 @@ services:

# OpenTelemetry Collector
otel_collector:
image: otel/opentelemetry-collector-contrib:0.84.0
image: otel/opentelemetry-collector-contrib:0.91.0
command: --config=/etc/otel-collector-config.yaml
volumes:
- ./confs/tls:/etc/tls
- ./confs/otel-collector-config.yaml:/etc/otel-collector-config.yaml
- ./confs/otel_file_exporter.json:/etc/otel_file_exporter.json
- ./confs/tls:/etc/tls
# The official opentelemetry-collector-contrib container does not have a writable filesystem(its built from scratch docker image)
# Hence, we need to add this file and make it writabe; `chmod 777 confs/file_exporter.json`
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/fileexporter
Expand Down
44 changes: 21 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@ module github.com/komuw/otero
go 1.21

require (
github.com/rs/zerolog v1.30.0
github.com/rs/zerolog v1.31.0
github.com/sirupsen/logrus v1.9.3
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.43.0
go.opentelemetry.io/otel v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.40.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.17.0
go.opentelemetry.io/otel/metric v1.17.0
go.opentelemetry.io/otel/sdk v1.17.0
go.opentelemetry.io/otel/sdk/metric v0.40.0
go.opentelemetry.io/otel/trace v1.17.0
google.golang.org/grpc v1.58.0

go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/metric v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/sdk/metric v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
google.golang.org/grpc v1.60.1
)

require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.17.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.17.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
)
Loading