Hello Team, I need help with this. I'm getting t...
# support
s
Hello Team, I need help with this. I'm getting this logs entry in my collector
Copy code
{
  "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
Copy code
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
Copy code
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|
n
You can ignore this log. cc @Srikanth Chekuri
s
Okay thank you.
In the meanwhile, I've been trying to understand how to send application logs without deploying the deamonset otel binary in my k8s cluster. I just want to send from my application directly to signoz collector.
Do you have any information I can use?
n
If you are using java or python or any language which supports the otel sdk directly you can do it. eg: https://signoz.io/docs/userguide/python-logs-auto-instrumentation/ https://signoz.io/docs/userguide/collecting_application_logs_otel_sdk_java/
s
Can't seem to set deploymentEnvironment here
n
Didn’t get you ? you can set resource attributes using env variable eg:
Copy code
OTEL_RESOURCE_ATTRIBUTES=service.name=my-service,deployment.environment=prod
s
Okay, I understand now
Thank you this worked, However since i was using the auto instrumentation, it became almost impossible to manually assign that attributes to all my microservice, however i found a way around it by editing the collector to includse this
Copy code
env:
    - name: OTEL_RESOURCE_ATTRIBUTES
      value: deployment.environment=prod
Here is the result
Copy code
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
Copy code
apiVersion: 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