Samuel Olowoyeye
01/09/2025, 6:24 PM{
"level": "info",
"ts": 1736444257.6623204,
"caller": "clickhousetracesexporter/writer.go:187",
"msg": "fetching should skip keys",
"kind": "exporter",
"data_type": "traces",
"name": "clickhousetraces",
"query": "\n\t\tSELECT tag_key, tag_type, tag_data_type, countDistinct(string_value) as string_count, countDistinct(number_value) as number_count\n\t\tFROM signoz_traces.distributed_tag_attributes_v2\n\t\tWHERE unix_milli >= (toUnixTimestamp(now() - toIntervalHour(6)) * 1000)\n\t\tGROUP BY tag_key, tag_type, tag_data_type\n\t\tHAVING string_count > 25000 OR number_count > 25000\n\t\tSETTINGS max_threads = 2"
}
Then in clickhouse i ran this query
SELECT
tag_key,
tag_type,
tag_data_type,
countDistinct(string_value) as string_count,
countDistinct(number_value) as number_count
FROM signoz_traces.distributed_tag_attributes_v2
WHERE unix_milli >= (toUnixTimestamp(now() - toIntervalHour(6)) * 1000)
GROUP BY tag_key, tag_type, tag_data_type
HAVING string_count > 25000 OR number_count > 25000
ORDER BY greatest(string_count, number_count) DESC
LIMIT 10;
Here is my result
tag_key |tag_type|tag_data_type|string_count|number_count|
------------+--------+-------------+------------+------------+
url.path |tag |string | 389216| 0|
url.full |tag |string | 309703| 0|
url.query |tag |string | 147894| 0|
db.statement|tag |string | 32277| 0|
nitya-signoz
01/10/2025, 7:59 AMSamuel Olowoyeye
01/10/2025, 8:00 AMSamuel Olowoyeye
01/10/2025, 8:01 AMSamuel Olowoyeye
01/10/2025, 8:01 AMnitya-signoz
01/10/2025, 8:05 AMSamuel Olowoyeye
01/10/2025, 8:21 AMnitya-signoz
01/10/2025, 9:06 AMOTEL_RESOURCE_ATTRIBUTES=service.name=my-service,deployment.environment=prod
Samuel Olowoyeye
01/10/2025, 9:37 AMSamuel Olowoyeye
01/10/2025, 10:55 AMenv:
- name: OTEL_RESOURCE_ATTRIBUTES
value: deployment.environment=prod
Here is the result
JAVA_TOOL_OPTIONS : -javaagent:/otel-auto-instrumentation-java/javaagent.jar
OTEL_EXPORTER_OTLP_ENDPOINT : <http://endpointIp:4318>
OTEL_PROPAGATORS : tracecontext,baggage,b3
OTEL_RESOURCE_ATTRIBUTES : deployment.environment=prod,k8s.container.name=app,k8s.deployment.name=spring-petclinic,k8s.deployment.uid=da0b2c92-2a6b-48e5-8b01-8544f0aa4c4d,k8s.namespace.name=platform,k8s.node.name=$(OTEL_RESOURCE_ATTRIBUTES_NODE_NAME),k8s.pod.name=$(OTEL_RESOURCE_ATTRIBUTES_POD_NAME),k8s.pod.uid=$(OTEL_RESOURCE_ATTRIBUTES_POD_UID),k8s.replicaset.name=spring-petclinic-5d67cf584f,k8s.replicaset.uid=07349d22-9752-430d-894e-d7abb9d1e5e4,service.version=latest
OTEL_RESOURCE_ATTRIBUTES_NODE_NAME : fieldRef(v1:spec.nodeName)
OTEL_RESOURCE_ATTRIBUTES_POD_NAME : fieldRef(v1:metadata.name)
OTEL_RESOURCE_ATTRIBUTES_POD_UID : fieldRef(v1:metadata.uid)
OTEL_SERVICE_NAME : spring-petclinic
OTEL_TRACES_SAMPLER : parentbased_always_on
Samuel Olowoyeye
01/10/2025, 3:03 PMapiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
name: my-instrumentation
spec:
propagators:
- tracecontext
- baggage
- b3
sampler:
type: parentbased_always_on
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: deployment.environment=prod
exporter:
endpoint: <http://endpointip:4318>
java:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:latest
nodejs:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:latest
python:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:latest
dotnet:
image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet:latest