Skip to content

Azure Failures #34616

Open
Open
@mike-england

Description

@mike-england
  • Package Name: azure-monitor-opentelemetry
  • Package Version: 1.3.0
  • Operating System: Debian (bookworm)
  • Python Version: 3.10

Describe the bug
I'm worried I'm opening up an old 'bug': #33741 but I'm still having problems with Failures being reported to Azure Application Insights. The opentelemtry-python-contrib project has updated to include support for Flask 3 (version 1.23.0/0.44b0) and I can confirm that it's working as expected. However, when I include OTEL_PYTHON_EXCLUDED_URLS to keep one of my endpoints from reporting, they're still showing up as a request and a failed one

To Reproduce
Steps to reproduce the behavior:
I'm going to include some sample code in a docker file that you can try:

app.py:

from azure.monitor.opentelemetry import configure_azure_monitor

configure_azure_monitor()

import flask

app = flask.Flask(__name__)

@app.route("/")
def test():
    print('got one')
    return "Test flask request"

@app.route("/health")
def health():
    print('health endpoint')
    return "Health request"

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8080)

Dockerfile:

FROM python:3.10-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

COPY requirements.txt .
RUN python -m pip install -r requirements.txt

WORKDIR /app
COPY . /app

RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

CMD ["python", "app.py"]

requirements.txt:

Flask==3.0.0
azure-monitor-opentelemetry==1.3.0

And to run it:

docker build -t azuretelemetry . && docker run --rm -p 8080:8080 -e APPLICATIONINSIGHTS_CONNECTION_STRING=$APPLICATIONINSIGHTS_CONNECTION_STRING -e OTEL_EXPERIMENTAL_RESOURCE_DETECTORS=$OTEL_EXPERIMENTAL_RESOURCE_DETECTORS -e OTEL_PYTHON_EXCLUDED_URLS=$OTEL_PYTHON_EXCLUDED_URLS azuretelemetry

Where OTEL_PYTHON_EXCLUDED_URLS="health,swagger.*"

Expected behavior
Endpoint requests are ignored

Screenshots
Screenshot 2024-03-04 at 4 01 37 PM

Any suggestions? Is this a different project that would need to take care of this? Am I doing something wrong?

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Monitor - ExporterMonitor OpenTelemetry ExporterService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions