Instrumenting Flask App with Opentelemetry and SigNoz Issues
TLDR John faced issues with instrumenting Flask app, but with Srikanth's help resolved the errors. vishal-signoz offered further support through a call.
3
3
2
1
Feb 20, 2023 (10 months ago)
John
09:56 PMFROM python:3.7
ADD requirements.txt /app/requirements.txt
WORKDIR /app/
ENV PYTHONPATH "${PYTHONPATH}:/q_pack"
RUN pip install -r requirements.txt
ENV OTEL_RESOURCE_ATTRIBUTES "service.name=dashApp"
ENV OTEL_EXPORTER_OTLP_ENDPOINT ""
RUN ["opentelemetry-bootstrap", "--action=install"]
CMD ["opentelemetry-instrument", "python", "./index.py","--host=0.0.0.0"]
and
dash:
container_name: "dash"
build:
context: ./dockerfiles/dockerfile_dash
# restart: on-failure
ports:
- 8050:8050
- "5001:5001" # app(debug) port
- "3000:3000" # remote debugger attach port
depends_on:
- postgres
volumes:
- ./Storage/dash:/app
- ./Storage/q_pack:/q_pack
environment:
- FLASK_APP=app.py
- FLASK_ENV=development
however, I get the following error:
An instrument with name http.server.active_requests, type UpDownCounter, unit requests and description measures the number of concurrent HTTP requests that are currently in-flight has been created already.
An instrument with name http.server.duration, type Histogram, unit ms and description measures the duration of the inbound HTTP request has been created already.
Transient error StatusCode.UNAVAILABLE encountered while exporting metrics, retrying in 1s.
Transient error StatusCode.UNAVAILABLE encountered while exporting metrics, retrying in 2s.
Additionally, flask is ran with:
app.run(host='0.0.0.0', port=8050, debug=True, use_reloader=False)
from the blog. Am I missing something in the otel-collector-*.yml
files? Thank you!Srikanth
11:51 PMENV OTEL_EXPORTER_OTLP_ENDPOINT ""
When running the app inside the container, you need to ensure the endpoint where SigNoz is receiving the data is set correctly. This expects the receiver within the container and fails, as the output shows. It is either http://otel-collector:4317 if this dashApp runs as a part of the same n/w or http://<host_ip:4317> otherwise.
1
Feb 21, 2023 (10 months ago)
John
01:01 AMTransient error StatusCode.UNAVAILABLE encountered while exporting metrics, retrying in 1s.
error is now gone. However, the "...has been created already" logs is still appearing in the dash container. Additionally, no services is appearing in the Signoz UI even after sending requests in the dash app.John
01:22 AMExceptions
tab in the Signoz UI. Upon fixing this exception, then everything will show up and be tracked properly.Ankit
12:08 PM1
Feb 22, 2023 (10 months ago)
John
04:51 AM2
Feb 23, 2023 (10 months ago)
John
04:17 AM3
2
SigNoz Community
Indexed 1023 threads (61% resolved)
Similar Threads
Troubleshooting SigNoz Auto-Instrumentation Configuration
igor is having trouble configuring auto-instrumentation for Java applications using SigNoz, with traces not appearing in the SigNoz UI. Prashant advises to check logs of the otel sidecar, use service name for endpoint, verify supported libraries, and test with telemetrygen. However, the issue still persists.
Headers in Monitoring HTTP Endpoints & Otel-Collector Error
Rohit asks about providing headers in monitoring HTTP endpoints and reports errors in otel-collector logs. Srikanth mentions headers are unsupported and requires more investigation for errors.
Resolving SigNoz v.0.22 Crash for Python Application
COMER reports a SigNoz v.0.22 crash with their Python app. Despite Srikanth's troubleshooting suggestions and confirmation that their application runs fine without `opentelemetry-instrument`, the cause of the problem remains unclear.