I'm trying to connect to a SQL Server database via Prometheus. I think I'm supposed to do this using mssql_exporter or sql_exporter but I simply don't know how. I can see the metrics of prometheus itself and use those metrics to build a graph but again, I'm trying to do that with a database. The query doesn't matter, I just need to somehow access a database through prometheus. I've come to this point by watching some tutorials and web searching but I'm afraid I'm stuck at this point. Can anyone help me on this topic. Maybe there is a good tutorial I overlooked or maybe I'm having a hard time understanding the documentation but I would really appreciate some form of help very much. Thanks in advance.
Prometheus scrapes the metrics via HTTP. The exporters take the metrics and expose them in a format, so that prometheus can scrape them.
What you can check:
is the exporter exporting the metrics (can you reach the /metrics page with your browser or curl)
are there any warnings or rrors in the logs of the exporter
is prometheus able to scrape the metrics (open prometheus - status - targets)
I've figured how to do what I asked:
You want to download Prometheus and the exporter you need.
You want to configure your 'exporter.yml' file: In my case, it was the data_source_name variable in the 'sql_exporter.yml' file. By default, it is set to:
data_source_name: 'sqlserver://prom_user:prom_password#dbserver1.example.com:1433'
So you want to change 'prom_user:prom_password' part to your SQL Server user name and password, 'dbserver1.example.com' part to your server name which is the top name you see on your object explorer in SSMS.
After these, you need to let prometheus know about your exporter. Therefore, you need to configure your prometheys.yml file and add a new job. Name it whatever you'd like and write the port of the exporter that it is working on. After you've done that, you can see if it worked through localhost:9090/targets (9090 being the prometheus default port here). If you can see the exporter there, that means this step was successful and you can now see the metrics your exporter is exporting.
You can now add prometheus as a data source to grafana and use the metrics you need to build a dashboard.
Related
I'm new to Hystrix and I just created my first Hystrix Commands. The commands are being created and executed in a loop so the metrics data should have being registered. I am using the servo metrics publisher as follows:
HystrixPlugins.getInstance()
.registerMetricsPublisher(HystrixServoMetricsPublisher.getInstance());
EDIT:
Looking at the JConsole I found the related metrics definition as follows in the link:
jconsole
I am not using spring, eureka, servo to read data and run the app.
I would like to know how to expose this data in a way that prometheus can read. I tried hystrix-prometheus, but the documentation is not helpful when it is about where the metrics are being exposed, how to get them or check the them.
In order to retrieve Hystrix metrics, you'll first need to get Prometheus' Java Simple Client up and running. The setup depends on your environment. Independent of your environment the result should be a URL where you can retrieve i.e. simple Java metrics.
Once that it up and running, you can use the line
HystrixPrometheusMetricsPublisher.register("application_name");
to register the additional Hystrix metrics. They will be served by the same URL. Please note that you will see Hystrix metrics only after the first call of a Hystrix enabled command.
I want to check latencies of RPC every day about CakePHP Application each endpoints running in GKE cluster. I found it is possible using php google client or zipkin server by reading documents , but I don't know how easy to introduce to our app though both seem tough for me.
In addition, I'm concerned about GKE cluster configuration has StackDriver Trace option though our cluster it sets disabled.Can we trace span if it sets enable?
Could you give some advices?
I succeeded to send gcp's trace api in php client via REST. It can see trace set by php client parameters , but my endpoint for trace api has stopped though I don't know why.Maybe ,it is not still supported well because the document have many ambiguous expression so, I realized watching server response by BigQuery with fluentd and DataStudio and it seem best solution because auto span can be set by table name with yyyymmdd and we can watch arbitrary metrics with custom query or calculation field.
I am developing an application and decided Nagios3 for performing monitoring stuff. But I am stuck at two points. I am using check_http plug-in for monitoring load on my service api. Now I want to perform below tasks.
I need to set a threshold in check_http for performing some task after crossing that threshold. I tried below command
'check_command check_nrpe_1arg!check_service_api'
but it only tells me the load, not any threshold is set. while below one doesn't work.
'check_command check_service_api!100!200'
I need to send simple text message on some port(my application).
I am new to Nagios, so please help me figuring out the solution except email notification stuff.
There is a check command that you can download called "notify_sms" that integrates with an API server hosted by a company called Esendex. They charge for their service but it works well.
I want to export some tables in my DB to an Excel/Spreadsheet every month.
In PHPMyAdmin there is a direct option of exporting the result of a query to the desired filetype. How do I make use of this export feature without another script to run a cronjob on a monthly basis?
Basically on a CPanel (the DB is hosted in the web) we just have to give the path to the script to be executed via a cronjob. But in PHPMyAdmin there is no such opportunity. Its an included feature of PHPMyAdmin where we generally click and do it mannually. So how do i do it in Cpanel?
Do you have ssh access to the box? Personally I'd implement this outside of phpmyadmin, as phpmyadmin is just intended for manual operations via the interface. Why not write a simple script to export the db?
Something like mysqldump database table.
Being a web-app, the export function is a POST request. In the demo application the URL is http://demo.phpmyadmin.net/STABLE/export.php, and then the post data contains all the required parameters, for example: (You can use Fiddler/Chrome dev tools too view it)
token:3162d3b849cf652c2577a45f90022df7
export_type:server
export_method:quick
quick_or_custom:custom
output_format:sendit
filename_template:#SERVER#
remember_template:on
charset_of_file:utf-8
compression:none
what:excel
codegen_structure_or_data:data
codegen_format:0
csv_separator:,
csv_enclosed:"
.....
The one tricky bit is the authentication token, but I believe this is also possible to overcome using some configuration and/or extract parameters (like the 'direct login' in http://demo.phpmyadmin.net/)
See here
How to send data using curl from Linux command line?
If you want to avoid all this, there are many other web-automation tools that can record the scenario and play it back.
just write a simple php script to connect to your database and use the answer here:How to output MySQL query results in CSV format?
I am afraid to ask this kind of question as it has many factors to consider and its not easy for others to give suggestions.
But, I have to do this task and couldnt trace out the possible way to do this. One requirement I know is with the help of AJAX controls and Update panel ( I never worked on them) I have to do this.
Please please some ideas and suggstions, of how to start and soem pinpoints to get there.
it will be an internal portal site and users can access the data from this website which I have uploaded to the database and download data using UI I have.
hoping some help on this.
Thank you,
Ramm
You will need 2 components
1. Excel VBA : for retrieving data from web service and sending data to web service
2. Web Service : for providing data to excel vba and receiving data from excel vba for saving to database
I currently working for a project with this kind of mechanism, which involved database as backend and excel as user interface.
Here's a simple example in PHP using MySQL - http://www.w3schools.com/PHP/php_ajax_database.asp
You're right. That's way too much for anyone to try to answer. But here are some links that should help:
Microsoft ASP.NET Ajax: http://www.asp.net/learn/ajax/
Db-driven ASP.NET App Tutorial: http://www.asp.net/learn/3.5-videos/video-363.aspx