-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics instrumentation mysql #1154
Comments
@srikanthccv Can I take this ?? |
@srikanthccv | max_connect_errors | 100 | 2)show global status: https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html Are we on the right direction?? |
@rahulhacker we don't want to make requests to database server and get the data. The client instrumentation should only work with what client library provides. |
@srikanthccv @dazuma @elskwid @dmathieu |
@rahulhacker Please don't tag random people. I'm not a python developer and know next to nothing about this repository. |
@srikanthccv Can u guide me for further?? |
@srikanthccv : Please help on the below: |
@rahulhacker I am not sure what you are trying to do. Please follow this guide for developing locally https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CONTRIBUTING.md |
@srikanthccv: we are done setup to run python-contrib to run locally . class MySQLInstrumentor(BaseInstrumentor): We are running this query SHOW VARIABLES LIKE 'max_connections'; to get the max_connection which we are saving as updowncounter mysql> SHOW VARIABLES LIKE 'max_connections'; correct me if my going in right direction ??? Or |
@srikanthccv Waiting for ur guidance, can u please help me on the above?? |
@srikanthccv We are new to OTEL community . Could you confirm are we in right path ? waiting for your guidelines we are done setup to run python-contrib to run locally . As per your comments We are using below MySQLInstrumentor to connect a mysql db . class MySQLInstrumentor(BaseInstrumentor): We are modifying the file https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/__init__.py We are running this query SHOW VARIABLES LIKE 'max_connections'; to get the max_connection which we are saving as updowncounter mysql> SHOW VARIABLES LIKE 'max_connections'; correct me if my going in right direction ??? |
@rahulhacker I mentioned it above here #1154 (comment). You shouldn't make additional requests to database. This is a client library instrumentation and it should only provide this client measurements. The DB server metrics are collected using receiver provided here https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/mysqlreceiver. This is probably not a good first issue if you are brand new to this project. |
@srikanthccv Thanks a lot for providing the info, but the reason for choosing this issue and it mentioned in the label as "good for new comers", but anyhow i will try to see if still can able to work.. an raise PR for the same :) |
Hi, @rahulhacker Do you work on this issue? |
@shalevr Are you wanting to take this on? @rahulhacker any progress on this? |
@lzchen : I am working on this , will update on the progress. |
@srikanthccv @lzchen : Please provide your inputs here Creating connections To make our custom code to work need to import some of the Open Telemetry library working with metrics. Counter We are defining out own method to collect the required metrics. ` def _instrument(self, **kwagrs):
` def _collect_connection_pool_metrics(self):
In the instrument_connection function, need to add the code to call the instance of the UpDownCounter to add the no of connections pools being in used state. #####Lines to add:
In the uninstrument_connection function, need to add the code to call the instance of the UpDownCounter to add back the no of connections objects back to the pools with the state as “Idle”. if connection is active
|
@srikanthccv :Can you please review the comments and let me know if we are on the right track ?? |
I am sorry I won't be able to review or respond to the comments here. I understand I created the issue, but I no longer have time or context to respond meaningfully. I apologise again. |
@srikanthccv : Thank you for letting me know. I completely understand, and there's no need to apologize. |
DB semconv:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/database-metrics.md
The text was updated successfully, but these errors were encountered: