1
0
Fork 0

Migrate to opentelemetry

This commit is contained in:
Jesse Haka 2024-01-08 10:10:06 +02:00 committed by GitHub
parent 45bb00be04
commit 4ddef9830b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 2113 additions and 3898 deletions

View file

@ -0,0 +1,21 @@
receivers:
otlp:
protocols:
grpc:
http:
exporters:
otlp/tempo:
endpoint: http://tempo:4317
tls:
insecure: true
service:
telemetry:
logs:
level: "error"
extensions: [ health_check ]
pipelines:
traces:
receivers: [otlp]
exporters: [otlp/tempo]
extensions:
health_check:

View file

@ -1,70 +0,0 @@
[global]
checkNewVersion = false
sendAnonymousUsage = false
[log]
level = "DEBUG"
noColor = true
[api]
insecure = true
[entryPoints]
[entryPoints.web]
address = ":8000"
[tracing]
servicename = "tracing"
[tracing.jaeger]
samplingType = "const"
samplingParam = 1.0
samplingServerURL = "http://{{.IP}}:5778/sampling"
localAgentHostPort = "{{.IP}}:6831"
traceContextHeaderName = "{{.TraceContextHeaderName}}"
[providers.file]
filename = "{{ .SelfFilename }}"
## dynamic configuration ##
[http.routers]
[http.routers.router1]
Service = "service1"
Middlewares = ["retry", "ratelimit-1"]
Rule = "Path(`/ratelimit`)"
[http.routers.router2]
Service = "service2"
Middlewares = ["retry"]
Rule = "Path(`/retry`)"
[http.routers.router3]
Service = "service3"
Middlewares = ["retry", "basic-auth"]
Rule = "Path(`/auth`)"
[http.middlewares]
[http.middlewares.retry.retry]
attempts = 3
[http.middlewares.basic-auth.basicAuth]
users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/", "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"]
[http.middlewares.ratelimit-1.rateLimit]
average = 1
burst = 2
[http.services]
[http.services.service1]
[http.services.service1.loadBalancer]
passHostHeader = true
[[http.services.service1.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"
[http.services.service2]
[http.services.service2.loadBalancer]
passHostHeader = true
[[http.services.service2.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"
[http.services.service3]
[http.services.service3.loadBalancer]
passHostHeader = true
[[http.services.service3.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"

View file

@ -15,12 +15,15 @@
[tracing]
servicename = "tracing"
[tracing.jaeger]
samplingType = "const"
samplingParam = 1.0
samplingServerURL = "http://{{.IP}}:5778/sampling"
[tracing.jaeger.collector]
endpoint = "http://{{.IP}}:14268/api/traces?format=jaeger.thrift"
sampleRate = 1.0
{{if .IsHTTP}}
[tracing.otlp.http]
endpoint = "http://{{.IP}}:4318"
{{else}}
[tracing.otlp.grpc]
endpoint = "{{.IP}}:4317"
insecure = true
{{end}}
[providers.file]
filename = "{{ .SelfFilename }}"
@ -28,6 +31,10 @@
## dynamic configuration ##
[http.routers]
[http.routers.router0]
Service = "service0"
Middlewares = []
Rule = "Path(`/basic`)"
[http.routers.router1]
Service = "service1"
Middlewares = ["retry", "ratelimit-1"]
@ -50,8 +57,13 @@
average = 1
burst = 2
[http.services]
[http.services.service0]
[http.services.service0.loadBalancer]
passHostHeader = true
[[http.services.service0.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"
[http.services.service1]
[http.services.service1.loadBalancer]
passHostHeader = true

View file

@ -1,66 +0,0 @@
[global]
checkNewVersion = false
sendAnonymousUsage = false
[log]
level = "DEBUG"
noColor = true
[api]
insecure = true
[entryPoints]
[entryPoints.web]
address = ":8000"
[tracing]
servicename = "tracing"
[tracing.zipkin]
httpEndpoint = "http://{{.IP}}:9411/api/v2/spans"
[providers.file]
filename = "{{ .SelfFilename }}"
## dynamic configuration ##
[http.routers]
[http.routers.router1]
service = "service1"
middlewares = ["retry", "ratelimit-1"]
rule = "Path(`/ratelimit`)"
[http.routers.router2]
service = "service2"
middlewares = ["retry"]
rule = "Path(`/retry`)"
[http.routers.router3]
service = "service3"
middlewares = ["retry", "basic-auth"]
rule = "Path(`/auth`)"
[http.middlewares]
[http.middlewares.retry.retry]
attempts = 3
[http.middlewares.basic-auth.basicAuth]
users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/", "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"]
[http.middlewares.ratelimit-1.rateLimit]
average = 1
burst = 2
[http.services]
[http.services.service1]
[http.services.service1.loadBalancer]
passHostHeader = true
[[http.services.service1.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"
[http.services.service2]
[http.services.service2.loadBalancer]
passHostHeader = true
[[http.services.service2.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"
[http.services.service3]
[http.services.service3.loadBalancer]
passHostHeader = true
[[http.services.service3.loadBalancer.servers]]
url = "http://{{.WhoamiIP}}:{{.WhoamiPort}}"

View file

@ -0,0 +1,56 @@
server:
http_listen_port: 3200
query_frontend:
search:
duration_slo: 5s
throughput_bytes_slo: 1.073741824e+09
trace_by_id:
duration_slo: 5s
distributor:
receivers:
otlp:
protocols:
grpc:
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
trace_idle_period: 1s
max_block_duration: 1m
complete_block_timeout: 5s
flush_check_period: 1s
compactor:
compaction:
block_retention: 1h
metrics_generator:
registry:
external_labels:
source: tempo
cluster: docker-compose
storage:
path: /tmp/tempo/generator/wal
remote_write:
- url: http://prometheus:9090/api/v1/write
send_exemplars: true
storage:
trace:
backend: local # backend configuration to use
wal:
path: /tmp/tempo/wal # where to store the wal locally
local:
path: /tmp/tempo/blocks
overrides:
defaults:
metrics_generator:
processors: [service-graphs, span-metrics] # enables metrics generator