molten:php Application transparent Link tracking tool

Source: Internet
Author: User
Tags app service php language learn php syslog

This article and we share the main is the application of transparent link tracking tool in PHP molten related content, A look at it, I hope to everyoneLearn PHPHelpful.
Molten
Molten is the application transparent link tracking Tool.
molten tracks the PHP core call Library runtime information and outputs the information in zipkin/optracing format.
Molten offers a variety of sapi, a variety of sampling types, escalation tracking status, module control and a variety of data landing types and other Functions.
relying on molten, it is easy to build a distributed Full-link tracking system based on the PHP language, which is now running on thousands of machines in the production Environment.
Catalogue
installation
Here's What you need to do to install molten on your system.
phpize
./configuremake && make install
make Install copy molten.so to the exact location, but you also need to open the module in PHP configuration, edit your own php.ini or add Molten.ini in/etc/php5/conf.d, and add the Following: Extension=molten.so.
in The./configure stage, You can also add--enable-zipkin-header=yes support Zipkin B3 header.
Quick Start
CD Examplesh run.sh
Open in Browserhttp://127.0.0.1:9411/zipkin/, you can see the link information.
If you think the above is too simple, you can do the following Operation.
CD Examplesh complex.sh
how, isn't it cool.
Note If you do not see the details, add 1 hours to the Endtime Option.
Configuration
Basic Configuration
molten.enable 1 Turn on 0 off, default 1.
Molten.service_name set the app service name, Default.
MOLTEN.TRACING_CLI 1 Tracks information in CLI mode, 0 off, default 0.
Sampling Configuration
molten.sampling_type type, 1 Sample rate control, 2 through request per minute, default is 1.
the Molten.sampling_request Sample Type is the number of requests sampled, the number of sample requests per minute, and the default is 10.
Molten.sampling_rate_base sampling rate, The sampling probability of each request is 256 by Default.
Control Module Configuration
Molten.notify_uri notifies the central administration of the Uri.
Escalation Module Configuration
the escalation module uses the same output type as the data module.
molten.report_interval Data Module call interval, default 60.
molten.report_limit Data escalation request limit, default 100.
Data Module
Molten.sink_type Data Landing type, 1 write file, file address dependent molten.sink_log_path, 2 write to Standard output, 3 write to syslog, 4 sent via curl, send address dependent molten.sin K_http_uri.
molten.output_type output All trace blocks (span) (1) or one line output a block (2).
Molten.sink_log_path writes the file address.
Molten.sink_http_uri sends an HTTP ADDRESS.
Molten.sink_syslog_unix_socket sends logs to the syslog UDP Unixdomain log collection Source.
Tracking Block Configuration
molten.span_format tracking Block format (span), different tracking systems Choose Zipkin or Opentracing.
Validation
php-d extension=molten.so-d molten.enable=1-d molten.sink_type=2-d molten.tracing_cli=1-d molten.sampling_rate= 1-r ' $c =curl_init ("http://localhost:12345"); curl_exec ($c); '
you can see the following output:
[{"traceid": "%s", "name": "php_curl", "version": "php-4", "id": "1.1", "parentid": "1", "timestamp":%d, "duration":% d, "annotations": [{"value": "cs", "timestamp":%d, "endpoint": {"serviceName": "%s", "ipv4": "%s"}},{"value": "cr", " Timestamp ":%d," endpoint ": {" serviceName ":"%s "," IPv4 ":"%s "}]," binaryannotations ": [{" key ":" http.url "," value ":" http:\/\/localhost:12345\/"," endpoint ": {" serviceName ":"%s "," IPv4 ":"%s "}},{" key ":" error "," value " :" Failed
Connect to localhost:12345; Connection
refused "," endpoint ": {" serviceName ":"%s "," IPv4 ":"%s "}}]},{" traceid ":"%s "," name ":" CLI "," version ":" php-4 "," ID ":" 1 "," timestamp ":%d," duration ":%d," annotations ": [{" value ":" SR "," timestamp ":%d," endpoint ": {" serviceName ":"%s ", "ipv4": "%s"}},{"value": "ss", "timestamp":%d, "endpoint": {"serviceName": "%s", "ipv4": "%s"}}], "binaryannotations": [{ "key": "path", "value": "-", "endpoint": {"serviceName": "%s", "ipv4": "%s"}]}]
function
from the above configuration, you can see the features we Provide.
Interception Device
molten intercepts curl,pdo,mysqli,redis,mongodb,memcached extensions and builds runtime tracking Information. full link Tracking is supported, molten replaces curl_exec,curl_setopt,curl_ The Setopt_array function is added, and the link header (x-w-traceid, x-w-spanid, and so On) is add to the Request.
Customizable link format with support for two popular formats (zipkin and opentracing).
sampling
two different sampling methods and can be modified through the control Module.
Data Landing
Molten currently supports 3 kinds of data landing methods, standard output, file, HTTP. And can choose the location of the Output.
Control
use the HTTP protocol to control probe Behavior.
View the status of the molten and request http://domain/molten/status through the Get Method.
the output is as follows and has been adapted to the Prometheus Format.
# Help Molten_request_all number of all request.# TYPE molten_request_all counter
molten_request_all%d# help Molten_request_capture number of request is capture.# TYPE molten_request_capture counter
molten_request_capture%d# help molten_sampling_type the type of sampling.# type Molten_sampling_type gauge
molten_sampling_type%d# Help molten_sampling_rate the rate of sampling.# type Molten_sampling_rate gauge
molten_sampling_rate%d# Help molten_sampling_request the request is capture one min.# TYPE molten_sampling_request g Auge
molten_sampling_request%d
Modify the Molten sampling method and use the Post method to request Http://domain/molten/status.
the data is in JSON format, and the meanings in fields and configuration items are Consistent.
{"enable": 1, "samplingtype": 2, "samplingrate": +, "samplingrequest":
escalation
the escalation module is able to record the key data information that molten has not picked up.


source: Github

molten:php Application transparent Link tracking tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.