File tree 6 files changed +67
-6
lines changed
6 files changed +67
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,4 @@ RUN chmod 644 censo.csv
15
15
ADD https://raw.githubusercontent.com/okfn-brasil/querido-diario-data-processing/main/config/themes_config.json themes_config.json
16
16
RUN chmod 644 themes_config.json
17
17
18
- RUN opentelemetry-bootstrap -a install
19
-
20
18
USER gazette
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ load-data:
135
135
136
136
.PHONY : re-run
137
137
re-run : setup-environment wait-opensearch wait-database
138
- $(call run-command, opentelemetry-instrument --traces_exporter console --metrics_exporter console --logs_exporter console --service_name querido-diario-api python main)
138
+ $(call run-command, opentelemetry-instrument python main)
139
139
140
140
.PHONY : runshell
141
141
runshell :
@@ -193,10 +193,15 @@ start-otel-collector:
193
193
podman run -d --rm -ti \
194
194
--name $(OTEL_COLLECTOR_CONTAINER_NAME ) \
195
195
--pod $(POD_NAME ) \
196
- docker.io/otel/opentelemetry-collector-contrib:0.97.0
196
+ --volume $(PWD ) /config/otel-collector-config.yaml:/etc/otel-collector-config.yaml \
197
+ docker.io/otel/opentelemetry-collector-contrib:0.97.0 " --config=/etc/otel-collector-config.yaml"
197
198
198
199
stop-otel-collector :
199
200
podman rm --force --ignore $(OTEL_COLLECTOR_CONTAINER_NAME )
200
201
201
202
wait-otel-collector :
202
203
$(call wait-for, localhost:4317)
204
+
205
+ otel-auto-instrumentation-list :
206
+ @echo " These packages were detected and can be auto-instrumented (maybe add/update them in requirements.txt):"
207
+ @$(call run-command, opentelemetry-bootstrap -a requirements)
Original file line number Diff line number Diff line change 16
16
from themed_excerpts import ThemedExcerptAccessInterface , ThemedExcerptAccessInterface
17
17
from themed_excerpts .themed_excerpt_access import ThemedExcerptRequest
18
18
19
- logging . basicConfig ( level = logging . DEBUG )
19
+
20
20
logger = logging .getLogger (__name__ )
21
+ logger .setLevel (logging .INFO )
22
+
21
23
config = load_configuration ()
22
24
23
25
app = FastAPI (
Original file line number Diff line number Diff line change
1
+ receivers :
2
+ otlp :
3
+ protocols :
4
+ grpc :
5
+ endpoint : 0.0.0.0:4317
6
+ exporters :
7
+ debug :
8
+ verbosity : detailed
9
+ processors :
10
+ batch :
11
+ service :
12
+ pipelines :
13
+ logs :
14
+ receivers : [otlp]
15
+ exporters : [debug]
16
+ processors : [batch]
17
+ traces :
18
+ receivers : [otlp]
19
+ exporters : [debug]
20
+ processors : [batch]
21
+ metrics :
22
+ receivers : [otlp]
23
+ exporters : [debug]
24
+ processors : [batch]
Original file line number Diff line number Diff line change @@ -32,3 +32,17 @@ THEMED_EXCERPT_EMBEDDING_SCORE_FIELD=excerpt_embedding_score
32
32
THEMED_EXCERPT_TFIDF_SCORE_FIELD = excerpt_tfidf_score
33
33
THEMED_EXCERPT_FRAGMENT_SIZE = 10000
34
34
THEMED_EXCERPT_NUMBER_OF_FRAGMENTS = 1
35
+
36
+ OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED = true
37
+ OTEL_PYTHON_LOG_CORRELATION = true
38
+ OTEL_PYTHON_LOG_LEVEL = debug
39
+ OTEL_PYTHON_LOG_FORMAT = " %(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s] - %(message)s"
40
+ OTEL_SERVICE_NAME = querido-diario-api
41
+ OTEL_LOGS_EXPORTER = console,otlp
42
+ OTEL_TRACES_EXPORTER = console,otlp
43
+ OTEL_METRICS_EXPORTER = console,otlp
44
+ OTEL_EXPORTER_OTLP_INSECURE = true
45
+ OTEL_EXPORTER_OTLP_ENDPOINT = http://0.0.0.0:4317
46
+
47
+ # valor alto para não atrapalhar tanto a leitura dos logs durante o desenvolvimento
48
+ OTEL_METRIC_EXPORT_INTERVAL = 60000
Original file line number Diff line number Diff line change @@ -8,4 +8,22 @@ psycopg2==2.8.5
8
8
SQLAlchemy == 1.3.19
9
9
opensearch-py == 2.3.2
10
10
mailjet-rest == 1.3.4
11
- opentelemetry-distro == 0.44b0
11
+ opentelemetry-distro == 0.45b0
12
+ opentelemetry-exporter-otlp == 1.24.0
13
+ opentelemetry-instrumentation == 0.45b0
14
+ opentelemetry-instrumentation-asyncio == 0.45b0
15
+ opentelemetry-instrumentation-aws-lambda == 0.45b0
16
+ opentelemetry-instrumentation-dbapi == 0.45b0
17
+ opentelemetry-instrumentation-logging == 0.45b0
18
+ opentelemetry-instrumentation-sqlite3 == 0.45b0
19
+ opentelemetry-instrumentation-urllib == 0.45b0
20
+ opentelemetry-instrumentation-wsgi == 0.45b0
21
+ opentelemetry-instrumentation-asgi == 0.45b0
22
+ opentelemetry-instrumentation-fastapi == 0.45b0
23
+ opentelemetry-instrumentation-grpc == 0.45b0
24
+ opentelemetry-instrumentation-psycopg2 == 0.45b0
25
+ opentelemetry-instrumentation-requests == 0.45b0
26
+ opentelemetry-instrumentation-sqlalchemy == 0.45b0
27
+ opentelemetry-instrumentation-starlette == 0.45b0
28
+ opentelemetry-instrumentation-tortoiseorm == 0.45b0
29
+ opentelemetry-instrumentation-urllib3 == 0.45b0
You can’t perform that action at this time.
0 commit comments