https://signoz.io logo
#general
Title
# general
o

oluchi orji

03/23/2023, 10:02 AM
hello How do I get access to the clickhouse database, I am currently trying to use a python library but it is not working. @Ankit Nayan šŸ‘€ Thanks in advance
Copy code
import clickhouse_connect

client = clickhouse_connect.get_client(
    host='signoz-clickhouse.<namespace>.svc.cluster.local',
    port=8123,
    username='admin',
    password='<password>')
print(client)
a

Ankit Nayan

03/23/2023, 12:16 PM
@oluchi orji where are you trying to connect from? The host path will be accessible only from a container in the same cluster as clickhouse/signoz. Also, I assume you are using
helm
installation of SigNoz?
o

oluchi orji

03/23/2023, 12:17 PM
Yes, I am using a helm installation on Amazon EKS and the application is running as a cron job on the same cluster hosting signoz
I have a curious question, if I want to test locally , is it only via the service DNS name I can test @Ankit Nayan? Is there another way
a

Ankit Nayan

03/23/2023, 12:22 PM
you can connect using
Copy code
host='chi-my-release-clickhouse-cluster-0-0.<namespace>.svc.cluster.local'
v

Vishal Sharma

03/23/2023, 12:22 PM
@oluchi orji I think you are missing Database which can be
signoz_logs
or
signoz_metrics
or
signoz_traces
Ignore this as you are using k8s helm charts Also username should be
default
and password is not set and just add empty string
a

Ankit Nayan

03/23/2023, 12:24 PM
username and password are set for helm chart @Vishal Sharma https://github.com/SigNoz/charts/blob/main/charts/signoz/values.yaml#L96-L98
o

oluchi orji

03/23/2023, 12:25 PM
Yeah, I am using the default password and username specified on the value file
a

Ankit Nayan

03/23/2023, 12:25 PM
I have a curious question, if I want to test locally , is it only via the service DNS name I can test
I usually port-forward connect to clickhouse svc and connect my script as if clickhouse was running on local
Copy code
kubectl -n <namespace> port-forward svc/my-release-clickhouse 9000:9000
o

oluchi orji

03/23/2023, 12:26 PM
Oh, I didn't think of port forwarding, thanks for this , have a good day
thanks @Ankit Nayan, @Vishal Sharma
a

Ankit Nayan

03/23/2023, 12:26 PM
what are you trying to do in the cronjob? I am curious of the use case
o

oluchi orji

03/23/2023, 12:29 PM
1. Get. a report for exceptions raised in our applications logs ( especially customer serving) 2. Get a report for runtime errors
a

Ankit Nayan

03/23/2023, 12:30 PM
Interesting. Might be good to build it in the product itself
o

oluchi orji

03/23/2023, 12:31 PM
I don't understandšŸ‘€
a

Ankit Nayan

03/23/2023, 12:31 PM
from SigNoz's UI you could download a report
what are runtime errors?
o

oluchi orji

03/23/2023, 12:36 PM
ā€¢ E.g panic errors in golang such as Out of bounds array access, Incorrect type assertion ā€¢ in python , using an undefined variable or function name or performing an operation on incompatible types.
a

Ankit Nayan

03/23/2023, 12:38 PM
got it
aren't they same as exceptions?
o

oluchi orji

03/23/2023, 12:39 PM
Yeah, maybešŸ˜„
a

Ankit Nayan

03/23/2023, 12:39 PM
šŸ˜„
is the report to be generated a spreadsheet or pdf?
o

oluchi orji

03/23/2023, 12:40 PM
spreadsheet at the moment
10 Views