From 48f39402181d959cad88cb3f460210c007169f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 12 May 2021 11:13:47 +0200 Subject: Cowboy 2.9.0 --- .../cowboy/2.9/manual/cowboy_tracer_h/index.html | 212 +++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 docs/en/cowboy/2.9/manual/cowboy_tracer_h/index.html (limited to 'docs/en/cowboy/2.9/manual/cowboy_tracer_h/index.html') diff --git a/docs/en/cowboy/2.9/manual/cowboy_tracer_h/index.html b/docs/en/cowboy/2.9/manual/cowboy_tracer_h/index.html new file mode 100644 index 00000000..db6768e2 --- /dev/null +++ b/docs/en/cowboy/2.9/manual/cowboy_tracer_h/index.html @@ -0,0 +1,212 @@ + + + + + + + + + + Nine Nines: cowboy_tracer_h(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cowboy_tracer_h(3)

+ +

Name

+

cowboy_tracer_h - Tracer stream handler

+

Description

+

The module cowboy_tracer_h can be used to conditionally trace streams based on information found in the request. Trace messages are given to the configured callback.

+

Options

+
+
opts() :: #{
+    tracer_callback    => Callback,
+    tracer_flags       => [atom()],
+    tracer_match_specs => [MatchSpec]
+}
+
+Callback :: fun((init | terminate | tuple(), State) -> State)
+
+MatchSpec :: MatchPredicate
+           | {method, binary()}
+           | {host, binary()}
+           | {path, binary()}
+           | {path_start, binary()}
+           | {header, binary()}
+           | {header, binary(), binary()}
+           | {peer_ip, inet:ip_address()}
+
+MatchPredicate :: fun((cowboy_stream:streamid(),
+                       cowboy_req:req(),
+                       cowboy:opts()) -> boolean())
+}
+
+

Configuration for the tracer stream handler.

+

This module will not set trace patterns. Those must be set by the user directly, either from the callback's init or, preferably, in advance.

+
tracer_callback
+

The function that will be called for each trace events. It will also be called before any trace event with an argument init, and when the stream is terminated with an argument terminate.

+

This option is required for tracing to be enabled. The tracer stream handler does nothing otherwise.

+
+
tracer_flags
+

Trace flags to enable. See the documentation of erlang:trace/3 for details. Note that all trace flags are allowed except for the tracer flag.

+
+
tracer_match_specs
+

A list of match conditions that must all be fulfilled for the stream to be traced. Cowboy will compare these with the information found in the request and only enable tracing if all matches succeed.

+

This option is required for tracing to be enabled. The tracer stream handler does nothing otherwise.

+
+
+

Events

+

The tracer stream handler does not produce any event.

+

Changelog

+
  • 2.7: Module introduced. +
  • +
+

See also

+

cowboy(7), cowboy_stream(3), cowboy_compress_h(3), cowboy_metrics_h(3), cowboy_stream_h(3)

+ + + + + + +
+ +
+ + +

+ Cowboy + 2.9 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+ + +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + -- cgit v1.2.3