-
I have setup Istio tracing using opentelemetry collector but the traces dont appear to be correlated as expected below are my configuration Below is the istiod release resource "helm_release" "istiod" {
name = "istiod"
repository = "https://istio-release.storage.googleapis.com/charts"
chart = "istiod"
version = "1.19.3"
namespace = var.istio_system_namespace
create_namespace = true
values = [templatefile("${path.module}/resources/istiod-values.yaml", {
istio_namespace = var.istio_system_namespace
sampling = "100"
otel_collector = "otel-collector.${var.tracing_namespace}.svc.cluster.local"
})]
depends_on = [
helm_release.istio_base,
helm_release.oauth2_proxy
]
}
below is my global:
istioNamespace: ${istio_namespace}
meshConfig:
ingressService: istio-ingressgateway
ingressSelector: istio-ingressgateway
accessLogFile: /dev/stdout
accessLogFormat: |
[%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %RESPONSE_CODE_DETAILS% %CONNECTION_TERMINATION_DETAILS% "%UPSTREAM_TRANSPORT_FAILURE_REASON%" %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" %UPSTREAM_CLUSTER% %UPSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_REMOTE_ADDRESS% %REQUESTED_SERVER_NAME% %ROUTE_NAME% traceID=%REQ(x-b3-traceid)% parentspanId=%REQ(x-b3-parentspanid)%
enableAutoMtls: true
enableTracing: true
extensionProviders:
- opentelemetry:
port: 4317
service: ${otel_collector}
name: otel resource "kubernetes_manifest" "telemetry_istio_system_otel_tracing" {
manifest = {
apiVersion = "telemetry.istio.io/v1alpha1"
kind = "Telemetry"
metadata = {
name = "otel"
namespace = var.istio_system_namespace
}
spec = {
tracing = [
{
providers = [
{
name = "otel"
},
]
randomSamplingPercentage = 100
},
]
}
}
depends_on = [helm_release.istiod]
} This is my istio configuration. resource "kubectl_manifest" "open_telemetry_collector" {
force_new = true
yaml_body = <<YAML
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: otel
namespace: ${var.tracing_namespace}
spec:
mode: deployment
config: |
receivers:
zipkin:
otlp:
protocols:
grpc:
http:
exporters:
otlp/tempo:
endpoint: tempo.${var.tracing_namespace}.svc.cluster.local:4317
tls:
insecure: true
logging/debug:
verbosity: detailed
sampling_initial: 5
sampling_thereafter: 200
loki:
endpoint: "http://loki.${var.observability_namespace}.svc.cluster.local:3100/loki/api/v1/push"
processors:
batch:
send_batch_size: 50
timeout: 5s
memory_limiter:
check_interval: 2s
limit_mib: 400
spike_limit_mib: 200
service:
pipelines:
traces:
receivers:
- zipkin
- otlp
processors:
- batch
- memory_limiter
exporters: [otlp/tempo, logging/debug]
logs:
receivers:
- otlp
processors:
- batch
- memory_limiter
exporters: [loki]
YAML
depends_on = [
helm_release.oetl,
]
} Above is my otel configuration. resource "helm_release" "tempo" {
name = "tempo"
chart = "tempo"
repository = "https://grafana.github.io/helm-charts"
namespace = var.tracing_namespace
create_namespace = true
values = [
<<YAML
distributor:
receivers:
otlp:
protocols:
grpc:
http:
ingester:
trace_idle_period: 35s
overrides:
defaults:
metrics_generator:
processors: [service-graphs, span-metrics] # enables metrics generator and metrics summary
storage:
trace:
backend: local
pool:
queue_depth: 2000
wal:
path: /tmp/tempo/wal
local:
path: /tmp/tempo/blocks
metrics_generator:
storage:
path: /tmp/tempo/generator/wal
remote_write:
- url: http://prometheus-kube-prometheus-prometheus.observability.svc.cluster.local:9090/api/v1/write"
send_exemplars: true
registry:
external_labels:
source: tempo
processor:
service_graphs:
span_metrics:
enable_target_info: true
YAML
]
} and this is my tempo config. for testing I have deployed bookinfo example As you can see my traces are not correlated. also something odd I noticed is in the access logs I am logging the The traceId here does not look right ? (by using I would really appreciate any help and any information about how to solve this issue |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I did more looking in to the issue and below is a example log of the otel container ( below is the log of curl request to /productpage in the bookinfo example)
as you can see the request-id is same but traces are not correlating as expected. |
Beta Was this translation helpful? Give feedback.
I think this was the issue. it seems like this was an issue with the bookinfo version I installed. I tried to use the https://raw.githubusercontent.com/istio/istio/release-1.21/samples/bookinfo/platform/kube/bookinfo.yaml
This specific version and now seems to be working