Skip to content

Commit 1c27b77

Browse files
authored
[docs] Fixing examples formating (#1585)
1 parent 810d982 commit 1c27b77

File tree

1 file changed

+25
-20
lines changed
  • instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask

1 file changed

+25
-20
lines changed

instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,43 @@
3838
3939
FlaskInstrumentor().instrument(enable_commenter=True, commenter_options={})
4040
41+
For example, FlaskInstrumentor when used with SQLAlchemyInstrumentor or Psycopg2Instrumentor,
42+
invoking ``cursor.execute("select * from auth_users")`` will lead to sql query
43+
``select * from auth_users`` but when SQLCommenter is enabled the query will get appended with
44+
some configurable tags like:
4145
42-
For example,
43-
::
46+
.. code::
4447
45-
FlaskInstrumentor when used with SQLAlchemyInstrumentor or Psycopg2Instrumentor, invoking cursor.execute("select * from auth_users")
46-
will lead to sql query "select * from auth_users" but when SQLCommenter is enabled
47-
the query will get appended with some configurable tags like "select * from auth_users /*metrics=value*/;"
48+
select * from auth_users /*metrics=value*/;"
4849
49-
Inorder for the commenter to append flask related tags to sql queries, the commenter needs to enabled on
50-
the respective SQLAlchemyInstrumentor or Psycopg2Instrumentor framework too.
50+
Inorder for the commenter to append flask related tags to sql queries, the commenter needs
51+
to enabled on the respective SQLAlchemyInstrumentor or Psycopg2Instrumentor framework too.
5152
5253
SQLCommenter Configurations
5354
***************************
54-
We can configure the tags to be appended to the sqlquery log by adding configuration inside commenter_options(default:{}) keyword
55+
We can configure the tags to be appended to the sqlquery log by adding configuration
56+
inside ``commenter_options={}`` dict.
5557
56-
framework = True(Default) or False
58+
For example, enabling this flag will add flask and it's version which
59+
is ``/*flask%%3A2.9.3*/`` to the SQL query as a comment (default is True):
5760
58-
For example,
59-
::
60-
Enabling this flag will add flask and it's version which is /*flask%%3A2.9.3*/
61+
.. code:: python
6162
62-
route = True(Default) or False
63+
framework = True
6364
64-
For example,
65-
::
66-
Enabling this flag will add route uri /*route='/home'*/
65+
For example, enabling this flag will add route uri ``/*route='/home'*/``
66+
to the SQL query as a comment (default is True):
6767
68-
controller = True(Default) or False
68+
.. code:: python
6969
70-
For example,
71-
::
72-
Enabling this flag will add controller name /*controller='home_view'*/
70+
route = True
71+
72+
For example, enabling this flag will add controller name ``/*controller='home_view'*/``
73+
to the SQL query as a comment (default is True):
74+
75+
.. code:: python
76+
77+
controller = True
7378
7479
Usage
7580
-----

0 commit comments

Comments
 (0)